From 95dc2ed1b192200e6f439ed0aa180fcb3bf12c87 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 5 Jan 2026 18:06:58 +0100 Subject: [PATCH 01/37] =?UTF-8?q?[WIP]=20feat(build):=20=E2=9C=A8=20add=20?= =?UTF-8?q?Gradle=20build=20system=20and=20update=20project=20configuratio?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 33 +++ build.gradle.kts | 149 +++++++++++ gradle.properties | 4 + gradle/libs.versions.toml | 46 ++++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 45457 bytes gradle/wrapper/gradle-wrapper.properties | 7 + gradlew | 251 ++++++++++++++++++ gradlew.bat | 94 +++++++ pom.xml | 6 +- settings.gradle.kts | 5 + .../net/buildtheearth/BuildTeamTools.java | 3 - .../net/buildtheearth/modules/Module.java | 14 - .../buildtheearth/modules/ModuleHandler.java | 2 +- .../generator/components/field/Field.java | 3 +- .../components/field/FieldScripts.java | 4 +- .../generator/model/GeneratorCollections.java | 2 +- .../modules/network/api/NetworkAPI.java | 4 +- .../net/buildtheearth/utils/ChatHelper.java | 2 +- .../java/net/buildtheearth/utils/Item.java | 62 ++++- src/main/resources/config.yml | 5 +- src/main/resources/plugin.yml | 20 +- 21 files changed, 662 insertions(+), 54 deletions(-) create mode 100644 build.gradle.kts create mode 100644 gradle.properties create mode 100644 gradle/libs.versions.toml create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle.kts diff --git a/.gitignore b/.gitignore index 94606739..9fad66dd 100644 --- a/.gitignore +++ b/.gitignore @@ -112,3 +112,36 @@ buildNumber.properties # Common working directory run/ .vscode/settings.json + +# Created by https://www.toptal.com/developers/gitignore/api/gradle +# Edit at https://www.toptal.com/developers/gitignore?templates=gradle + +### Gradle ### +.gradle +**/build/ +!src/**/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Avoid ignore Gradle wrappper properties +!gradle-wrapper.properties + +# Cache of project +.gradletasknamecache + +# Eclipse Gradle plugin generated files +# Eclipse Core +.project +# JDT-specific (Eclipse Java Development Tools) +.classpath + +### Gradle Patch ### +# Java heap dump +*.hprof + +# End of https://www.toptal.com/developers/gitignore/api/gradle + diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..8fe34276 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,149 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +plugins { + java + alias(libs.plugins.lombok) + alias(libs.plugins.git.version) + alias(libs.plugins.shadow) +} + +repositories { + //mavenLocal() // NEVER use in Production/Commits! + mavenCentral() + maven { + url = uri("https://repo.papermc.io/repository/maven-public/") + } + + maven { + url = uri("https://maven.buildtheearth.net/releases") + } + + maven { + url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") + } + + maven { + url = uri("https://mvn.alps-bte.com/repository/alps-bte/") + } + + maven { + url = uri("https://repo.onarandombox.com/content/groups/public/") + } + + maven { + url = uri("https://repo.codemc.io/repository/maven-snapshots/") + } + + maven { + url = uri("https://repo.codemc.io/repository/maven-public/") + } + + maven { + url = uri("https://jitpack.io") + } + + maven { + url = uri("https://repo.dmulloy2.net/repository/public/") + } + + maven { + url = uri("https://maven.daporkchop.net/") + } + + maven { + url = uri("https://download.java.net/maven/2") + } + + maven { + url = uri("https://maven.enginehub.org/repo/") + } +} + +dependencies { + implementation(libs.com.alpsbte.alpslib.alpslib.libpsterra) + implementation(libs.com.alpsbte.canvas) + implementation(libs.net.daporkchop.lib.binary) + implementation(libs.com.github.cryptomorin.xseries) + implementation(libs.net.wesjd.anvilgui) + implementation(libs.micycle.clipper2) + implementation(libs.org.json.json) + implementation(libs.com.google.code.gson.gson) + implementation(libs.com.google.guava.guava) + implementation(libs.com.squareup.okhttp3.okhttp.jvm) + implementation(libs.de.micromata.jak.javaapiforkml) + implementation(libs.com.googlecode.json.simple) + compileOnly(libs.io.papermc.paper.paper.api) + compileOnly(libs.com.mojang.authlib) + compileOnly(libs.com.fastasyncworldedit.fastasyncworldedit.core) + compileOnly(libs.com.fastasyncworldedit.fastasyncworldedit.bukkit) +} + +val versionDetails: groovy.lang.Closure by extra +val details = versionDetails() + +group = "net.buildtheearth" +version = "0.2.0" + "-" + details.commitDistance + "-" + details.gitHash + "-SNAPSHOT" +description = "BuildTeamTools" +java.sourceCompatibility = JavaVersion.VERSION_21 +java.targetCompatibility = JavaVersion.VERSION_21 + +tasks.withType { + options.encoding = "UTF-8" +} + +tasks.withType { + options.encoding = "UTF-8" +} + +tasks.shadowJar { + // Exclude annotation classes (e.g. org.jetbrains.annotations) + exclude("org/jetbrains/annotations/**") + // Exclude slf4j classes + exclude("org/slf4j/**") + exclude("META-INF/**") + // Exclude duplicate com.sun.* classes + exclude("com/sun/codemodel/**") + exclude("com/sun/tools/xjc/**") + exclude("com/sun/xml/xsom/**") + archiveClassifier = "" + + val relocationPrefix = "net.buildtheearth.buildteamtools.shaded" + relocate("com.alpsbte.alpslib", "$relocationPrefix.alpslib") + relocate("org.mariadb.jdbc", "$relocationPrefix.jdbc") + relocate("com.zaxxer.hikari", "$relocationPrefix.hikari") + relocate("net.wesjd.anvilgui", "$relocationPrefix.anvilgui") + relocate("com.cryptomorin.xseries", "$relocationPrefix.xseries") + relocate("org.ipvp.canvas", "$relocationPrefix.canvas") + relocate("net.daporkchop.lib.binary", "$relocationPrefix.binary") + relocate("clipper2", "$relocationPrefix.clipper2") + relocate("com.google.gson", "$relocationPrefix.gson") + relocate("de.micromata.jak", "$relocationPrefix.jak") + relocate("org.json", "$relocationPrefix.json") + relocate("com.google.guava", "$relocationPrefix.guava") + relocate("com.squareup.okhttp3", "$relocationPrefix.okhttp3") +} + +tasks.assemble { + dependsOn(tasks.shadowJar) // Ensure that the shadowJar task runs before the build task +} + +tasks.jar { + enabled = false // Disable the default jar task since we are using shadowJar +} + +tasks.processResources { + // work around IDEA-296490 + duplicatesStrategy = DuplicatesStrategy.INCLUDE + with(copySpec { + from("src/main/resources/plugin.yml") { + expand( + mapOf( + "version" to project.version, + "description" to project.description + ) + ) + } + }) +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..6b91bb53 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +# This file was generated by the Gradle 'init' task. +# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +org.gradle.configuration-cache=true + diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..419eb437 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,46 @@ +# This file was generated by the Gradle 'init' task. +# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format + +[versions] +com-alpsbte-alpslib-alpslib-libpsterra = "1.1.3" +com-alpsbte-canvas = "1.3" +com-fastasyncworldedit-fastasyncworldedit-bukkit = "2.12.3" +com-fastasyncworldedit-fastasyncworldedit-core = "2.12.3" +com-github-cryptomorin-xseries = "13.4.0" +com-google-code-gson-gson = "2.13.1" +com-google-guava-guava = "33.4.8-jre" +com-mojang-authlib = "7.0.61" +com-squareup-okhttp3-okhttp-jvm = "5.1.0" +de-micromata-jak-javaapiforkml = "2.2.1" +io-papermc-paper-paper-api = "1.21.10-R0.1-SNAPSHOT" +micycle-clipper2 = "1.2.2" +net-daporkchop-lib-binary = "0.5.7-SNAPSHOT" +net-wesjd-anvilgui = "1.10.8-SNAPSHOT" +org-json-json = "20251224" # https://mvnrepository.com/artifact/org.json/json/20251224 +io-freefair-lombok = "9.1.0" +com-googlecode-json-simple = "1.1.1" # https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple +com-palantir-git-version = "4.0.0" +com-gradleup-shadow = "9.3.0" + +[libraries] +com-alpsbte-alpslib-alpslib-libpsterra = { module = "com.alpsbte.alpslib:alpslib-libpsterra", version.ref = "com-alpsbte-alpslib-alpslib-libpsterra" } +com-alpsbte-canvas = { module = "com.alpsbte:canvas", version.ref = "com-alpsbte-canvas" } +com-fastasyncworldedit-fastasyncworldedit-bukkit = { module = "com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit", version.ref = "com-fastasyncworldedit-fastasyncworldedit-bukkit" } +com-fastasyncworldedit-fastasyncworldedit-core = { module = "com.fastasyncworldedit:FastAsyncWorldEdit-Core", version.ref = "com-fastasyncworldedit-fastasyncworldedit-core" } +com-github-cryptomorin-xseries = { module = "com.github.cryptomorin:XSeries", version.ref = "com-github-cryptomorin-xseries" } +com-google-code-gson-gson = { module = "com.google.code.gson:gson", version.ref = "com-google-code-gson-gson" } +com-google-guava-guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" } +com-mojang-authlib = { module = "com.mojang:authlib", version.ref = "com-mojang-authlib" } +com-squareup-okhttp3-okhttp-jvm = { module = "com.squareup.okhttp3:okhttp-jvm", version.ref = "com-squareup-okhttp3-okhttp-jvm" } +de-micromata-jak-javaapiforkml = { module = "de.micromata.jak:JavaAPIforKml", version.ref = "de-micromata-jak-javaapiforkml" } +io-papermc-paper-paper-api = { module = "io.papermc.paper:paper-api", version.ref = "io-papermc-paper-paper-api" } +micycle-clipper2 = { module = "micycle:clipper2", version.ref = "micycle-clipper2" } +net-daporkchop-lib-binary = { module = "net.daporkchop.lib:binary", version.ref = "net-daporkchop-lib-binary" } +net-wesjd-anvilgui = { module = "net.wesjd:anvilgui", version.ref = "net-wesjd-anvilgui" } +org-json-json = { module = "org.json:json", version.ref = "org-json-json" } +com-googlecode-json-simple = { module = "com.googlecode.json-simple:json-simple", version.ref = "com-googlecode-json-simple" } + +[plugins] +lombok = { id = "io.freefair.lombok", version.ref = "io-freefair-lombok" } +git-version = { id = "com.palantir.git-version", version.ref = "com-palantir-git-version" } +shadow = { id = "com.gradleup.shadow", version.ref = "com-gradleup-shadow" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..8bdaf60c75ab801e22807dde59e12a8735a34077 GIT binary patch literal 45457 zcma&NW0YlEwk;ePwr$(aux;D69T}N{9ky*d!_2U4+qUuIRNZ#Jck8}7U+vcB{`IjNZqX3eq5;s6ddAkU&5{L|^Ow`ym2B0m+K02+~Q)i807X3X94qi>j)C0e$=H zm31v`=T&y}ACuKx7G~yWSYncG=NFB>O2);i9EmJ(9jSamq?Crj$g~1l3m-4M7;BWn zau2S&sSA0b0Rhg>6YlVLQa;D#)1yw+eGs~36Q$}5?avIRne3TQZXb<^e}?T69w<9~ zUmx1cG0uZ?Kd;Brd$$>r>&MrY*3$t^PWF1+J+G_xmpHW=>mly$<>~wHH+Bt3mzN7W zhR)g{_veH6>*KxLJ~~s{9HZm!UeC86d_>42NRqd$ev8zSMq4kt)q*>8kJ8p|^wuKx zq2Is_HJPoQ_apSoT?zJj7vXBp!xejBc^7F|zU0rhy%Ub*Dy#jJs!>1?CmJ-gulPVX zKit>RVmjL=G?>jytf^U@mfnC*1-7EVag@%ROu*#kA+)Rxq?MGK0v-dp^kM?nyMngb z_poL>GLThB7xAO*I7&?4^Nj`<@O@>&0M-QxIi zD@n}s%CYI4Be19C$lAb9Bbm6!R{&A;=yh=#fnFyb`s7S5W3?arZf?$khCwkGN!+GY~GT8-`!6pFr zbFBVEF`kAgtecfjJ`flN2Z!$$8}6hV>Tu;+rN%$X^t8fI>tXQnRn^$UhXO8Gu zt$~QON8`doV&{h}=2!}+xJKrNPcIQid?WuHUC-i%P^F(^z#XB`&&`xTK&L+i8a3a@ zkV-Jy;AnyQ`N=&KONV_^-0WJA{b|c#_l=v!19U@hS~M-*ix16$r01GN3#naZ|DxY2 z76nbjbOnFcx4bKbEoH~^=EikiZ)_*kOb>nW6>_vjf-UCf0uUy~QBb7~WfVO6qN@ns zz=XEG0s5Yp`mlmUad)8!(QDgIzY=OK%_hhPStbyYYd|~zDIc3J4 zy9y%wZOW>}eG4&&;Z>vj&Mjg+>4gL! z(@oCTFf-I^54t=*4AhKRoE-0Ky=qg3XK2Mu!Bmw@z>y(|a#(6PcfbVTw-dUqyx4x4 z3O#+hW1ANwSv-U+9otHE#U9T>(nWx>^7RO_aI>${jvfZQ{mUwiaxHau!H z0Nc}ucJu+bKux?l!dQ2QA(r@(5KZl(Or=U!=2K*8?D=ZT-IAcAX!5OI3w@`sF@$($ zbDk0p&3X0P%B0aKdijO|s})70K&mk1DC|P##b=k@fcJ|lo@JNWRUc>KL?6dJpvtSUK zxR|w8Bo6K&y~Bd}gvuz*3z z@sPJr{(!?mi@okhudaM{t3gp9TJ!|@j4eO1C&=@h#|QLCUKLaKVL z!lls$%N&ZG7yO#jK?U>bJ+^F@K#A4d&Jz4boGmptagnK!Qu{Ob>%+60xRYK>iffd_ z>6%0K)p!VwP$^@Apm%NrS6TpKJwj_Q=k~?4=_*NIe~eh_QtRaqX4t-rJAGYdB{pGq zSXX)-dR8mQ)X|;8@_=J6Dk7MfMp;x)^aZeCtScHs12t3vL+p-6!qhPkOM1OYQ z8YXW5tWp)Th(+$m7SnV_hNGKAP`JF4URkkNc@YV9}FK$9k zR&qgi$Cj#4bC1VK%#U)f%(+oQJ+EqvV{uAq1YG0riLvGxW@)m;*ayU-BSW61COFy0 z(-l>GJqYl;*x1PnRZ(p3Lm}* zlkpWyCoYtg9pAZ5RU^%w=vN{3Y<6WImxj(*SCcJsFj?o6CZ~>cWW^foliM#qN#We{ zwsL!u1$rzC1#4~bILZm*a!T{^kCci$XOJADm)P;y^%x5)#G#_!2uNp^S;cE`*ASCn;}H7pP^RRA z6lfXK(r4dy<_}R|(7%Lyo>QFP#s31E8zsYA${gSUykUV@?lyDNF=KhTeF^*lu7C*{ zBCIjy;bIE;9inJ$IT8_jL%)Q{7itmncYlkf2`lHl(gTwD%LmEPo^gskydVxMd~Do` zO8EzF!yn!r|BEgPjhW#>g(unY#n}=#4J;3FD2ThN5LpO0tI2~pqICaFAGT%%;3Xx$ z>~Ng(64xH-RV^Rj4=A_q1Ee8kcF}8HN{5kjYX0ADh}jq{q18x(pV!23pVsK5S}{M#p8|+LvfKx|_3;9{+6cu7%5o-+R@z>TlTft#kcJ`s2-j zUe4dgpInZU!<}aTGuwgdWJZ#8TPiV9QW<-o!ibBn&)?!ZDomECehvT7GSCRyF#VN2&5GShch9*}4p;8TX~cW*<#( zv-HmU7&+YUWO__NN3UbTFJ&^#3vxW4U9q5=&ORa+2M$4rskA4xV$rFSEYBGy55b{z z!)$_fYXiY?-GWDhGZXgTw}#ilrw=BiN(DGO*W7Vw(} zjUexksYLt_Nq?pl_nVa@c1W#edQKbT>VSN1NK?DulHkFpI-LXl7{;dl@z0#v?x%U& z8k8M1X6%TwR4BQ_eEWJASvMTy?@fQubBU__A_US567I-~;_VcX^NJ-E(ZPR^NASj1 zVP!LIf8QKtcdeH#w6ak50At)e={eF_Ns6J2Iko6dn8Qwa6!NQHZMGsD zhzWeSFK<{hJV*!cIHxjgR+e#lkUHCss-j)$g zF}DyS531TUXKPPIoePo{yH%qEr-dLMOhv^sC&@9YI~uvl?rBp^A-57{aH_wLg0&a|UxKLlYZQ24fpb24Qjil`4OCyt0<1eu>5i1Acv zaZtQRF)Q;?Aw3idg;8Yg9Cb#)03?pQ@O*bCloG zC^|TnJl`GXN*8iI;Ql&_QIY0ik}rqB;cNZ-qagp=qmci9eScHsRXG$zRNdf4SleJ} z7||<#PCW~0>3u8PP=-DjNhD(^(B0AFF+(oKOiQyO5#v4nI|v_D5@c2;zE`}DK!%;H zUn|IZ6P;rl*5`E(srr6@-hpae!jW=-G zC<*R?RLwL;#+hxN4fJ!oP4fX`vC3&)o!#l4y@MrmbmL{t;VP%7tMA-&vju_L zhtHbOL4`O;h*5^e3F{b9(mDwY6JwL8w`oi28xOyj`pVo!75hngQDNg7^D$h4t&1p2 ziWD_!ap3GM(S)?@UwWk=Szym^eDxSx3NaR}+l1~(@0car6tfP#sZRTb~w!WAS{+|SgUN3Tv`J4OMf z9ta_f>-`!`I@KA=CXj_J>CE7T`yGmej0}61sE(%nZa1WC_tV6odiysHA5gzfWN-`uXF46mhJGLpvNTBmx$!i zF67bAz~E|P{L6t1B+K|Cutp&h$fDjyq9JFy$7c_tB(Q$sR)#iMQH3{Og1AyD^lyQwX6#B|*ecl{-_;*B>~WSFInaRE_q6 zpK#uCprrCb`MU^AGddA#SS{P7-OS9h%+1`~9v-s^{s8faWNpt*Pmk_ECjt(wrpr{C_xdAqR(@!ERTSs@F%^DkE@No}wqol~pS^e7>ksF_NhL0?6R4g`P- zk8lMrVir~b(KY+hk5LQngwm`ZQT5t1^7AzHB2My6o)_ejR0{VxU<*r-Gld`l6tfA` zKoj%x9=>Ce|1R|1*aC}|F0R32^KMLAHN}MA<8NNaZ^j?HKxSwxz`N2hK8lEb{jE0& zg4G_6F@#NyDN?=i@=)eidKhlg!nQoA{`PgaH{;t|M#5z}a`u?^gy{5L~I2smLR z*4RmNxHqf9>D>sXSemHK!h4uPwMRb+W`6F>Q6j@isZ>-F=)B2*sTCD9A^jjUy)hjAw71B&$u}R(^R; zY9H3k8$|ounk>)EOi_;JAKV8U8ICSD@NrqB!&=)Ah_5hzp?L9Sw@c>>#f_kUhhm=p z1jRz8X7)~|VwO(MF3PS(|CL++1n|KT3*dhGjg!t_vR|8Yg($ z+$S$K=J`K6eG#^(J54=4&X#+7Car=_aeAuC>dHE+%v9HFu>r%ry|rwkrO-XPhR_#K zS{2Unv!_CvS7}Mb6IIT$D4Gq5v$Pvi5nbYB+1Yc&RY;3;XDihlvhhIG6AhAHsBYsm zK@MgSzs~y|+f|j-lsXKT0(%E2SkEb)p+|EkV5w8=F^!r1&0#0^tGhf9yPZ)iLJ^ zIXOg)HW_Vt{|r0W(`NmMLF$?3ZQpq+^OtjR-DaVLHpz%1+GZ7QGFA?(BIqBlVQ;)k zu)oO|KG&++gD9oL7aK4Zwjwi~5jqk6+w%{T$1`2>3Znh=OFg|kZ z>1cn>CZ>P|iQO%-Pic8wE9c*e%=3qNYKJ+z1{2=QHHFe=u3rqCWNhV_N*qzneN8A5 zj`1Ir7-5`33rjDmyIGvTx4K3qsks(I(;Kgmn%p#p3K zn8r9H8kQu+n@D$<#RZtmp$*T4B&QvT{K&qx(?>t@mX%3Lh}sr?gI#vNi=vV5d(D<=Cp5-y!a{~&y|Uz*PU{qe zI7g}mt!txT)U(q<+Xg_sSY%1wVHy;Dv3uze zJ>BIdSB2a|aK+?o63lR8QZhhP)KyQvV`J3)5q^j1-G}fq=E4&){*&hiam>ssYm!ya z#PsY0F}vT#twY1mXkGYmdd%_Uh12x0*6lN-HS-&5XWbJ^%su)-vffvKZ%rvLHVA<; zJP=h13;x?$v30`T)M)htph`=if#r#O5iC^ZHeXc6J8gewn zL!49!)>3I-q6XOZRG0=zjyQc`tl|RFCR}f-sNtc)I^~?Vv2t7tZZHvgU2Mfc9$LqG z!(iz&xb=q#4otDBO4p)KtEq}8NaIVcL3&pbvm@0Kk-~C@y3I{K61VDF_=}c`VN)3P z+{nBy^;=1N`A=xH$01dPesY_na*zrcnssA}Ix60C=sWg9EY=2>-yH&iqhhm28qq9Z z;}znS4ktr40Lf~G@6D5QxW&?q^R|=1+h!1%G4LhQs54c2Wo~4% zCA||d==lv2bP=9%hd0Dw_a$cz9kk)(Vo}NpSPx!vnV*0Bh9$CYP~ia#lEoLRJ8D#5 zSJS?}ABn1LX>8(Mfg&eefX*c0I5bf4<`gCy6VC{e>$&BbwFSJ0CgVa;0-U7=F81R+ zUmzz&c;H|%G&mSQ0K16Vosh?sjJW(Gp+1Yw+Yf4qOi|BFVbMrdO6~-U8Hr|L@LHeZ z0ALmXHsVm137&xnt#yYF$H%&AU!lf{W436Wq87nC16b%)p?r z70Wua59%7Quak50G7m3lOjtvcS>5}YL_~?Pti_pfAfQ!OxkX$arHRg|VrNx>R_Xyi z`N|Y7KV`z3(ZB2wT9{Dl8mtl zg^UOBv~k>Z(E)O>Z;~Z)W&4FhzwiPjUHE9&T#nlM)@hvAZL>cha-< zQ8_RL#P1?&2Qhk#c9fK9+xM#AneqzE-g(>chLp_Q2Xh$=MAsW z2ScEKr+YOD*R~mzy{bOJjs;X2y1}DVFZi7d_df^~((5a2%p%^4cf>vM_4Sn@@ssVJ z9ChGhs zbanJ+h74)3tWOviXI|v!=HU2mE%3Th$Mpx&lEeGFEBWRy8ogJY`BCXj@7s~bjrOY! z4nIU5S>_NrpN}|waZBC)$6ST8x91U2n?FGV8lS{&LFhHbuHU?SVU{p7yFSP_f#Eyh zJhI@o9lAeEwbZYC=~<(FZ$sJx^6j@gtl{yTOAz`Gj!Ab^y})eG&`Qt2cXdog2^~oOH^K@oHcE(L;wu2QiMv zJuGdhNd+H{t#Tjd<$PknMSfbI>L1YIdZ+uFf*Z=BEM)UPG3oDFe@8roB0h(*XAqRc zoxw`wQD@^nxGFxQXN9@GpkLqd?9@(_ZRS@EFRCO8J5{iuNAQO=!Lo5cCsPtt4=1qZN8z`EA2{ge@SjTyhiJE%ttk{~`SEl%5>s=9E~dUW0uws>&~3PwXJ!f>ShhP~U9dLvE8ElNt3g(6-d zdgtD;rgd^>1URef?*=8BkE&+HmzXD-4w61(p6o~Oxm`XexcHmnR*B~5a|u-Qz$2lf zXc$p91T~E4psJxhf^rdR!b_XmNv*?}!PK9@-asDTaen;p{Rxsa=1E}4kZ*}yQPoT0 zvM}t!CpJvk<`m~^$^1C^o1yM(BzY-Wz2q7C^+wfg-?}1bF?5Hk?S{^#U%wX4&lv0j zkNb)byI+nql(&65xV?_L<0tj!KMHX8Hmh2(udEG>@OPQ}KPtdwEuEb$?acp~yT1&r z|7YU<(v!0as6Xff5^XbKQIR&MpjSE)pmub+ECMZzn7c!|hnm_Rl&H_oXWU2!h7hhf zo&-@cLkZr#eNgUN9>b=QLE1V^b`($EX3RQIyg#45A^=G!jMY`qJ z8qjZ$*-V|?y0=zIM>!2q!Gi*t4J5Otr^OT3XzQ_GjATc(*eM zqllux#QtHhc>YtnswBNiS^t(dTDn|RYSI%i%-|sv1wh&|9jfeyx|IHowW)6uZWR<%n8I}6NidBm zJ>P7#5m`gnXLu;?7jQZ!PwA80d|AS*+mtrU6z+lzms6^vc4)6Zf+$l+Lk3AsEK7`_ zQ9LsS!2o#-pK+V`g#3hC$6*Z~PD%cwtOT8;7K3O=gHdC=WLK-i_DjPO#WN__#YLX|Akw3LnqUJUw8&7pUR;K zqJ98?rKMXE(tnmT`#080w%l1bGno7wXHQbl?QFU=GoK@d!Ov=IgsdHd-iIs4ahcgSj(L@F96=LKZ zeb5cJOVlcKBudawbz~AYk@!^p+E=dT^UhPE`96Q5J~cT-8^tp`J43nLbFD*Nf!w;6 zs>V!5#;?bwYflf0HtFvX_6_jh4GEpa0_s8UUe02@%$w^ym&%wI5_APD?9S4r9O@4m zq^Z5Br8#K)y@z*fo08@XCs;wKBydn+60ks4Z>_+PFD+PVTGNPFPg-V-|``!0l|XrTyUYA@mY?#bJYvD>jX&$o9VAbo?>?#Z^c+Y4Dl zXU9k`s74Sb$OYh7^B|SAVVz*jEW&GWG^cP<_!hW+#Qp|4791Od=HJcesFo?$#0eWD z8!Ib_>H1WQE}shsQiUNk!uWOyAzX>r(-N7;+(O333_ES7*^6z4{`p&O*q8xk{0xy@ zB&9LkW_B}_Y&?pXP-OYNJfqEWUVAPBk)pTP^;f+75Wa(W>^UO_*J05f1k{ zd-}j!4m@q#CaC6mLsQHD1&7{tJ*}LtE{g9LB>sIT7)l^ucm8&+L0=g1E_6#KHfS>A_Z?;pFP96*nX=1&ejZ+XvZ=ML`@oVu>s^WIjn^SY}n zboeP%`O9|dhzvnw%?wAsCw*lvVcv%bmO5M4cas>b%FHd;A6Z%Ej%;jgPuvL$nk=VQ=$-OTwslYg zJQtDS)|qkIs%)K$+r*_NTke8%Rv&w^v;|Ajh5QXaVh}ugccP}3E^(oGC5VO*4`&Q0 z&)z$6i_aKI*CqVBglCxo#9>eOkDD!voCJRFkNolvA2N&SAp^4<8{Y;#Kr5740 za|G`dYGE!9NGU3Ge6C)YByb6Wy#}EN`Ao#R!$LQ&SM#hifEvZp>1PAX{CSLqD4IuO z4#N4AjMj5t2|!yTMrl5r)`_{V6DlqVeTwo|tq4MHLZdZc5;=v9*ibc;IGYh+G|~PB zx2}BAv6p$}?7YpvhqHu7L;~)~Oe^Y)O(G(PJQB<&2AhwMw!(2#AHhjSsBYUd8MDeM z+UXXyV@@cQ`w}mJ2PGs>=jHE{%i44QsPPh(=yorg>jHic+K+S*q3{th6Ik^j=@%xo zXfa9L_<|xTL@UZ?4H`$vt9MOF`|*z&)!mECiuenMW`Eo2VE#|2>2ET7th6+VAmU(o zq$Fz^TUB*@a<}kr6I>r;6`l%8NWtVtkE?}Q<<$BIm*6Z(1EhDtA29O%5d1$0q#C&f zFhFrrss{hOsISjYGDOP*)j&zZUf9`xvR8G)gwxE$HtmKsezo`{Ta~V5u+J&Tg+{bh zhLlNbdzJNF6m$wZNblWNbP6>dTWhngsu=J{);9D|PPJ96aqM4Lc?&6H-J1W15uIpQ ziO{&pEc2}-cqw+)w$`p(k(_yRpmbp-Xcd`*;Y$X=o(v2K+ISW)B1(ZnkV`g4rHQ=s z+J?F9&(||&86pi}snC07Lxi1ja>6kvnut;|Ql3fD)%k+ASe^S|lN69+Ek3UwsSx=2EH)t}K>~ z`Mz-SSVH29@DWyl`ChuGAkG>J;>8ZmLhm>uEmUvLqar~vK3lS;4s<{+ehMsFXM(l- zRt=HT>h9G)JS*&(dbXrM&z;)66C=o{=+^}ciyt8|@e$Y}IREAyd_!2|CqTg=eu}yG z@sI9T;Tjix*%v)c{4G84|0j@8wX^Iig_JsPU|T%(J&KtJ>V zsAR+dcmyT5k&&G{!)VXN`oRS{n;3qd`BgAE9r?%AHy_Gf8>$&X$=>YD7M911?<{qX zkJ;IOfY$nHdy@kKk_+X%g3`T(v|jS;>`pz`?>fqMZ>Fvbx1W=8nvtuve&y`JBfvU~ zr+5pF!`$`TUVsx3^<)48&+XT92U0DS|^X6FwSa-8yviRkZ*@Wu|c*lX!m?8&$0~4T!DB0@)n}ey+ew}T1U>|fH3=W5I!=nfoNs~OkzTY7^x^G&h>M7ewZqmZ=EL0}3#ikWg+(wuoA{7hm|7eJz zNz78l-K81tP16rai+fvXtspOhN-%*RY3IzMX6~8k9oFlXWgICx9dp;`)?Toz`fxV@&m8< z{lzWJG_Y(N1nOox>yG^uDr}kDX_f`lMbtxfP`VD@l$HR*B(sDeE(+T831V-3d3$+% zDKzKnK_W(gLwAK{Saa2}zaV?1QmcuhDu$)#;*4gU(l&rgNXB^WcMuuTki*rt>|M)D zoI;l$FTWIUp}euuZjDidpVw6AS-3dal2TJJaVMGj#CROWr|;^?q>PAo2k^u-27t~v zCv10IL~E)o*|QgdM!GJTaT&|A?oW)m9qk2{=y*7qb@BIAlYgDIe)k(qVH@)#xx6%7 z@)l%aJwz5Joc84Q2jRp71d;=a@NkjSdMyN%L6OevML^(L0_msbef>ewImS=+DgrTk z4ON%Y$mYgcZ^44O*;ctP>_7=}=pslsu>~<-bw=C(jeQ-X`kUo^BS&JDHy%#L32Cj_ zXRzDCfCXKXxGSW9yOGMMOYqPKnU zTF6gDj47!7PoL%z?*{1eyc2IVF*RXX?mj1RS}++hZg_%b@6&PdO)VzvmkXxJ*O7H} z6I7XmJqwX3<>z%M@W|GD%(X|VOZ7A+=@~MxMt8zhDw`yz?V>H%C0&VY+ZZ>9AoDVZeO1c~z$r~!H zA`N_9p`X?z>jm!-leBjW1R13_i2(0&aEY2$l_+-n#powuRO;n2Fr#%jp{+3@`h$c< zcFMr;18Z`UN#spXv+3Ks_V_tSZ1!FY7H(tdAk!v}SkoL9RPYSD3O5w>A3%>7J+C-R zZfDmu=9<1w1CV8rCMEm{qyErCUaA3Q zRYYw_z!W7UDEK)8DF}la9`}8z*?N32-6c-Bwx^Jf#Muwc67sVW24 zJ4nab%>_EM8wPhL=MAN)xx1tozAl zmhXN;*-X%)s>(L=Q@vm$qmuScku>PV(W_x-6E?SFRjSk)A1xVqnml_92fbj0m};UC zcV}lRW-r*wY106|sshV`n#RN{)D9=!>XVH0vMh>od=9!1(U+sWF%#B|eeaKI9RpaW z8Ol_wAJX%j0h5fkvF)WMZ1}?#R(n-OT0CtwsL)|qk;*(!a)5a5ku2nCR9=E*iOZ`9 zy4>LHKt-BgHL@R9CBSG!v4wK zvjF8DORRva)@>nshE~VM@i2c$PKw?3nz(6-iVde;-S~~7R<5r2t$0U8k2_<5C0!$j zQg#lsRYtI#Q1YRs(-%(;F-K7oY~!m&zhuU4LL}>jbLC>B`tk8onRRcmIm{{0cpkD|o@Ixu#x9Wm5J)3oFkbfi62BX8IX1}VTe#{C(d@H|#gy5#Sa#t>sH@8v1h8XFgNGs?)tyF_S^ueJX_-1%+LR`1X@C zS3Oc)o)!8Z9!u9d!35YD^!aXtH;IMNzPp`NS|EcdaQw~<;z`lmkg zE|tQRF7!S!UCsbag%XlQZXmzAOSs= zIUjgY2jcN9`xA6mzG{m|Zw=3kZC4@XY=Bj%k8%D&iadvne$pYNfZI$^2BAB|-MnZW zU4U?*qE3`ZDx-bH})>wz~)a z_SWM!E=-BS#wdrfh;EfPNOS*9!;*+wp-zDthj<>P0a2n?$xfe;YmX~5a;(mNV5nKx zYR86%WtAPsOMIg&*o9uUfD!v&4(mpS6P`bFohPP<&^fZzfA|SvVzPQgbtwwM>IO>Z z75ejU$1_SB1tn!Y-9tajZ~F=Fa~{cnj%Y|$;%z6fJV1XC0080f)Pj|87j142q6`i>#)BCIi+x&jAH9|H#iMvS~?w;&E`y zoarJ)+5HWmZ{&OqlzbdQU=SE3GKmnQq zI{h6f$C@}Mbqf#JDsJyi&7M0O2ORXtEB`#cZ;#AcB zkao0`&|iH8XKvZ_RH|VaK@tAGKMq9x{sdd%p-o`!cJzmd&hb86N!KKxp($2G?#(#BJn5%hF0(^`= z2qRg5?82({w-HyjbffI>eqUXavp&|D8(I6zMOfM}0;h%*D_Dr@+%TaWpIEQX3*$vQ z8_)wkNMDi{rW`L+`yN^J*Gt(l7PExu3_hrntgbW0s}7m~1K=(mFymoU87#{|t*fJ?w8&>Uh zcS$Ny$HNRbT!UCFldTSp2*;%EoW+yhJD8<3FUt8@XSBeJM2dSEz+5}BWmBvdYK(OA zlm`nDDsjKED{$v*jl(&)H7-+*#jWI)W|_X)!em1qpjS_CBbAiyMt;tx*+0P%*m&v< zxV9rlslu8#cS!of#^1O$(ds8aviMFiT`6W+FzMHW{YS+SieJ^?TQb%NT&pasw^kbc znd`=%(bebvrNx3#7vq@vAX-G`4|>cY0svIXopH02{v;GZ{wJM#psz4!m8(IZu<)9D zqR~U7@cz-6H{724_*}-DWwE8Sk+dYBb*O-=c z+wdchFcm6$$^Z0_qGnv0P`)h1=D$_eg8!2-|7Y;o*c)4ax!Me0*EVcioh{wI#!qcb z1&xhOotXMrlo7P6{+C8m;E#4*=8(2y!r0d<6 zKi$d2X;O*zS(&Xiz_?|`ympxITf|&M%^WHp=694g6W@k+BL_T1JtSYX0OZ}o%?Pzu zJ{%P8A$uq?4F!NWGtq>_GLK3*c6dIcGH)??L`9Av&0k$A*14ED9!e9z_SZd3OH6ER zg%5^)3^gw;4DFw(RC;~r`bPJOR}H}?2n60=g4ESUTud$bkBLPyI#4#Ye{5x3@Yw<* z;P5Up>Yn(QdP#momCf=kOzZYzg9E330=67WOPbCMm2-T1%8{=or9L8+HGL{%83lri zODB;Y|LS`@mn#Wmez7t6-x`a2{}U9hE|xY7|BVcFCqoAZQzsEi=dYHB z(bqG3J5?teVSBqTj{aiqe<9}}CEc$HdsJSMp#I;4(EXRy_k|Y8X#5hwkqAaIGKARF zX?$|UO{>3-FU;IlFi80O^t+WMNw4So2nsg}^T1`-Ox&C%Gn_AZ-49Nir=2oYX6 z`uVke@L5PVh)YsvAgFMZfKi{DuSgWnlAaag{RN6t6oLm6{4)H~4xg#Xfcq-e@ALk& z@UP4;uCe(Yjg4jaJZ4pu*+*?4#+XCi%sTrqaT*jNY7|WQ!oR;S8nt)cI27W$Sz!94 z01zoTW`C*P3E?1@6thPe(QpIue$A54gp#C7pmfwRj}GxIw$!!qQetn`nvuwIvMBQ; zfF8K-D~O4aJKmLbNRN1?AZsWY&rp?iy`LP^3KT0UcGNy=Z@7qVM(#5u#Du#w>a&Bs z@f#zU{wk&5n!YF%D11S9*CyaI8%^oX=vq$Ei9cL1&kvv9|8vZD;Mhs1&slm`$A%ED zvz6SQ8aty~`IYp2Xd~G$z%Jf4zwVPKkCtqObrnc2gHKj^jg&-NH|xdNK_;+2d4ZXw zN9j)`jcp7y65&6P@}LsD_OLSi(#GW#hC*qF5KpmeXuQDNS%ZYpuW<;JI<>P6ln!p@ z>KPAM>8^cX|2!n@tV=P)f2Euv?!}UM`^RJ~nTT@W>KC2{{}xXS{}WH{|3najkiEUj z7l;fUWDPCtzQ$?(f)6RvzW~Tqan$bXibe%dv}**BqY!d4J?`1iX`-iy8nPo$s4^mQ z5+@=3xuZAl#KoDF*%>bJ4UrEB2EE8m7sQn!r7Z-ggig`?yy`p~3;&NFukc$`_>?}a z?LMo2LV^n>m!fv^HKKRrDn|2|zk?~S6i|xOHt%K(*TGWkq3{~|9+(G3M-L=;U-YRa zp{kIXZ8P!koE;BN2A;nBx!={yg4v=-xGOMC#~MA07zfR)yZtSF_2W^pDLcXg->*WD zY7Sz5%<_k+lbS^`y)=vX|KaN!gEMQob|(`%nP6huwr$%^?%0^vwr$(CZQD*Jc5?E( zb-q9E`OfoWSJ$rUs$ILfSFg3Mb*-!Ozgaz^%7ZkX@=3km0G;?+e?FQT_l5A9vKr<> z_CoemDo@6YIyl57l*gnJ^7+8xLW5oEGzjLv2P8vj*Q%O1^KOfrsC6eHvk{+$BMLGu z%goP8UY?J7Lj=@jcI$4{m2Sw?1E%_0C7M$lj}w{E#hM4%3QX|;tH6>RJf-TI_1A0w z@KcTEFx(@uitbo?UMMqUaSgt=n`Bu*;$4@cbg9JIS})3#2T;B7S

Z?HZkSa`=MM?n)?|XcM)@e1qmzJ$_4K^?-``~Oi&38`2}sjmP?kK z$yT)K(UU3fJID@~3R;)fU%k%9*4f>oq`y>#t90$(y*sZTzWcW$H=Xv|%^u^?2*n)Csx;35O0v7Nab-REgxDZNf5`cI69k$` zx(&pP6zVxlK5Apn5hAhui}b)(IwZD}D?&)_{_yTL7QgTxL|_X!o@A`)P#!%t9al+# zLD(Rr+?HHJEOl545~m1)cwawqY>cf~9hu-L`crI^5p~-9Mgp9{U5V&dJSwolnl_CM zwAMM1Tl$D@>v?LN2PLe0IZrQL1M zcA%i@Lc)URretFJhtw7IaZXYC6#8slg|*HfUF2Z5{3R_tw)YQ94=dprT`SFAvHB+7 z)-Hd1yE8LB1S+4H7iy$5XruPxq6pc_V)+VO{seA8^`o5{T5s<8bJ`>I3&m%R4cm1S z`hoNk%_=KU2;+#$Y!x7L%|;!Nxbu~TKw?zSP(?H0_b8Qqj4EPrb@~IE`~^#~C%D9k zvJ=ERh`xLgUwvusQbo6S=I5T+?lITYsVyeCCwT9R>DwQa&$e(PxF<}RpLD9Vm2vV# zI#M%ksVNFG1U?;QR{Kx2sf>@y$7sop6SOnBC4sv8S0-`gEt0eHJ{`QSW(_06Uwg*~ zIw}1dZ9c=K$a$N?;j`s3>)AqC$`ld?bOs^^stmYmsWA$XEVhUtGlx&OyziN1~2 z)s5fD(d@gq7htIGX!GCxKT=8aAOHW&DAP=$MpZ)SpeEZhk83}K) z0(Uv)+&pE?|4)D2PX4r6gOGHDY}$8FSg$3eDb*nEVmkFQ#lFpcH~IPeatiH3nPTkP z*xDN7l}r2GM9jwSsl=*!547nRPCS0pb;uE#myTqV+=se>bU=#e)f2}wCp%f-cIrh`FHA$2`monVy?qvJ~o2B6I7IE28bCY4=c#^){*essLG zXUH50W&SWmi{RIG9G^p;PohSPtC}djjXSoC)kyA8`o+L}SjE{i?%;Vh=h;QC{s`T7 zLmmHCr8F}#^O8_~lR)^clv$mMe`e*{MW#Sxd`rDckCnFBo9sC*vw2)dA9Q3lUi*Fy zgDsLt`xt|7G=O6+ms=`_FpD4}37uvelFLc^?snyNUNxbdSj2+Mpv<67NR{(mdtSDNJ3gSD@>gX_7S5 zCD)JP5Hnv!llc-9fwG=4@?=%qu~(4j>YXtgz%gZ#+A9i^H!_R!MxWlFsH(ClP3dU} za&`m(cM0xebj&S170&KLU%39I+XVWOJ_1XpF^ip}3|y()Fn5P@$pP5rvtiEK6w&+w z7uqIxZUj$#qN|<_LFhE@@SAdBy8)xTu>>`xC>VYU@d}E)^sb9k0}YKr=B8-5M?3}d z7&LqQWQ`a&=ihhANxe3^YT>yj&72x#X4NXRTc#+sk;K z=VUp#I(YIRO`g7#;5))p=y=MQ54JWeS(A^$qt>Y#unGRT$0BG=rI(tr>YqSxNm+-x z6n;-y8B>#FnhZX#mhVOT30baJ{47E^j-I6EOp;am;FvTlYRR2_?CjCWY+ypoUD-2S zqnFH6FS+q$H$^7>>(nd^WE+?Zn#@HU3#t|&=JnEDgIU+;CgS+krs+Y8vMo6U zHVkPoReZ-Di3z!xdBu#aW1f{8sC)etjN90`2|Y@{2=Os`(XLL9+ z1$_PE$GgTQrVx`^sx=Y(_y-SvquMF5<`9C=vM52+e+-r=g?D z+E|97MyoaK5M^n1(mnWeBpgtMs8fXOu4Q$89C5q4@YY0H{N47VANA1}M2e zspor6LdndC=kEvxs3YrPGbc;`q}|zeg`f;t3-8na)dGdZ9&d(n{|%mNaHaKJOA~@8 zgP?nkzV-=ULb)L3r`p)vj4<702a5h~Y%byo4)lh?rtu1YXYOY+qyTwzs!59I zL}XLe=q$e<+Wm7tvB$n88#a9LzBkgHhfT<&i#%e*y|}@I z!N~_)vodngB7%CI2pJT*{GX|cI5y>ZBN)}mezK~fFv@$*L`84rb0)V=PvQ2KN}3lTpT@$>a=CP?kcC0S_^PZ#Vd9#CF4 zP&`6{Y!hd^qmL!zr#F~FB0yag-V;qrmW9Jnq~-l>Sg$b%%TpO}{Q+*Pd-@n2suVh_ zSYP->P@# z&gQ^f{?}m(u5B9xqo63pUvDsJDQJi5B~ak+J{tX8$oL!_{Dh zL@=XFzWb+83H3wPbTic+osVp&~UoW3SqK0#P6+BKbOzK65tz)-@AW#g}Ew+pE3@ zVbdJkJ}EM@-Ghxp_4a)|asEk* z5)mMI&EK~BI^aaTMRl)oPJRH^Ld{;1FC&#pS`gh;l3Y;DF*`pR%OSz8U@B@zJxPNX zwyP_&8GsQ7^eYyUO3FEE|9~I~X8;{WTN=DJW0$2OH=3-!KZG=X6TH?>URr(A0l@+d zj^B9G-ACel;yYGZc}G`w9sR$Mo{tzE7&%XKuW$|u7DM<6_z}L>I{o`(=!*1 z{5?1p3F^aBONr6Ws!6@G?XRxJxXt_6b}2%Bp=0Iv5ngnpU^P+?(?O0hKwAK z*|wAisG&8&Td1XY+6qI~-5&+4DE2p|Dj8@do;!40o)F)QuoeUY;*I&QZ0*4?u)$s`VTkNl1WG`}g@J_i zjjmv4L%g&>@U9_|l>8^CN}`@4<D2aMN&?XXD-HNnsVM`irjv$ z^YVNUx3r1{-o6waQfDp=OG^P+vd;qEvd{UUYc;gF0UwaeacXkw32He^qyoYHjZeFS zo(#C9#&NEdFRcFrj7Q{CJgbmDejNS!H%aF6?;|KJQn_*Ps3pkq9yE~G{0wIS*mo0XIEYH zzIiJ>rbmD;sGXt#jlx7AXSGGcjty)5z5lTGp|M#5DCl0q0|~pNQ%1dP!-1>_7^BA~ zwu+uumJmTCcd)r|Hc)uWm7S!+Dw4;E|5+bwPb4i17Ued>NklnnsG+A{T-&}0=sLM- zY;sA9v@YH>b9#c$Vg{j@+>UULBX=jtu~N^%Y#BB5)pB|$?0Mf7msMD<7eACoP1(XY zPO^h5Brvhn$%(0JSo3KFwEPV&dz8(P41o=mo7G~A*P6wLJ@-#|_A z7>k~4&lbqyP1!la!qmhFBfIfT?nIHQ0j2WlohXk^sZ`?8-vwEwV0~uu{RDE^0yfl$ znua{^`VTZ)-h#ch_6^e2{VPaE@o&55|3dx$z_b6gbqduXJ(Lz(zq&ZbJ6qA4Ac4RT zhJO4KBLN!t;h(eW(?cZJw^swf8lP@tWMZ8GD)zg)siA3!2EJYI(j>WI$=pK!mo!Ry z?q&YkTIbTTr<>=}+N8C_EAR0XQL2&O{nNAXb?33iwo8{M``rUHJgnk z8KgZzZLFf|(O6oeugsm<;5m~4N$2Jm5#dph*@TgXC2_k&d%TG0LPY=Fw)=gf(hy9QmY*D6jCAiq44 zo-k2C+?3*+Wu7xm1w*LEAl`Vsq(sYPUMw|MiXrW)92>rVOAse5Pmx^OSi{y%EwPAE zx|csvE{U3c{vA>@;>xcjdCW15pE31F3aoIBsz@OQRvi%_MMfgar2j3Ob`9e@gLQk# zlzznEHgr|Ols%f*a+B-0klD`czi@RWGPPpR1tE@GB|nwe`td1OwG#OjGlTH zfT#^r?%3Ocp^U0F8Kekck6-Vg2gWs|sD_DTJ%2TR<5H3a$}B4ZYpP=p)oAoHxr8I! z1SYJ~v-iP&mNm{ra7!KP^KVpkER>-HFvq*>eG4J#kz1|eu;=~u2|>}TE_5nv2=d!0 z3P~?@blSo^uumuEt{lBsGcx{_IXPO8s01+7DP^yt&>k;<5(NRrF|To2h7hTWBFQ_A z+;?Q$o5L|LlIB>PH(4j)j3`JIb1xA_C@HRFnPnlg{zGO|-RO7Xn}!*2U=Z2V?{5Al z9+iL+n^_T~6Uu{law`R&fFadSVi}da8G>|>D<{(#vi{OU;}1ZnfXy8=etC7)Ae<2S zAlI`&=HkNiHhT0|tQztSLNsRR6v8bmf&$6CI|7b8V4kyJ{=pG#h{1sVeC28&Ho%Fh zwo_FIS}ST-2OF6jNQ$(pjrq)P)@sie#tigN1zSclxJLb-O9V|trp^G8<1rpsj8@+$ z2y27iiM>H8kfd%AMlK|9C>Lkvfs9iSk>k2}tCFlqF~Z_>-uWVQDd$5{3sM%2$du9; z*ukNSo}~@w@DPF)_vS^VaZ)7Mk&8ijX2hNhKom$#PM%bzSA-s$ z0O!broj`!Nuk)Qcp3(>dL|5om#XMx2RUSDMDY9#1|+~fxwP}1I4iYy4j$CGx3jD&eKhf%z`Jn z7mD!y6`nVq%&Q#5yqG`|+e~1$Zkgu!O(~~pWSDTw2^va3u!DOMVRQ8ycq)sk&H%vb z;$a`3gp74~I@swI!ILOkzVK3G&SdTcVe~RzN<+z`u(BY=yuwez{#T3a_83)8>2!X?`^02zVjqx-fN+tW`zCqH^XG>#Ies$qxa!n4*FF0m zxgJlPPYl*q4ylX;DVu3G*I6T&JyWvs`A(*u0+62=+ylt2!u)6LJ=Qe1rA$OWcNCmH zLu7PwMDY#rYQA1!!ONNcz~I^uMvi6N&Lo4dD&HF?1Su5}COTZ-jwR)-zLq=6@bN}X zSP(-MY`TOJ@1O`bLPphMMSWm+YL{Ger>cA$KT~)DuTl+H)!2Lf`c+lZ0ipxd>KfKn zIv;;eEmz(_(nwW24a+>v{K}$)A?=tp+?>zAmfL{}@0r|1>iFQfJ5C*6dKdijK=j16 zQpl4gl93ttF5@d<9e2LoZ~cqkH)aFMgt(el_)#OG4R4Hnqm(@D*Uj>2ZuUCy)o-yy z_J|&S-@o5#2IMcL(}qWF3EL<4n(`cygenA)G%Ssi7k4w)LafelpV5FvS9uJES+(Ml z?rzZ={vYrB#mB-Hd#ID{KS5dKl-|Wh_~v+Lvq3|<@w^MD-RA{q!$gkUUNIvAaex5y z)jIGW{#U=#UWyku7FIAB=TES8>L%Y9*h2N`#Gghie+a?>$CRNth?ORq)!Tde24f5K zKh>cz5oLC;ry*tHIEQEL>8L=zsjG7+(~LUN5K1pT`_Z-4Z}k^m%&H%g3*^e(FDCC{ zBh~eqx%bY?qqu_2qa+9A+oS&yFw^3nLRsN#?FcZvt?*dZhRC_a%Jd{qou(p5AG_Q6 ziOJMu8D~kJ7xEkG(69$Dl3t1J592=Olom%;13uZvYDda08YwzqFlND-;YodmA!SL) z!AOSI=(uCnG#Yo&BgrH(muUemmhQW7?}IHfxI~T`44wuLGFOMdKreQO!a=Z-LkH{T z@h;`A_l2Pp>Xg#`Vo@-?WJn-0((RR4uKM6P2*^-qprHgQhMzSd32@ho>%fFMbp9Y$ zx-#!r8gEu;VZN(fDbP7he+Nu7^o3<+pT!<<>m;m z=FC$N)wx)asxb_KLs}Z^;x*hQM}wQGr((&=%+=#jW^j|Gjn$(qqXwt-o-|>kL!?=T zh0*?m<^>S*F}kPiq@)Cp+^fnKi2)%<-Tw4K3oHwmI-}h}Kc^+%1P!D8aWp!hB@-ZT zybHrRdeYlYulEj>Bk zEIi|PU0eGg&~kWQ{q)gw%~bFT0`Q%k5S|tt!JIZXVXX=>er!7R^w>zeQ%M-(C|eOQG>5i|}i3}X#?aqAg~b1t{-fqwKd(&CyA zmyy)et*E}+q_lEqgbClewiJ=u@bFX}LKe)5o26K9fS;R`!er~a?lUCKf60`4Zq7{2q$L?k?IrAdcDu+ z4A0QJBUiGx&$TBASI2ASM_Wj{?fjv=CORO3GZz;1X*AYY`anM zI`M6C%8OUFSc$tKjiFJ|V74Yj-lK&Epi7F^Gp*rLeDTokfW#o6sl33W^~4V|edbS1 zhx%1PTdnI!C96iYqSA=qu6;p&Dd%)Skjjw0fyl>3k@O?I@x5|>2_7G#_Yc2*1>=^# z|H43bJDx$SS2!vkaMG!;VRGMbY{eJhT%FR{(a+RXDbd4OT?DRoE(`NhiVI6MsUCsT z1gc^~Nv>i;cIm2~_SYOfFpkUvV)(iINXEep;i4>&8@N#|h+_;DgzLqh3I#lzhn>cN zjm;m6U{+JXR2Mi)=~WxM&t9~WShlyA$Pnu+VIW2#;0)4J*C!{1W|y1TP{Q;!tldR< zI7aoH&cMm*apW}~BabBT;`fQ1-9q|!?6nTzmhiIo6fGQlcP{pu)kJh- zUK&Ei9lArSO6ep_SN$Lt_01|Y#@Ksznl@f<+%ku1F|k#Gcwa`(^M<2%M3FAZVb99?Ez4d9O)rqM< zCbYsdZlSo{X#nKqiRA$}XG}1Tw@)D|jGKo1ITqmvE4;ovYH{NAk{h8*Ysh@=nZFiF zmDF`@4do#UDKKM*@wDbwoO@tPx4aExhPF_dvlR&dB5>)W=wG6Pil zq{eBzw%Ov!?D+%8&(uK`m7JV7pqNp-krMd>ECQypq&?p#_3wy){eW{(2q}ij{6bfmyE+-ZO z)G4OtI;ga9;EVyKF6v3kO1RdQV+!*>tV-ditH-=;`n|2T zu(vYR*BJSBsjzFl1Oy#DpL=|pfEY4NM;y5Yly__T*Eg^3Mb_()pHwn)mAsh!7Yz-Z zY`hBLDXS4F^{>x=oOphq|LMo;G!C(b2hS9A6lJqb+e$2af}7C>zW2p{m18@Bdd>iL zoEE$nFUnaz_6p${cMO|;(c1f9nm5G5R;p)m4dcC1?1YD=2Mi&20=4{nu>AV#R^d%A zsmm_RlT#`;g~an9mo#O1dYV)2{mgUWEqb*a@^Ok;ckj;uqy{%*YB^({d{^V)P9VvP zC^qbK&lq~}TWm^RF8d4zbo~bJuw zFV!!}b^4BlJ0>5S3Q>;u*BLC&G6Fa5V|~w&bRZ*-YU>df6%qAvK?%Qf+#=M-+JqLw&w*l4{v7XTstY4j z26z69U#SVzSbY9HBXyD;%P$#vVU7G*Yb-*fy)Qpx?;ed;-P24>-L6U+OAC9Jj63kg zlY`G2+5tg1szc#*9ga3%f9H9~!(^QjECetX-PlacTR+^g8L<#VRovPGvsT)ln3lr= zm5WO@!NDuw+d4MY;K4WJg3B|Sp|WdumpFJO>I2tz$72s4^uXljWseYSAd+vGfjutO z-x~Qlct+BnlI+Iun)fOklxPH?30i&j9R$6g5^f&(x7bIom|FLKq9CUE);w2G>}vye zxWvEaXhx8|~2j)({Rq>0J9}lzdE`yhQ(l$z! z;x%d%_u?^4vlES_>JaIjJBN|N8z5}@l1#PG_@{mh`oWXQOI41_kPG}R_pV+jd^PU) zEor^SHo`VMul*80-K$0mSk|FiI+tHdWt-hzt~S>6!2-!R&rdL_^gGGUzkPe zEZkUKU=EY(5Ex)zeTA4-{Bkbn!Gm?nuaI4jLE%X;zMZ7bwn4FXz(?az;9(Uv;38U6 zi)}rA3xAcD2&6BY<~Pj9Q1~4Dyjs&!$)hyHiiTI@%qXd~+>> zW}$_puSSJ^uWv$jtWakn}}@eX6_LGz|7M#$!3yjY ztS{>HmQ%-8u0@|ig{kzD&CNK~-dIK5e{;@uWOs8$r>J7^c2P~Pwx%QVX0e8~oXK0J zM4HCNK?%t6?v~#;eP#t@tM$@SXRt;(b&kU7uDzlzUuu;+LQ5g%=FqpJPGrX8HJ8CS zITK|(fjhs3@CR}H4@)EjL@J zV_HPexOQ!@k&kvsQG)n;7lZaUh>{87l4NS_=Y-O9Ul3CaKG8iy+xD=QXZSr57a-hb z7jz3Ts-NVsMI783OPEdlE|e&a2;l^h@e>oYMh5@=Lte-9A+20|?!9>Djl~{XkAo>0p9`n&nfWGdGAfT-mSYW z1cvG>GT9dRJdcm7M_AG9JX5AqTCdJ6MRqR3p?+FvMxp(oB-6MZ`lRzSAj%N(1#8@_ zDnIIo9Rtv12(Eo}k_#FILhaZQ`yRD^Vn5tm+IK@hZO>s=t5`@p1#k?Umz2y*R64CF zGM-v&*k}zZ%Xm<_?1=g~<*&3KAy;_^QfccIp~CS7NW24Tn|mSDxb%pvvi}S}(~`2# z3I|kD@||l@lAW06K2%*gHd4x9YKeXWpwU%!ozYcJ+KJeX!s6b94j!Qyy7>S!wb?{qaMa`rpbU1phn0EpF}L zsBdZc|Im#iRiQmJjZwb5#n;`_O{$Zu$I zMXqbfu0yVmt!!Y`Fzl}QV7HUSOPib#da4i@vM$0u2FEYytsvrbR#ui9lrMkZ(AVVJ zMVl^Wi_fSRsEXLA_#rdaG%r(@UCw#o7*yBN)%22b)VSNyng6Lxk|2;XK3Qb=C_<`F zN##8MLHz-s%&O6JE~@P1=iHpj8go@4sC7*AWe99tuf$f7?2~wC&RA^UjB*2`K!%$y zSDzMd7}!vvN|#wDuP%%nuGk8&>N)7eRxtqdMXHD1W%hP7tYW{W>^DJp`3WS>3}i+$ z_li?4AlEj`r=!SPiIc+NNUZ9NCrMv&G0BdQHBO&S7d48aB)LfGi@D%5CC1%)1hVcJ zB~=yNC}LBn(K?cHkPmAX$5^M7JSnNkcc!X!0kD&^F$cJmRP(SJ`9b7}b)o$rj=BZ- zC;BX3IG94%Qz&(V$)7O~v|!=jd-yU1(6wd1u;*$z4DDe6+BFLhz>+8?59?d2Ngxck zm92yR!jk@MP@>>9FtAY2L+Z|MaSp{MnL-;fm}W3~fg!9TRr3;S@ysLf@#<)keHDRO zsJI1tP`g3PNL`2(8hK3!4;r|E-ZQbU0e-9u{(@du`4wjGj|A!QB&9w~?OI1r}M? zw)6tvsknfPfmNijZ;3VZX&HM6=|&W zy6GIe3a?_(pRxdUc==do9?C&v7+6cgIoL4)Ka^bOG9`l;S|QmVzjv%)3^PDi@=-cp z=!R0bU<@_;#*D}e1m@0!%k=VPtyRAkWYW(VFl|eu0LteWH7eDB%P|uF7BQ-|D4`n; z)UpuY1)*s32UwW756>!OoAq#5GAtfrjo*^7YUv^(eiySE?!TQzKxzqXE@jM_bq3Zq zg#1orE*Zd5ZWEpDXW9$=NzuadNSO*NW)ZJ@IDuU`w}j_FRE4-QS*rD4mPVQPH(jGg z+-Ye?3%G%=DT5U1b+TnNHHv(nz-S?3!M4hXtEB@J4WK%%p zkv=Bb`1DHmgUdYo>3kwB(T>Ba#DKv%cLp2h4r8v}p=Np}wL!&PB5J-w4V4REM{kMD z${oSuAw9?*yo3?tNp~X5WF@B^P<6L0HtIW0H7^`R8~9zAXgREH`6H{ntGu$aQ;oNq zig;pB^@KMHNoJcEb0f1fz+!M6sy?hQjof-QoxJgBM`!k^T~cykcmi^s_@1B9 z)t1)Y-ZsV9iA&FDrVoF=L7U#4&inXk{3+Xm9A|R<=ErgxPW~Fq zqu-~x0dIBlR+5_}`IK^*5l3f5$&K@l?J{)_d_*459pvsF*e*#+2guls(cid4!N%DG zl3(2`az#5!^@HNRe3O4(_5nc+){q?ENQG2|uKW0U0$aJ5SQ6hg>G4OyN6os76y%u8qNNHi;}XnRNwpsfn^!6Qt(-4tE`uxaDZ`hQp#aFX373|F?vjEiSEkV>K)cTBG+UL#wDj0_ zM9$H&-86zP=9=5_Q7d3onkqKNr4PAlF<>U^^yYAAEso|Ak~p$3NNZ$~4&kE9Nj^As zQPoo!m*uZ;z1~;#g(?zFECJ$O2@EBy<;F)fnQxOKvH`MojG5T?7thbe%F@JyN^k1K zn3H*%Ymoim)ePf)xhl2%$T)vq3P=4ty%NK)@}po&7Q^~o3l))Zm4<75Y!fFihsXJc z9?vecovF^nYfJVg#W~R3T1*PK{+^YFgb*7}Up2U#)oNyzkfJ#$)PkFxrq_{Ai?0zk zWnjq_ixF~Hs7YS9Y6H&8&k0#2cAj~!Vv4{wCM zi2f1FjQf+F@=BOB)pD|T41a4AEz+8hnH<#_PT#H|Vwm7iQ0-Tw()WMN za0eI-{B2G{sZ7+L+^k@BA)G;mOFWE$O+2nS|DzPSGZ)ede(9%+8kqu4W^wTn!yZPN z7u!Qu0u}K5(0euRZ$7=kn9DZ+llruq5A_l) zOK~wof7_^8Yeh@Qd*=P!gM)lh`Z@7^M?k8Z?t$$vMAuBG>4p56Dt!R$p{)y>QG}it zGG;Ei```7ewXrbGo6Z=!AJNQ!GP8l13m7|FIQTFZTpIg#kpZkl1wj)s1eySXjAAWy zfl;;@{QQ;Qnb$@LY8_Z&7 z6+d98F?z2Zo)sS)z$YoL(zzF>Ey8u#S_%n7)XUX1Pu(>e8gEUU1S;J=EH(#`cWi1+ zoL$5TN+?#NM8=4E7HOk)bf5MXvEo%he5QcB%_5YQ$cu_j)Pd^@5hi}d%nG}x9xXtD-JMQxr;KkC=r_dS-t`lf zF&CS?Lk~>U^!)Y0LZqNVJq+*_#F7W~!UkvZfQhzvW`q;^X&iv~ zEDDGIQ&(S;#Hb(Ej4j+#D#sDS_uHehlY0kZsQpktc?;O z22W1b%wNcdfNza<1M2{*mAkM<{}@(w`VuQ<^lG|iYSuWBD#lYK9+jsdA+&#;Y@=zXLVr840Nq_t5))#7}2s9pK* zg42zd{EY|#sIVMDhg9>t6_Y#O>JoG<{GO&OzTa;iA9&&^6=5MT21f6$7o@nS=w;R) znkgu*7Y{UNPu7B9&B&~q+N@@+%&cO0N`TZ-qQ|@f@e0g2BI+9xO$}NzMOzEbSSJ@v z1uNp(S z-dioXc$5YyA6-My@gW~1GH($Q?;GCHfk{ej-{Q^{iTFs1^Sa67RNd5y{cjX1tG+$& zbGrUte{U1{^Z_qpzW$-V!pJz$dQZrL5i(1MKU`%^= z^)i;xua4w)evDBrFVm)Id5SbXMx2u7M5Df<2L4B`wy4-Y+Wec#b^QJO|J9xF{x#M8 zuLUer`%ZL^m3gy?U&dI+`kgNZ+?bl3H%8)&k84*-=aMfADh&@$xr&IS|4{3$v&K3q zZTn&f{N(#L6<-BZYNs4 zB*Kl*@_IhGXI^_8zfXT^XNmjJ@5E~H*wFf<&er?p7suz85)$-Hqz@C zGMFg1NKs;otNViu)r-u{SOLcqwqc7$poPvm(-^ag1m71}HL#cj5t4Hw(W?*fi4GSH z9962NZ>p^ECPqVc$N}phy>N8rQsWWm%%rc5B4XLATFEtffX&TM2%|8S2Lh_q; zCytXua84HBnSybW-}(j z3Zwv4CaK)jC!{oUvdsFRXK&Sx@t)yGm(h65$!WZ!-jL52no}NX6=E<=H!aZ74h_&> zZ+~c@k!@}Cs84l{u+)%kg4fq~pOeTK3S4)gX~FKJw4t9ba!Ai{_gkKQYQvafZIyKq zX|r4xgC(l%JgmW!tvR&yNt$6uME({M`uNIi7HFiPEQo_UMRkl~12&4c& z^se;dbZWKu7>dLMg`IZq%@b@ME?|@{&xEIZEU(omKNUY? z`JszxNghuO-VA;MrZKEC0|Gi0tz3c#M?aO?WGLy64LkG4T%|PBIt_?bl{C=L@9e;A zia!35TZI7<`R8hr06xF62*rNH5T3N0v^acg+;ENvrLYo|B4!c^eILcn#+lxDZR!%l zjL6!6h9zo)<5GrSPth7+R(rLAW?HF4uu$glo?w1U-y}CR@%v+wSAlsgIXn>e%bc{FE;j@R0AoNIWf#*@BSngZ)HmNqkB z)cs3yN%_PT4f*K+Y1wFl)be=1iq+bb1G-}b|72|gJ|lMt`tf~0Jk}zMbS0+M-Mq}R z>Bv}-W6J%}j#dIz`Z0}zD(DGKn`R;E8A`)$a6qDfr(c@iHKZcCVY_nJEDpcUddGH* z*ct2$&)RelhmV}@jGXY>3Y~vp;b*l9M+hO}&x`e~q*heO8GVkvvJTwyxFetJC8VnhjR`5*+qHEDUNp16g`~$TbdliLLd}AFf}U+Oda1JXwwseRFbj?DN96;VSX~z?JxJSuA^BF}262%Z0)nv<6teKK`F zfm9^HsblS~?Xrb1_~^=5=PD!QH$Y1hD_&qe1HTQnese8N#&C(|Q)CvtAu6{{0Q%ut8ESVdn&& z4y%nsCs!$(#9d{iVjXDR##3UyoMNeY@_W^%qyuZ^K3Oa4(^!tDXOUS?b2P)yRtJ8j zSX}@qGBj+gKf;|6Kb&rq`!}S*cSu-3&S>=pM$eEB{K>PP~I}N|uGE|`3U#{Q6v^kO4nIsaq zfPld}c|4tVPI4!=!ETCNW+LjcbmEoxm0RZ%ieV0`(nVlWKClZW5^>f&h79-~CF(%+ zv|KL(^xQ7$#a}&BSGr9zf{xJ(cCfq>UR*>^-Ou_pmknCt6Y--~!duL{k2D{yLMl__ z!KeMRRg&EsD2s|cmy?xgK&XcGIKeos`&UEVhBTw;mqy|8DlP1M7PYS2z{YmTJ;n!h znPe(Qu?c7+xZz!Tm1AnE8|;&tf7fW$2dArX7ck1Jd(S1+91YB8bjISRZ`UL*?vb{b zMp*!Xq7VaLc0Ogqj5qmop8NREQ{9_iC$;tviZlubGLy1jLlIFBxAymMr@SDLAcx+) z5YRkl$bW**X)W0JzWNcLx9>fTqJj00ipY6Ua?mUlsgQrVVgpmaheE;RgA5U_+WsPh z9+X|PU4zFyNxZ2?Q+V`Mo{xH~(m}OMRZa<&$nCl7o4x`^^|V4?aPz8#KwFm=8T6_} z8=P_4$_rD2a%7}}HT6VQ>ZGKW=QF7zI-2=6oBNZR$HVn|gq`>l$HZ`48lkM7%R$>MS& zghR`WZ9Xrd_6FaDedH6_aKVJhYev*2)UQ>!CRH3PQ_d9nXlO;c z9PeqiKD@aGz^|mvD-tV<{BjfA;)B+76!*+`$CZOJ=#)}>{?!9fAg(Xngbh||n=q*C zU0mGP`NxHn$uY#@)gN<0xr)%Ue80U{-`^FX1~Q@^>WbLraiB|c#4v$5HX)0z!oA#jOXPyWg! z8EC}SBmG7j3T&zCenPLYA{kN(3l62pu}91KOWZl? zg~>T4gQ%1y3AYa^J|>ba$7F5KlVx}_&*~me*q-SYLBCXZFU=U8mHQD4K!?;B61NoX z?VS41SS&jHyhmB~+bC=w0a06V``ZXCkC~}oM9pM{$hU~-s_elYPmT1L!%B`?*<+?( zFQ@TP%y+QL`_&Y0A3679pe5~iL=z)$b)k!oSbJRyw+K};SGAvvE=|<~*aiwJc?uE@2?7a1i9|3=^N%*9smt3ZIhjY>gIsr{Q2rX(NovZ7I1n^V{ z#~(1ze-%`C>fM`^hCV**9BA-04lNuu&3=reevNOMwmX(A{yh`^c8%0mjAKMj{Th05 zXrM(zILwyL-Pcdw^(=gj(ZLVMA95zlzmLa^skb8tQq%8SV&4vp?S>L3+P4^tp`$xA zr38jBw0ItR`VbO5vB1`<3d})}aorkIU1z3*ifYN&Lpp)}|}QJS60th_v-EEkAM zyOREuj!Ou|pVeZEWg;$Hf!x;xAmFu7gB^UR$=L0BuZ~thLC@#moJ(@@wejR|`t_K@ zuQ{XmpAWz%o&~2dk!SIGR$EmpZY)@+r^gvX26%)y>1u2bt~JUPTQzQu&_tB)|{19)&n$m5Fhw0A-8S1^%XpAD%`#a z_ModVxsM|x!m3N1vRt_XEL`O-+J3cMsM1l*dbjT&S0c@}Xxl3I&AeMNT97G3c6%3C zbrZS?2EAKcEq@@Pw?r%eh0YM6z0>&Qe#n+e9hEHK?fzig3v5S#O2IxVLu;a>~c~ZfHVbgLox%_tg)bsC8Rl35P=Jhl+Y=w6zb$ z;*uO%i^U z^mp_QggBILLF$AyjPD41Z0SFdbDj&z&xjq~X|OoM7bCuBfma1CEd!4RKGqPR)K)e}+7^JfFUI_fy63cMyq#&)Z*#w18{S zhC@f9U5k#2S2`d$-)cEoH-eAz{2Qh>YF1Xa)E$rWd52N-@{#lrw3lRqr)z?BGThgO z-Mn>X=RPHQ)#9h{3ciF)<>s{uf_&XdKb&kC!a373l2OCu&y8&n#P%$7YwAVJ_lD-G zX7tgMEV8}dY^mz`R6_0tQ5Eu@CdSOyaI63Vb*mR+rCzxgsjCXLSHOmzt0tA zGoA0Cp&l>rtO@^uQayrkoe#d2@}|?SlQl9W{fmcxY(0*y zHTZ6>FL;$8FEzbb;M(o%mBe-X?o<0+1dH?ZVjcf8)Kyqb07*a zLfP1blbt)=W)TN}4M#dUnt8Gdr4p$QRA<0W)JhWLK3-g82Q~2Drmx4J z;6m4re%igus136VL}MDI-V;WmSfs4guF_(7ifNl#M~Yx5HB!UF)>*-KDQl0U?u4UXV2I*qMhEfsxb%87fi+W;mW5{h?o8!52}VUs*Fpo#aSuXk(Ug z>r>xC#&2<9Uwmao@iJQ|{Vr__?eRT2NB$OcoXQ-jZ{t|?Uy{7q$nU-i|&-R6fHPWJDgHZ69iVbK#Ab@2@y zPD*Gj=hib?PWr8NGf;g$o5I!*n>94Z!IfqRm zLvM>Gx$Y*rEL3Z-+lS42=cnEfXR)h1z`h8a+I%E_ss%qXsrgIV%qv9d|KT>fV5=3e zw>P#ju>2naGc{=6!)9TeHq$S9Pk|>$UCEl}H}lE@;0(jbNT9TXUXyss>al>S4DuGi zVCy;Qt=a2`iu2;TvrIkh2NTvNV}0)qun~9y1yEQMdOf#V#3(e(C?+--8bCsJu={Q1z5qNJIk&yW>ZnVm;A=fL~29lvXQ*4j(SLau?P zi8LC7&**O!6B6=vfY%M;!p2L2tQ+w3Y!am{b?14E`h4kN$1L0XqT5=y=DW8GI_yi% zlIWsjmf0{l#|ei>)>&IM4>jXH)?>!fK?pfWIQn9gT9N(z&w3SvjlD|u*6T@oNQRF6 zU5Uo~SA}ml5f8mvxzX>BGL}c2#AT^6Lo-TM5XluWoqBRin$tiyRQK0wJ!Ro+7S!-K z=S95p-(#IDKOZsRd{l65N(Xae`wOa4Dg9?g|Jx97N-7OfHG(rN#k=yNGW0K$Tia5J zMMX1+!ulc1%8e*FNRV8jL|OSL-_9Nv6O=CH>Ty(W@sm`j=NFa1F3tT$?wM1}GZekB z6F_VLMCSd7(b9T%IqUMo$w9sM5wOA7l8xW<(1w0T=S}MB+9X5UT|+nemtm_;!|bxX z_bnOKN+F30ehJ$459k@=69yTz^_)-hNE4XMv$~_%vlH_y^`P1pLxYF6#_IZyteO`9wpuS> z#%Vyg5mMDt?}j!0}MoBX|9PS0#B zSVo6xLVjujMN57}IVc#A{VB*_yx;#mgM4~yT6wO;Qtm8MV6DX?u(JS~JFA~PvEl%9 z2XI}c>OzPoPn_IoyXa2v}BA(M+sWq=_~L0rZ_yR17I5c^m4;?2&KdCc)3lCs!M|0OzH@(PbG8T6w%N zKzR>%SLxL_C6~r3=xm9VG8<9yLHV6rJOjFHPaNdQHHflp><44l>&;)&7s)4lX%-er znWCv8eJJe1KAi_t1p%c4`bgxD2(1v)jm(gvQLp2K-=04oaIJu{F7SIu8&)gyw7x>+ zbzYF7KXg;T71w!-=C0DjcnF^JP$^o_N>*BAjtH!^HD6t1o?(O7IrmcodeQVDD<*+j zN)JdgB6v^iiJ1q`bZ(^WvN{v@sDqG$M9L`-UV!3q&sWZUnQ{&tAkpX(nZ_L#rMs}>p7l0fU5I5IzArncQi6TWjP#1B=QZ|Uqm-3{)YPn=XFqHW-~Fb z^!0CvIdelQbgcac9;By79%T`uvNhg9tS><pLzXePP=JZzcO@?5GRAdF4)sY*)YGP* zyioMa3=HRQz(v}+cqXc0%2*Q%CQi%e2~$a9r+X*u3J8w^Shg#%4I&?!$})y@ zzg8tQ6_-`|TBa_2v$D;Q(pFutj7@yos0W$&__9$|Yn3DFe*)k{g^|JIV4bqI@2%-4kpb_p? zQ4}qQcA>R6ihbxnVa{c;f7Y)VPV&mRY-*^qm~u3HB>8lf3P&&#GhQk8uIYYgwrugY zei>mp`YdC*R^Cxuv@d0V?$~d*=m-X?1Fqd9@*IM^wQ_^-nQEuc0!OqMr#TeT=8W`JbjjXc-Dh3NhnTj8e82yP;V_B<7LIejij+B{W1ViaJ_)+q?$BaLJpxt_4@&(?rWC3NC-_Z9Sg4JJWc( zX!Y34j67vCMHKB=JcJ1|#UI^D^mn(i=A5rf-iV7y4bR5HhC=I`rFPZv4F>q+h?l34 z4(?KYwZYHwkPG%kK7$A&M#=lpIn3Qo<>s6UFy|J$Zca-s(oM7??dkuKh?f5b2`m57 zJhs4BTcVVmwsswlX?#70uQb*k1Fi3q4+9`V+ikSk{L3K=-5HgN0JekQ=J~549Nd*+H%5+fi6aJuR=K zyD3xW{X$PL7&iR)=wumlTq2gY{LdrngAaPC;Qw_xLfVE0c0Z>y918TQpL!q@?`8{L!el18Qxiki3WZONF=eK$N3)p>36EW)I@Y z7QxbWW_9_7a*`VS&5~4-9!~&g8M+*U9{I2Bz`@TJ@E(YL$l+%<=?FyR#&e&v?Y@@G zqFF`J*v;l$&(A=s`na2>4ExKnxr`|OD+Xd-b4?6xl4mQ94xuk!-$l8*%+1zQU{)!= zTooUhjC0SNBh!&Ne}Q=1%`_r=Vu1c8RuE!|(g4BQGcd5AbpLbvKv_Z~Y`l!mr!sCc zDBupoc{W@U(6KWqW@xV_`;J0~+WDx|t^WeMri#=q0U5ZN7@@FAv<1!hP6!IYX z>UjbhaEv2Fk<6C0M^@J`lH#LgKJ(`?6z5=uH+ImggSQaZtvh52WTK+EBN~-op#EQKYW`$yBmq z4wgLTJPn3;mtbs0m0RO&+EG>?rb*ZECE0#eeSOFL!2YQ$w}cae>sun`<=}m!=go!v zO2jn<0tNh4E-4)ZA(ixh5nIUuXF-qYl>0I_1)K%EAw`D7~la$=gc@6g{iWF=>i_76?Mc zh#l9h7))<|EY=sK!E|54;c!b;Zp}HLd5*-w^6^whxB98v`*P>cj!Nfu1R%@bcp{cb zUZ24(fUXn3d&oc{6H%u(@4&_O?#HO(qd^YH=V`WJ=u*u6Zie8mE^r_Oz zDw`DaXeq4G#m@EK5+p40Xe!Lr!-jTQLCV3?R1|3#`%45h8#WSA!XoLDMS7=t!SluZ4H56;G z6C9D(B6>k^ur_DGfJ@Y-=3$5HkrI zO+3P>R@$6QZ#ATUI3$)xRBEL#5IKs}yhf&fK;ANA#Qj~G zdE|k|`puh$%dyE4R0$7dZd)M*#e7s%*PKPyrS;d%&S(d{_Ktq^!Hpi&bxZx`?9pEw z%sPjo&adHm95F7Z1{RdY#*a!&LcBZVRe{qhn8d{pOUJ{fOu`_kFg7ZVeRYZ(!ezNktT5{Ab z4BZI$vS0$vm3t9q`ECjDK;pmS{8ZTKs`Js~PYv2|=VkDv{Dtt)cLU@9%K6_KqtqfM zaE*e$f$Xm=;IAURNUXw8g%=?jzG2}10ZA5qXzAaJ@eh)yv5B=ETyVwC-a*CD;GgRJ z4J1~zMUey?4iVlS0zW|F-~0nenLiN3S0)l!T2}D%;<}Z9DzeVgcB+MSj;f$KY;uP%UR#f`0u*@6U@tk@jO3N?Fjq< z{cUUhjrr$rmo>qE?52zKe+>6iP5P_tcUfxsLSy{9*)shB(w`UUveNH`a`kr$VEF@} zKh&|lTD;4;m_H6C&)9#D`kRh;S(NTa=Ve^~xe_0~x$6h8Q@B_qu#ee=(lkI9@F6$0m=z@H=4&h%Q{htM>uHs(Sr@2ry`fgLA zKj8lVXdGPyy)2J%A${}Rm_a{){wHnlM?yGPQ7#KO{8*(_l0QZHuV};nO?c%h?qwSL z3wem|w*2tdxW5&PxC(Wd0QG_w|GPbw|0UFK`u$~U%!`QKcME;=Q@?*erh4_>FP~1n zAldwG9h$$u_$RFK6Uxo20GHqJzc}Rl-EwVz3h4n z;3~%DwD84i>)-8#&#y3k)3BG5cNaP3?t4q}F%yfv?*yEiC>sSo}$f>nh0QNZXH1N)-Q7kbk=2uL9OrF)nXrE@F1y%_8Yn c82=K%QXLKFx%@O{wJjEi6Y56o#$)Bpeg literal 0 HcmV?d00001 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..2a84e188 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 00000000..ef07e016 --- /dev/null +++ b/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..db3a6ac2 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/pom.xml b/pom.xml index 7314100c..8a314d06 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.buildtheearth BuildTeamTools - 0.1.3-alpha + 0.2.0-alpha jar BuildTeamTools @@ -206,7 +206,7 @@ io.papermc.paper paper-api - 1.21.4-R0.1-SNAPSHOT + 1.21.10-R0.1-SNAPSHOT provided @@ -214,7 +214,7 @@ com.mojang authlib - 3.13.56 + 7.0.61 provided diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..5a289eac --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,5 @@ +/* + * This file was generated by the Gradle 'init' task. + */ + +rootProject.name = "BuildTeamTools" diff --git a/src/main/java/net/buildtheearth/BuildTeamTools.java b/src/main/java/net/buildtheearth/BuildTeamTools.java index 9f985e2a..accc350b 100644 --- a/src/main/java/net/buildtheearth/BuildTeamTools.java +++ b/src/main/java/net/buildtheearth/BuildTeamTools.java @@ -8,7 +8,6 @@ import net.buildtheearth.modules.miscellaneous.MiscModule; import net.buildtheearth.modules.navigation.NavigationModule; import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.plotsystem.PlotSystemModule; import net.buildtheearth.modules.stats.StatsModule; import net.buildtheearth.utils.io.ConfigUtil; import org.bukkit.configuration.file.FileConfiguration; @@ -47,8 +46,6 @@ public void onEnable() { NetworkModule.getInstance(), GeneratorModule.getInstance(), NavigationModule.getInstance(), - PlotSystemModule.getInstance(), - StatsModule.getInstance(), MiscModule.getInstance() ); ModuleHandler.getInstance().enableAll(null); diff --git a/src/main/java/net/buildtheearth/modules/Module.java b/src/main/java/net/buildtheearth/modules/Module.java index 540ba76e..9bd01439 100644 --- a/src/main/java/net/buildtheearth/modules/Module.java +++ b/src/main/java/net/buildtheearth/modules/Module.java @@ -8,7 +8,6 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.PluginCommand; import org.bukkit.command.TabCompleter; -import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; @@ -182,17 +181,4 @@ protected void checkForModuleDependencies(){ return; } } - - - /** - * Sends more information about the generator to a player. - * The WIKI_PAGE varies depending on the generator. - * - * @param p The player who should receive the information. - */ - public void sendWikiLink(Player p) { - p.sendMessage(" "); - p.sendMessage("§cFor more information take a look here:"); - p.sendMessage("§c" + wikiPage); - } } diff --git a/src/main/java/net/buildtheearth/modules/ModuleHandler.java b/src/main/java/net/buildtheearth/modules/ModuleHandler.java index d2ad004f..fcaf3e4d 100644 --- a/src/main/java/net/buildtheearth/modules/ModuleHandler.java +++ b/src/main/java/net/buildtheearth/modules/ModuleHandler.java @@ -8,8 +8,8 @@ import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Objects; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java b/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java index 2ef99d6a..49a20638 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java @@ -1,6 +1,5 @@ package net.buildtheearth.modules.generator.components.field; -import com.sk89q.worldedit.regions.Region; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; import net.buildtheearth.modules.generator.utils.GeneratorUtils; @@ -15,7 +14,7 @@ public Field() { @Override public boolean checkForPlayer(Player p) { - return GeneratorUtils.checkForNoWorldEditSelection(p); + return !GeneratorUtils.checkForNoWorldEditSelection(p); /* Only needed if block checks are made afterwards like in House Generator if (getPlayerSettings().get(p.getUniqueId()).getBlocks() == null) diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java index 00ed550c..74385d89 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java @@ -42,8 +42,8 @@ public void fieldScript_v_1_0() { // Create a cuboid selection of the field area to scan enough blocks GeneratorUtils.createCuboidSelection(getPlayer(), - new Vector(getRegion().getMinimumPoint().getX(), getRegion().getMinimumPoint().getY(), getRegion().getMinimumPoint().getZ()), - new Vector(getRegion().getMaximumPoint().getX(), getRegion().getMaximumPoint().getY(), getRegion().getMaximumPoint().getZ()) + new Vector(getRegion().getMinimumPoint().x(), getRegion().getMinimumPoint().y(), getRegion().getMinimumPoint().z()), + new Vector(getRegion().getMaximumPoint().x(), getRegion().getMaximumPoint().y(), getRegion().getMaximumPoint().z()) ); // Expand the selection to make sure the field is big enough diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java index 8628c8d2..84b11efa 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java @@ -14,10 +14,10 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; +import org.jetbrains.annotations.Nullable; import org.json.JSONArray; import org.json.JSONObject; -import javax.annotation.Nullable; import java.io.*; import java.lang.reflect.Method; import java.net.HttpURLConnection; diff --git a/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java b/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java index 69a8346b..f63fcfa4 100644 --- a/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java +++ b/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java @@ -48,7 +48,7 @@ public void onResponse(String response) { @Override public void onFailure(IOException e) { - ChatHelper.logError("Something went wrong while notifying the network API of the plugins presence: %s", e.getMessage()); + ChatHelper.logError("Something went wrong while notifying the network API of the plugins presence: " + e.getMessage()); } }); } @@ -242,7 +242,7 @@ private int getArea(JSONObject regionObject) { @Override public void onFailure(IOException e) { - ChatHelper.logError("Failed to get teams information from the network API: %s", e); + ChatHelper.logError("Failed to get teams information from the network API: " + e.getMessage()); // Handle failure scenario future.completeExceptionally(e); diff --git a/src/main/java/net/buildtheearth/utils/ChatHelper.java b/src/main/java/net/buildtheearth/utils/ChatHelper.java index db250e57..43020a0b 100644 --- a/src/main/java/net/buildtheearth/utils/ChatHelper.java +++ b/src/main/java/net/buildtheearth/utils/ChatHelper.java @@ -11,8 +11,8 @@ import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import org.jetbrains.annotations.Nullable; -import javax.annotation.Nullable; import java.util.Arrays; import java.util.logging.Level; diff --git a/src/main/java/net/buildtheearth/utils/Item.java b/src/main/java/net/buildtheearth/utils/Item.java index 69401a13..71ab40d4 100644 --- a/src/main/java/net/buildtheearth/utils/Item.java +++ b/src/main/java/net/buildtheearth/utils/Item.java @@ -1,6 +1,8 @@ package net.buildtheearth.utils; import com.cryptomorin.xseries.XMaterial; +import com.cryptomorin.xseries.profiles.builder.XSkull; +import com.cryptomorin.xseries.profiles.objects.Profileable; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import com.sk89q.worldedit.world.block.BlockType; @@ -473,8 +475,7 @@ public static ItemStack createCustomHeadTextureURL(String url, String name, List if(head == null) return null; - SkullMeta meta = (SkullMeta) head.getItemMeta(); - mutateItemMeta(meta, base64); + ItemMeta meta = XSkull.of(head).profile(Profileable.detect(base64)).apply().getItemMeta(); meta.setDisplayName(name); meta.setLore(lore); head.setItemMeta(meta); @@ -487,15 +488,43 @@ public static ItemStack createCustomHeadTextureURL(String url, String name, List private static void mutateItemMeta(SkullMeta meta, String b64) { GameProfile profile = makeProfile(b64); - // Try Paper API (Minecraft Version 1.20+) + // Try Paper API (Minecraft Version 1.21+) try { Method setPlayerProfile = SkullMeta.class.getMethod("setPlayerProfile", com.destroystokyo.paper.profile.PlayerProfile.class); - com.destroystokyo.paper.profile.PlayerProfile paperProfile = Bukkit.createProfile(profile.getId(), profile.getName()); - paperProfile.getProperties().add(new com.destroystokyo.paper.profile.ProfileProperty("textures", b64)); + com.destroystokyo.paper.profile.PlayerProfile paperProfile = Bukkit.createProfile(profile.id(), profile.name()); + paperProfile.setProperty(new com.destroystokyo.paper.profile.ProfileProperty("textures", b64)); setPlayerProfile.invoke(meta, paperProfile); return; } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {} + // Try Paper API (Minecraft Version 1.20+) + try { + Method setPlayerProfile = SkullMeta.class.getMethod( + "setPlayerProfile", + com.destroystokyo.paper.profile.PlayerProfile.class + ); + + // Reflective access to profile.getId() and profile.getName() + Method getIdMethod = profile.getClass().getMethod("getId"); + Method getNameMethod = profile.getClass().getMethod("getName"); + + UUID id = (UUID) getIdMethod.invoke(profile); + String name = (String) getNameMethod.invoke(profile); + + com.destroystokyo.paper.profile.PlayerProfile paperProfile = + Bukkit.createProfile(id, name); + + paperProfile.getProperties().add( + new com.destroystokyo.paper.profile.ProfileProperty("textures", b64) + ); + + setPlayerProfile.invoke(meta, paperProfile); + return; + + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) { + } + + // Try setProfile(GameProfile) (Minecraft Version 1.15 – 1.19.4) try { Method metaSetProfileMethod = meta.getClass().getDeclaredMethod("setProfile", GameProfile.class); @@ -521,7 +550,28 @@ private static void mutateItemMeta(SkullMeta meta, String b64) { b64.substring(b64.length() - 10).hashCode() ); GameProfile profile = new GameProfile(id, "bte"); - profile.getProperties().put("textures", new Property("textures", b64)); + + // Try Paper API (Minecraft Version 1.21+) + boolean firstVersionWorked = false; + try { + profile.properties().put("textures", new Property("textures", b64)); + firstVersionWorked = true; + } catch (Exception ignored) { + } + + // Try api for older versions + if (!firstVersionWorked) { + try { + Method getPropertiesMethod = profile.getClass().getMethod("getProperties"); + Object properties = getPropertiesMethod.invoke(profile); + + ((com.mojang.authlib.properties.PropertyMap) properties) + .put("textures", new Property("textures", b64)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException(e); + } + } + return profile; } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index c813b428..c56d1836 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -6,11 +6,9 @@ # | [Contacts - Discord] BuildTheEarth Staff Discord, @minefact # ---------------------------------------------------------------------------------------------- -language: "EN" - # The Build Team API Key used to fetch build team info for display. # Find the key on the Minecraft Network at "buildtheearth.net". Navigate: Compass > Build Teams > My Teams > Your Team > API-Key. -# Without this key, some plugin components won`t function. For assistance, see #server-support on the staff discord. +# Without this key, some plugin components won't function. For assistance, see #server-support on the staff discord. api-key: 00000000-0000-0000-0000-000000000000 # The main world using the custom BTE Dynmaxion projection @@ -23,6 +21,5 @@ disabled-modules: # Enable or disable the debug mode debug: false - # NOTE: Do not change config-version: 1.4 \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index dece42e8..ecf6ef75 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,8 @@ name: BuildTeamTools main: net.buildtheearth.BuildTeamTools api-version: 1.13 -version: 0.1.3-alpha +version: ${version} +description: ${description} author: MineFact, frikandelworst, George112n, ELgamer, SirJodelstein, Zoriot softdepend: [WorldEdit, HeadDatabase, PlotSystem-Terra] @@ -21,26 +22,15 @@ commands: warp: description: Command for managing warps. usage: /warp - aliases: [warps] - warpsbt: + aliases: [ warps, wp ] + warpbt: description: Opens the warp menu for the specified BuildTeam usage: /warpsbt - aliases: [ wbt ] + aliases: [ wbt, wpt, warpsbuildteam, warpsbt ] kml: description: kml pasting and parsing usage: /kml aliases: [geopoints, geopath, georing, geosurface] - createplot: - description: Creates a new plot for the PlotSystem. - usage: /createplot - permission: plotsystem.createplot - pasteplot: - description: Pastes a plot manually with specific ID - usage: /pasteplot - permission: plotsystem.pasteplot - plotsystemterra: - description: Sends info about the plugin - usage: /plotsystemterra blockpalette: description: Opens the block palette menu. usage: /blockpalette [filter|menu|filter ...] From f93ebc39aebd28271a6350c47abc70e13fda428d Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 5 Jan 2026 22:21:16 +0100 Subject: [PATCH 02/37] =?UTF-8?q?feat(build):=20=E2=9C=A8=20update=20depen?= =?UTF-8?q?dencies=20and=20improve=20async=20task=20handling=20in=20script?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 6 +- gradle/libs.versions.toml | 6 +- gradlew | 0 pom.xml | 360 ------------------ .../net/buildtheearth/modules/Module.java | 4 +- .../modules/ModuleComponent.java | 1 + .../buildtheearth/modules/WikiDocumented.java | 22 ++ .../components/field/FieldScripts.java | 4 +- .../generator/components/house/House.java | 5 +- .../components/house/HouseScripts.java | 5 +- .../components/rail/RailScripts.java | 4 +- .../generator/model/GeneratorComponent.java | 5 +- .../modules/generator/model/Script.java | 1 - .../generator/utils/GeneratorUtils.java | 24 +- .../modules/plotsystem/PlotSystemModule.java | 16 +- .../resources/modules/navigation/config.yml | 2 +- 16 files changed, 68 insertions(+), 397 deletions(-) mode change 100644 => 100755 gradlew delete mode 100644 pom.xml create mode 100644 src/main/java/net/buildtheearth/modules/WikiDocumented.java diff --git a/build.gradle.kts b/build.gradle.kts index 8fe34276..12ea19cd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -62,7 +62,11 @@ repositories { } dependencies { - implementation(libs.com.alpsbte.alpslib.alpslib.libpsterra) + //implementation(libs.com.alpsbte.alpslib.alpslib.libpsterra) CURRENTLY BROKEN + implementation(libs.alpslib.io) + implementation(libs.alpslib.utils) { + exclude(group = "com.github.cryptomorin", module = "XSeries") + } implementation(libs.com.alpsbte.canvas) implementation(libs.net.daporkchop.lib.binary) implementation(libs.com.github.cryptomorin.xseries) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 419eb437..37fa9611 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ com-alpsbte-alpslib-alpslib-libpsterra = "1.1.3" com-alpsbte-canvas = "1.3" com-fastasyncworldedit-fastasyncworldedit-bukkit = "2.12.3" com-fastasyncworldedit-fastasyncworldedit-core = "2.12.3" -com-github-cryptomorin-xseries = "13.4.0" +com-github-cryptomorin-xseries = "13.6.0" com-google-code-gson-gson = "2.13.1" com-google-guava-guava = "33.4.8-jre" com-mojang-authlib = "7.0.61" @@ -21,6 +21,8 @@ io-freefair-lombok = "9.1.0" com-googlecode-json-simple = "1.1.1" # https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple com-palantir-git-version = "4.0.0" com-gradleup-shadow = "9.3.0" +alpslib-io = "1.2.0" +alpslib-utils = "1.3.8" [libraries] com-alpsbte-alpslib-alpslib-libpsterra = { module = "com.alpsbte.alpslib:alpslib-libpsterra", version.ref = "com-alpsbte-alpslib-alpslib-libpsterra" } @@ -39,6 +41,8 @@ net-daporkchop-lib-binary = { module = "net.daporkchop.lib:binary", version.ref net-wesjd-anvilgui = { module = "net.wesjd:anvilgui", version.ref = "net-wesjd-anvilgui" } org-json-json = { module = "org.json:json", version.ref = "org-json-json" } com-googlecode-json-simple = { module = "com.googlecode.json-simple:json-simple", version.ref = "com-googlecode-json-simple" } +alpslib-io = { module = "com.alpsbte.alpslib:alpslib-io", version.ref = "alpslib-io" } +alpslib-utils = { module = "com.alpsbte.alpslib:alpslib-utils", version.ref = "alpslib-utils" } [plugins] lombok = { id = "io.freefair.lombok", version.ref = "io-freefair-lombok" } diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 8a314d06..00000000 --- a/pom.xml +++ /dev/null @@ -1,360 +0,0 @@ - - - 4.0.0 - - net.buildtheearth - BuildTeamTools - 0.2.0-alpha - jar - - BuildTeamTools - - BuildTeamTools Plugin - - 21 - UTF-8 - - buildtheearth.net - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.14.0 - - ${java.version} - ${java.version} - ${java.version} - - - - org.apache.maven.plugins - maven-shade-plugin - 3.6.0 - - - package - - shade - - - false - - - - - net.wesjd.anvilgui - net.buildtheearth.buildteamtools.shaded.anvilgui - - - com.cryptomorin.xseries - net.buildtheearth.buildteamtools.shaded.xseries - - - org.ipvp.canvas - net.buildtheearth.buildteamtools.shaded.canvas - - - - - - com.alpsbte.alpslib:alpslib-libpsterra - - org/ipvp/canvas/** - com/cryptomorin/xseries/** - net/wesjd/anvilgui/** - - - - *:* - false - - net/wesjd/anvilgui/** - - - - *:* - false - - com/cryptomorin/xseries/** - - - - - *:* - - com/sun/codemodel/** - - - - - - - - - - - src/main/resources - true - - - - - - - - papermc - https://repo.papermc.io/repository/maven-public/ - - - - - reposilite-repository-releases - BuildTheEarth - https://maven.buildtheearth.net/releases - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - - - alpsbte-repo - https://mvn.alps-bte.com/repository/alps-bte/ - - - - - OnARandomBox - https://repo.onarandombox.com/content/groups/public/ - - - - - codemc-snapshots - https://repo.codemc.io/repository/maven-snapshots/ - - - - - codemc-repo - https://repo.codemc.io/repository/maven-public/ - - - - - jitpack.io - https://jitpack.io - - - - - dmulloy2-repo - https://repo.dmulloy2.net/repository/public/ - - - - - DaPorkchop_ - https://maven.daporkchop.net/ - - - - - maven2-repository.dev.java.net - Java.net Maven 2 Repository - https://download.java.net/maven/2 - default - - true - - - - - maven-enginehub - https://maven.enginehub.org/repo/ - - - - - - - - - com.intellectualsites.bom - bom-newest - 1.52 - import - pom - - - - - - - - - - - - - io.papermc.paper - paper-api - 1.21.10-R0.1-SNAPSHOT - provided - - - - - com.mojang - authlib - 7.0.61 - provided - - - - - - - - - - com.alpsbte.alpslib - alpslib-libpsterra - 1.1.3 - compile - - - - - - com.alpsbte - canvas - 1.3 - compile - - - - - net.daporkchop.lib - binary - 0.5.7-SNAPSHOT - compile - - - - - - - - - com.fastasyncworldedit - FastAsyncWorldEdit-Core - provided - - - - com.fastasyncworldedit - FastAsyncWorldEdit-Bukkit - provided - - - FastAsyncWorldEdit-Core - * - - - - - - - - - - - - com.github.cryptomorin - XSeries - 13.4.0 - compile - - - - - - net.wesjd - anvilgui - 1.10.8-SNAPSHOT - compile - - - - - - - - - micycle - clipper2 - 1.2.2 - compile - - - - - org.json - json - 20250517 - compile - - - - - com.google.code.gson - gson - 2.13.1 - compile - - - - - com.google.guava - guava - 33.4.8-jre - compile - - - - - com.squareup.okhttp3 - okhttp-jvm - 5.1.0 - compile - - - - - de.micromata.jak - JavaAPIforKml - 2.2.1 - compile - - - - - - - - - org.projectlombok - lombok - 1.18.38 - compile - - - diff --git a/src/main/java/net/buildtheearth/modules/Module.java b/src/main/java/net/buildtheearth/modules/Module.java index 9bd01439..c3b2f9c7 100644 --- a/src/main/java/net/buildtheearth/modules/Module.java +++ b/src/main/java/net/buildtheearth/modules/Module.java @@ -8,6 +8,7 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.PluginCommand; import org.bukkit.command.TabCompleter; +import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; @@ -21,7 +22,7 @@ * * @authors MineFact, Noah Husby */ -public abstract class Module { +public abstract class Module implements WikiDocumented { @Getter private boolean enabled = false; @@ -45,6 +46,7 @@ public abstract class Module { @Getter private final List dependsOnModules = new ArrayList<>(); + @Getter private final String wikiPage; diff --git a/src/main/java/net/buildtheearth/modules/ModuleComponent.java b/src/main/java/net/buildtheearth/modules/ModuleComponent.java index 8e18055f..09db3a6f 100644 --- a/src/main/java/net/buildtheearth/modules/ModuleComponent.java +++ b/src/main/java/net/buildtheearth/modules/ModuleComponent.java @@ -1,6 +1,7 @@ package net.buildtheearth.modules; import lombok.Getter; +import org.bukkit.entity.Player; /** * An interface for BuildTeamTools components. diff --git a/src/main/java/net/buildtheearth/modules/WikiDocumented.java b/src/main/java/net/buildtheearth/modules/WikiDocumented.java new file mode 100644 index 00000000..3f8e8d01 --- /dev/null +++ b/src/main/java/net/buildtheearth/modules/WikiDocumented.java @@ -0,0 +1,22 @@ +package net.buildtheearth.modules; + +import org.bukkit.entity.Player; +import org.jspecify.annotations.NonNull; + +public interface WikiDocumented { + + /** + * @return the wiki page URL for this object + */ + String getWikiPage(); + + /** + * Sends more information about this object to a player. + */ + default void sendWikiLink(@NonNull Player p) { + p.sendMessage(" "); + p.sendMessage("§cFor more information take a look here:"); + p.sendMessage("§c" + getWikiPage()); + } +} + diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java index 74385d89..ac0592c3 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java @@ -1,9 +1,11 @@ package net.buildtheearth.modules.generator.components.field; +import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.generator.model.Flag; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.Script; import net.buildtheearth.modules.generator.utils.GeneratorUtils; +import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -17,7 +19,7 @@ public class FieldScripts extends Script { public FieldScripts(Player player, GeneratorComponent generatorComponent) { super(player, generatorComponent); - fieldScript_v_1_0(); + Bukkit.getScheduler().runTaskAsynchronously(BuildTeamTools.getInstance(), this::fieldScript_v_1_0); } public void fieldScript_v_1_0() { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/House.java b/src/main/java/net/buildtheearth/modules/generator/components/house/House.java index 71065264..a0f1bf24 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/House.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/House.java @@ -1,6 +1,5 @@ package net.buildtheearth.modules.generator.components.house; -import com.sk89q.worldedit.regions.Region; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; import net.buildtheearth.modules.generator.utils.GeneratorUtils; @@ -24,10 +23,10 @@ public boolean checkForPlayer(Player p) { Block[][][] blocks = getPlayerSettings().get(p.getUniqueId()).getBlocks(); - if (!GeneratorUtils.checkForBrickOutline(blocks, p)) + if (!GeneratorUtils.checkForBrickOutline(blocks, p, this)) return false; - return GeneratorUtils.checkForWoolBlock(blocks, p); + return GeneratorUtils.checkForWoolBlock(blocks, p, this); } @Override diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java index fe19b864..8fd67493 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java @@ -5,12 +5,14 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; +import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.generator.model.Flag; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.Script; import net.buildtheearth.modules.generator.utils.GeneratorUtils; import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; @@ -22,8 +24,7 @@ public class HouseScripts extends Script { public HouseScripts(Player player, GeneratorComponent generatorComponent) { super(player, generatorComponent); - - buildscript_v_1_2(); + Bukkit.getScheduler().runTaskAsynchronously(BuildTeamTools.getInstance(), this::buildscript_v_1_2); } public void buildscript_v_1_2(){ diff --git a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java index 7cd126ef..3178a538 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java @@ -1,7 +1,9 @@ package net.buildtheearth.modules.generator.components.rail; +import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.generator.model.*; import net.buildtheearth.modules.generator.utils.GeneratorUtils; +import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -14,7 +16,7 @@ public class RailScripts extends Script { public RailScripts(Player player, GeneratorComponent generatorComponent) { super(player, generatorComponent); - railScript_v_1_3(); + Bukkit.getScheduler().runTaskAsynchronously(BuildTeamTools.getInstance(), this::railScript_v_1_3); } public void railScript_v_1_3() { diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java index d40ee6f4..9c84694b 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java @@ -3,6 +3,7 @@ import lombok.Getter; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.ModuleComponent; +import net.buildtheearth.modules.WikiDocumented; import net.buildtheearth.modules.generator.components.field.FieldSettings; import net.buildtheearth.modules.generator.components.house.HouseSettings; import net.buildtheearth.modules.generator.components.rail.RailSettings; @@ -22,9 +23,9 @@ import java.util.HashMap; import java.util.UUID; -public abstract class GeneratorComponent extends ModuleComponent { - +public abstract class GeneratorComponent extends ModuleComponent implements WikiDocumented { + @Getter public String wikiPage; @Getter diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Script.java b/src/main/java/net/buildtheearth/modules/generator/model/Script.java index 3af5cf03..786b4998 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Script.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/Script.java @@ -54,7 +54,6 @@ public Script(Player player, GeneratorComponent generatorComponent) { GeneratorUtils.setGmask(localSession, null); } - protected void finish(Block[][][] blocks, List points){ createSelection(points); //setGmask(null); diff --git a/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java b/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java index 992ece36..6c32b9e5 100644 --- a/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java +++ b/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java @@ -37,8 +37,8 @@ import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import net.buildtheearth.BuildTeamTools; +import net.buildtheearth.modules.WikiDocumented; import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.MenuItems; import org.apache.commons.lang3.StringUtils; @@ -138,8 +138,8 @@ *

Preparation Check Functions: *
• {@link #checkIfSchematicBrushIsInstalled(Player)} *
• {@link #checkForNoWorldEditSelection(Player)} - *
• {@link #checkForBrickOutline(Block[][][], Player)} - *
• {@link #checkForWoolBlock(Block[][][], Player)} + *
• {@link #checkForBrickOutline(Block[][][], Player, WikiDocumented)} + *
• {@link #checkForWoolBlock(Block[][][], Player, WikiDocumented)} * * @version 1.5 * @author MineFact @@ -183,14 +183,6 @@ private static Material[] getIgnoredMaterials(){ return MenuItems.getIgnoredMaterials(); } - private static void sendWikiLink(Player p){ - sendWikiLink(p); - } - - - - - /*=============================================** SCRIPT HELPER FUNCTIONS @@ -1700,7 +1692,7 @@ public static boolean checkIfSchematicBrushIsInstalled(Player p){ // Check if WorldEdit is enabled if (!isSchematicBrushEnabled()) { p.sendMessage("§cPlease install Schematic Brush to use this tool. You can ask the server administrator to install it."); - sendWikiLink(p); + return false; } return true; @@ -1733,12 +1725,12 @@ public static boolean checkForNoWorldEditSelection(Player p){ * @param p The player to check for * @return Whether the player has a brick block in their selection */ - public static boolean checkForBrickOutline(Block[][][] blocks, Player p){ + public static boolean checkForBrickOutline(Block[][][] blocks, Player p, WikiDocumented w){ if(!containsBlock(blocks, XMaterial.BRICKS)){ p.sendMessage("§cPlease make a selection around an outline."); p.closeInventory(); p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F); - sendWikiLink(p); + w.sendWikiLink(p); return false; } @@ -1752,12 +1744,12 @@ public static boolean checkForBrickOutline(Block[][][] blocks, Player p){ * @param p The player to check for * @return Whether the player has a yellow wool block in their selection */ - public static boolean checkForWoolBlock(Block[][][] blocks, Player p){ + public static boolean checkForWoolBlock(Block[][][] blocks, Player p, WikiDocumented w){ if(!containsBlock(blocks, XMaterial.YELLOW_WOOL)){ p.sendMessage("§cPlease place a yellow wool block inside the outline."); p.closeInventory(); p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F); - sendWikiLink(p); + w.sendWikiLink(p); ItemStack yellowWool = XMaterial.YELLOW_WOOL.parseItem(); if(!p.getInventory().contains(yellowWool)) { diff --git a/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java b/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java index 5d4b6cb6..18f728c2 100644 --- a/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java +++ b/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java @@ -1,12 +1,12 @@ package net.buildtheearth.modules.plotsystem; -import com.alpsbte.alpslib.libpsterra.core.Connection; +/*import com.alpsbte.alpslib.libpsterra.core.Connection; import com.alpsbte.alpslib.libpsterra.core.PSTerraSetup; import com.alpsbte.alpslib.libpsterra.core.config.ConfigManager; import com.alpsbte.alpslib.libpsterra.core.config.PSInitializer; import com.alpsbte.alpslib.libpsterra.core.plotsystem.PlotCreator; -import com.alpsbte.alpslib.libpsterra.core.plotsystem.PlotPaster; +import com.alpsbte.alpslib.libpsterra.core.plotsystem.PlotPaster;*/ import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.Module; import net.buildtheearth.modules.common.CommonModule; @@ -17,24 +17,25 @@ import net.buildtheearth.utils.io.ConfigUtil; import net.buildtheearth.utils.io.Constants; import net.buildtheearth.utils.io.Errors; +import org.apache.commons.lang3.NotImplementedException; import org.bukkit.Bukkit; public class PlotSystemModule extends Module { private static PlotSystemModule instance = null; - +/* private ConfigManager configManager; - private PlotPaster plotPaster; + private PlotPaster plotPaster;*/ private boolean pluginEnabled = false; public String version; public String newVersion; public boolean updateInstalled = false; - +/* private Connection connection; - private PlotCreator plotCreator; + private PlotCreator plotCreator;*/ public PlotSystemModule() { super("PlotSystem"); @@ -47,6 +48,7 @@ public static PlotSystemModule getInstance() { @Override public void enable() { + throw new NotImplementedException("Currently broken");/* // Check if WorldEdit is enabled if (!CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled()) { shutdown(Errors.WORLD_EDIT_NOT_INSTALLED); @@ -124,7 +126,7 @@ public void enable() { return; } - super.enable(); + super.enable();*/ } diff --git a/src/main/resources/modules/navigation/config.yml b/src/main/resources/modules/navigation/config.yml index 0eed449b..dd644f89 100644 --- a/src/main/resources/modules/navigation/config.yml +++ b/src/main/resources/modules/navigation/config.yml @@ -48,4 +48,4 @@ warps: sorting-mode: default # NOTE: Do not change -config-version: 1.4 \ No newline at end of file +config-version: 1.6 \ No newline at end of file From d1d4d70336afeb1b5d922ce20049ac93c059b6a7 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 5 Jan 2026 23:30:01 +0100 Subject: [PATCH 03/37] =?UTF-8?q?feat(build):=20=E2=9C=A8=20enhance=20asyn?= =?UTF-8?q?c=20operation=20handling=20and=20update=20module=20registration?= =?UTF-8?q?=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/buildtheearth/modules/ModuleHandler.java | 2 +- .../common/components/version/VersionComponent.java | 2 +- .../buildtheearth/modules/generator/model/Command.java | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/ModuleHandler.java b/src/main/java/net/buildtheearth/modules/ModuleHandler.java index fcaf3e4d..6583f17c 100644 --- a/src/main/java/net/buildtheearth/modules/ModuleHandler.java +++ b/src/main/java/net/buildtheearth/modules/ModuleHandler.java @@ -46,7 +46,7 @@ public void registerModule(Module module) { */ public void registerModules(Module @NotNull ... modules) { for (Module m : modules) { - if (!Objects.requireNonNull(BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES)).contains(m.getModuleName())) { + if (!BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES, List.of()).contains(m.getModuleName())) { registerModule(m); } } diff --git a/src/main/java/net/buildtheearth/modules/common/components/version/VersionComponent.java b/src/main/java/net/buildtheearth/modules/common/components/version/VersionComponent.java index 90714a89..6f658ce7 100644 --- a/src/main/java/net/buildtheearth/modules/common/components/version/VersionComponent.java +++ b/src/main/java/net/buildtheearth/modules/common/components/version/VersionComponent.java @@ -50,7 +50,7 @@ public enum Version { v1_20_R1(20, "1.20", "1.20.1"), v1_20_R2(20, "1.20.2", "1.20.3"), v1_20_R3(20, "1.20.4"), - v1_21_R1(21, "1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8"); + v1_21_R1(21, "1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.10", "1.21.11"); private final int xseriesVersion; private final String[] bukkitVersions; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Command.java b/src/main/java/net/buildtheearth/modules/generator/model/Command.java index ef91b560..c543e3ad 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Command.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/Command.java @@ -235,8 +235,14 @@ public void processOperation(Operation operation){ if(future != null){ threadActive = true; - future.thenRun(() -> { + // Ensure we clear threadActive and remove the operation regardless of success or exception + future.whenComplete((v, ex) -> { threadActive = false; + if (ex != null) { + ChatHelper.logError("Async operation failed: " + operation.getOperationType() + " - " + operation.getValuesAsString()); + ex.printStackTrace(); + } + // Remove the processed operation from the queue operations.remove(0); }); From 1854a4ee76c1a7e95452b350ef37f0fd2d19c7e6 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sat, 10 Jan 2026 19:21:40 +0100 Subject: [PATCH 04/37] =?UTF-8?q?fix(kml):=20=E2=9C=A8=20fix=20JAXB=20cont?= =?UTF-8?q?ext=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improves #61. --- build.gradle.kts | 4 +- gradle/libs.versions.toml | 4 +- .../generator/components/kml/KmlParser.java | 76 ++++++++++--------- 3 files changed, 46 insertions(+), 38 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 12ea19cd..c6dd11b1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -76,7 +76,9 @@ dependencies { implementation(libs.com.google.code.gson.gson) implementation(libs.com.google.guava.guava) implementation(libs.com.squareup.okhttp3.okhttp.jvm) - implementation(libs.de.micromata.jak.javaapiforkml) + implementation(libs.javaapiforkml) { + exclude(group = "com.sun.xml.bind", module = "jaxb-xjc") // Else Remapping will yell of duplicated classes + } implementation(libs.com.googlecode.json.simple) compileOnly(libs.io.papermc.paper.paper.api) compileOnly(libs.com.mojang.authlib) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 37fa9611..4c86f938 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ com-google-code-gson-gson = "2.13.1" com-google-guava-guava = "33.4.8-jre" com-mojang-authlib = "7.0.61" com-squareup-okhttp3-okhttp-jvm = "5.1.0" -de-micromata-jak-javaapiforkml = "2.2.1" +javaapiforkml = "3.0.10" # https://github.com/urbancamo/javaapiforkml io-papermc-paper-paper-api = "1.21.10-R0.1-SNAPSHOT" micycle-clipper2 = "1.2.2" net-daporkchop-lib-binary = "0.5.7-SNAPSHOT" @@ -34,7 +34,7 @@ com-google-code-gson-gson = { module = "com.google.code.gson:gson", version.ref com-google-guava-guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" } com-mojang-authlib = { module = "com.mojang:authlib", version.ref = "com-mojang-authlib" } com-squareup-okhttp3-okhttp-jvm = { module = "com.squareup.okhttp3:okhttp-jvm", version.ref = "com-squareup-okhttp3-okhttp-jvm" } -de-micromata-jak-javaapiforkml = { module = "de.micromata.jak:JavaAPIforKml", version.ref = "de-micromata-jak-javaapiforkml" } +javaapiforkml = { module = "uk.m0nom:javaapiforkml", version.ref = "javaapiforkml" } io-papermc-paper-paper-api = { module = "io.papermc.paper:paper-api", version.ref = "io-papermc-paper-paper-api" } micycle-clipper2 = { module = "micycle:clipper2", version.ref = "micycle-clipper2" } net-daporkchop-lib-binary = { module = "net.daporkchop.lib:binary", version.ref = "net-daporkchop-lib-binary" } diff --git a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlParser.java b/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlParser.java index 69df0bd3..d48bdb06 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlParser.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlParser.java @@ -1,21 +1,11 @@ package net.buildtheearth.modules.generator.components.kml; -import java.util.List; -import java.util.ArrayList; - +import de.micromata.opengis.kml.v_2_2_0.*; import org.bukkit.entity.Player; -import de.micromata.opengis.kml.v_2_2_0.Coordinate; -import de.micromata.opengis.kml.v_2_2_0.Document; -import de.micromata.opengis.kml.v_2_2_0.Feature; -import de.micromata.opengis.kml.v_2_2_0.Geometry; -import de.micromata.opengis.kml.v_2_2_0.Kml; -import de.micromata.opengis.kml.v_2_2_0.LineString; -import de.micromata.opengis.kml.v_2_2_0.LinearRing; -import de.micromata.opengis.kml.v_2_2_0.MultiGeometry; -import de.micromata.opengis.kml.v_2_2_0.Placemark; -import de.micromata.opengis.kml.v_2_2_0.Polygon; +import java.util.ArrayList; +import java.util.List; public class KmlParser { private Player player; @@ -32,18 +22,26 @@ public List> extractCoordinates(String kmlString) //https://github.com/micromata/javaapiforkml try { - Kml kml = Kml.unmarshal(kmlString); - - //Top-level element will be a document - Document doc = (Document) kml.getFeature(); - List placemarks = findPlacemarks(doc); - - - for (Placemark placemark : placemarks){ - // get all geometries from placemark (might be multiple lists) - //each list creates a separate entry list in the result - List> placemark_coords_lists = getCoordinates(placemark.getGeometry()); - result_lists.addAll(placemark_coords_lists); + // Set the context class loader to ensure JAXB service loader can find the implementation + // This is necessary when running in a PluginClassLoader environment + ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); + Kml kml = Kml.unmarshal(kmlString); + + //Top-level element will be a document + Document doc = (Document) kml.getFeature(); + List placemarks = findPlacemarks(doc); + + + for (Placemark placemark : placemarks) { + // get all geometries from placemark (might be multiple lists) + //each list creates a separate entry list in the result + List> placemark_coords_lists = getCoordinates(placemark.getGeometry()); + result_lists.addAll(placemark_coords_lists); + } + } finally { + Thread.currentThread().setContextClassLoader(originalClassLoader); } } catch (Exception ex) { @@ -70,16 +68,24 @@ public List extractLinestrings(String kmlString) //https://github.com/micromata/javaapiforkml try { - Kml kml = Kml.unmarshal(kmlString); - //Top-level element will be a document - Document doc = (Document) kml.getFeature(); - List placemarks = findPlacemarks(doc); - - - for (Placemark placemark : placemarks){ - // #extract coordinates assuming geometry is linestring - List lines = findLineStrings(placemark); - linestrings.addAll(lines); + // Set the context class loader to ensure JAXB service loader can find the implementation + // This is necessary when running in a PluginClassLoader environment + ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); + Kml kml = Kml.unmarshal(kmlString); + //Top-level element will be a document + Document doc = (Document) kml.getFeature(); + List placemarks = findPlacemarks(doc); + + + for (Placemark placemark : placemarks) { + // #extract coordinates assuming geometry is linestring + List lines = findLineStrings(placemark); + linestrings.addAll(lines); + } + } finally { + Thread.currentThread().setContextClassLoader(originalClassLoader); } } catch (Exception ex) { From 6196d972651c89ba23e73541dc6afa6d5e823713 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sat, 10 Jan 2026 19:25:37 +0100 Subject: [PATCH 05/37] =?UTF-8?q?feat(gen):=20=E2=9C=A8=20refactor=20zip?= =?UTF-8?q?=20installation=20and=20extraction=20logic,=20improve=20error?= =?UTF-8?q?=20handling,=20and=20add=20version=20file=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #47. Fixes #60. --- .../generator/model/GeneratorCollections.java | 131 ++++++++++-------- 1 file changed, 72 insertions(+), 59 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java index 84b11efa..3a894dca 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java @@ -14,16 +14,20 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; +import org.codehaus.plexus.util.FileUtils; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.json.JSONArray; import org.json.JSONObject; +import org.jspecify.annotations.NonNull; import java.io.*; import java.lang.reflect.Method; import java.net.HttpURLConnection; +import java.net.URI; import java.net.URL; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.logging.Level; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -114,7 +118,7 @@ else if(CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled() return checkIfGeneratorCollectionsIsUpToDate(p); } catch (Exception e) { - e.printStackTrace(); + BuildTeamTools.getInstance().getComponentLogger().warn("Failed to check if Generator Collections is installed:", e); return installGeneratorCollections(p, true); } } @@ -168,13 +172,17 @@ public static String getRepositoryReleaseVersionString(String owner, String repo * * @param filename The name of the zip folder to install. Example: "newtrees.zip" * @param path The path to extract the zip folder to. Parent Folder is the plugin folder. Example: "/../WorldEdit/schematics/" + * @param extractionFolder The path where the downloaded zip file is temporarily saved */ - private static boolean installZipFolder(String parentURL, String filename, String path) throws IOException { - path = BuildTeamTools.getInstance().getDataFolder().getAbsolutePath() + path; - String zipFilePath = path + "/" + filename; - URL url = new URL(parentURL + filename); + private static boolean installZipFolder(String parentURL, String filename, Path path, @NonNull Path extractionFolder) throws IOException { + if (!extractionFolder.toFile().exists() && !extractionFolder.toFile().mkdirs()) { + throw new IOException("Failed to create generator module folder: " + extractionFolder); + } + + var zipFilePath = extractionFolder.resolve(filename); + URL url = URI.create(parentURL + filename).toURL(); - File file = new File(path); + File file = path.toFile(); if(!file.exists()) { boolean created = file.mkdir(); @@ -192,7 +200,7 @@ private static boolean installZipFolder(String parentURL, String filename, Strin // Save the zip file to the path try (BufferedInputStream in = new BufferedInputStream(httpConn.getInputStream()); - FileOutputStream out = new FileOutputStream(path + "/" + filename)) { + FileOutputStream out = new FileOutputStream(zipFilePath.toFile())) { byte[] buffer = new byte[4096]; int bytesRead; @@ -215,33 +223,30 @@ private static boolean installZipFolder(String parentURL, String filename, Strin /** Extracts a zip folder on the system * - * @param zipFilePath The path to the zip folder. Example: "/../WorldEdit/schematics/newtrees.zip" + * @param zipFilePath The path to the zip folder. Example: "/../BuildTeamTols/modules/generator/GeneratorCollections.zip" * @param destDirectory The path to extract the zip folder to. Parent Folder is the plugin folder. Example: "/../WorldEdit/schematics/" */ - private static boolean unzip(String zipFilePath, String destDirectory) { - File destDir = new File(destDirectory); + private static boolean unzip(Path zipFilePath, @NonNull Path destDirectory) { + File destDir = destDirectory.toFile(); if (!destDir.exists()) { boolean success = destDir.mkdir(); if(!success) return false; } - try (ZipInputStream zipIn = new ZipInputStream(Files.newInputStream(Paths.get(zipFilePath)))) { + try (ZipInputStream zipIn = new ZipInputStream(Files.newInputStream(zipFilePath))) { ZipEntry entry = zipIn.getNextEntry(); while (entry != null) { - String filePath = destDirectory + File.separator + entry.getName(); + var filePath = destDirectory.resolve(entry.getName()); if (!entry.isDirectory()) { - File file = new File(filePath); - File parentDir = file.getParentFile(); - if (!parentDir.exists()) { - if (!parentDir.mkdirs()) { + File parentDir = filePath.getParent().toFile(); + if (!parentDir.exists() && !parentDir.mkdirs()) { throw new IOException("Failed to create parent directories for: " + filePath); } - } - try (BufferedOutputStream bos = new BufferedOutputStream(Files.newOutputStream(Paths.get(filePath)))) { + try (BufferedOutputStream bos = new BufferedOutputStream(Files.newOutputStream(filePath))) { byte[] bytesIn = new byte[4096]; int read; while ((read = zipIn.read(bytesIn)) != -1) { @@ -249,8 +254,7 @@ private static boolean unzip(String zipFilePath, String destDirectory) { } } } else { - File dir = new File(filePath); - boolean success = dir.mkdirs(); + boolean success = filePath.toFile().mkdirs(); if(!success) return false; @@ -259,8 +263,7 @@ private static boolean unzip(String zipFilePath, String destDirectory) { entry = zipIn.getNextEntry(); } - // Delete the old zip file - deleteFile(zipFilePath); + deleteFile(zipFilePath); // Delete the old zip file }catch (Exception e){ e.printStackTrace(); return false; @@ -272,23 +275,13 @@ private static boolean unzip(String zipFilePath, String destDirectory) { /** Deletes a directory from the system * * @param path The path to the directory to delete - * @return Whether the directory was deleted successfully */ - private static boolean deleteDirectory(String path) { - File dir = new File(path); - - if (dir.isDirectory()) { - String[] children = dir.list(); - - if (children != null) - for (String child : children) { - boolean success = deleteDirectory(new File(dir, child).getAbsolutePath()); - if (!success) { - return false; // Return false if deletion is unsuccessful - } - } + private static void deleteDirectory(@NonNull Path path) { + try { + FileUtils.deleteDirectory(path.toFile()); + } catch (IOException e) { + BuildTeamTools.getInstance().getComponentLogger().warn("Failed to delete directory: {}", path); } - return dir.delete(); // Return true if directory is deleted successfully } /** @@ -296,11 +289,11 @@ private static boolean deleteDirectory(String path) { * * @param path The path to the file to delete */ - private static void deleteFile(String path) { - File file = new File(path); + private static void deleteFile(@NonNull Path path) { + File file = path.toFile(); boolean success = file.delete(); if(!success) - System.out.println("Failed to delete file: " + path); + BuildTeamTools.getInstance().getComponentLogger().warn("Failed to delete file: {}", path); } /** @@ -312,16 +305,8 @@ private static void deleteFile(String path) { private static boolean checkIfGeneratorCollectionsIsUpToDate(Player p){ // Load the schematic file try { - String folder; - if(CommonModule.getInstance().getDependencyComponent().isFastAsyncWorldEditEnabled()) - folder = "/../FastAsyncWorldEdit/schematics/"; - else if(CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled()) - folder = "/../WorldEdit/schematics/"; - else - return false; - - String filepath = "GeneratorCollections/"; - FileConfiguration cfg = YamlConfiguration.loadConfiguration(new File(BuildTeamTools.getInstance().getDataFolder().getAbsolutePath() + folder + filepath, "config.yml")); + var cfgFile = BuildTeamTools.getInstance().getDataFolder().toPath().resolve("modules").resolve("generator").resolve("generatorCollectionsVersion.yml"); + FileConfiguration cfg = YamlConfiguration.loadConfiguration(cfgFile.toFile()); if(!cfg.contains("version")) return installGeneratorCollections(p, true); @@ -365,25 +350,25 @@ private static boolean installGeneratorCollections(@Nullable Player p, boolean u String filename = "GeneratorCollections.zip"; String fileDirectory = "GeneratorCollections/"; - String path; + var path = Bukkit.getPluginsFolder().toPath(); if(CommonModule.getInstance().getDependencyComponent().isFastAsyncWorldEditEnabled()) - path = "/../FastAsyncWorldEdit/schematics/"; + path = path.resolve("FastAsyncWorldEdit").resolve("schematics"); else if(CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled()) - path = "/../WorldEdit/schematics/"; + path = path.resolve("WorldEdit").resolve("schematics"); else return false; if(update) { ChatHelper.logPlayerAndConsole(p, "§cThe Generator Collections package is outdated. Updating...", Level.INFO); - - deleteDirectory(BuildTeamTools.getInstance().getDataFolder().getAbsolutePath() + path + fileDirectory); + deleteDirectory(path.resolve(fileDirectory)); } else ChatHelper.logPlayerAndConsole(p, "§cThe Generator Collections package wasn't found on your server. Installing...", Level.INFO); - - + var generatorModulePath = BuildTeamTools.getInstance().getDataFolder().toPath().resolve("modules").resolve("generator"); try { - boolean success = installZipFolder(parentURL, filename, path); + boolean success = installZipFolder(parentURL, filename, path, generatorModulePath); + if (success) + success = moveVersionFile(generatorModulePath, path.resolve("GeneratorCollections"), "config.yml", "generatorCollectionsVersion.yml"); if(success) { ChatHelper.logPlayerAndConsole(p, "§7Successfully installed §eGenerator Collections v" + GENERATOR_COLLECTIONS_VERSION + "§7!", Level.INFO); @@ -400,4 +385,32 @@ else if(CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled() } } + /** + * Moves a file from the old directory to the new directory + * + * @param newDir The new directory to move the file to + * @param oldDir The old directory to move the file from + * @param oldFileName The name of the file to move + * @param newFileName The new name of the file + * @return Whether the move was successful + */ + private static boolean moveVersionFile(@NotNull Path newDir, @NotNull Path oldDir, String oldFileName, String newFileName) { + Path source = oldDir.resolve(oldFileName); + Path target = newDir.resolve(newFileName); + + try { + // Ensure target parent exists + Files.createDirectories(target.getParent()); + + // Move with replace to avoid failure if target exists + Files.move(source, target, java.nio.file.StandardCopyOption.REPLACE_EXISTING); + + return true; + } catch (IOException e) { + BuildTeamTools.getInstance().getComponentLogger() + .warn("Failed to move '{}' to '{}': {}", source, target, e.toString()); + return false; + } + } + } From 1f2e4c2247a33a3563408a05e7a6e24a8ba0e243 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sat, 10 Jan 2026 19:27:48 +0100 Subject: [PATCH 06/37] =?UTF-8?q?fix(stats):=20=E2=9C=A8=20add=20validatio?= =?UTF-8?q?n=20for=20Network=20Module=20Build=20Team=20connection=20on=20e?= =?UTF-8?q?nable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #34. --- .../modules/stats/StatsModule.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/stats/StatsModule.java b/src/main/java/net/buildtheearth/modules/stats/StatsModule.java index 35001cf9..9b505666 100644 --- a/src/main/java/net/buildtheearth/modules/stats/StatsModule.java +++ b/src/main/java/net/buildtheearth/modules/stats/StatsModule.java @@ -40,6 +40,16 @@ public static StatsModule getInstance() { @Override public void enable() { + if (NetworkModule.getInstance().getBuildTeam() == null) { + shutdown("The Network Module failed to load the Build Team."); + return; + } + + if (!NetworkModule.getInstance().getBuildTeam().isConnected() || !Bukkit.getServerConfig().isProxyEnabled()) { + shutdown("The Build Team have to be connected to the BtE Network (Proxy)."); + return; + } + statsServer = new StatsServer(); statsPlayerList = new HashMap<>(); @@ -93,18 +103,18 @@ public void addStatsPlayer(UUID uuid) { */ public boolean updateAndSave() { List communicators = NetworkModule.getInstance().getCommunicators(); - if (communicators.size() == 0) return false; + if (communicators.isEmpty()) return false; if (!BuildTeamTools.getInstance().isEnabled()) return false; - Player p = Bukkit.getPlayer(communicators.get(0)); + Player p = Bukkit.getPlayer(communicators.getFirst()); if (p == null) { - communicators.remove(0); + communicators.removeFirst(); return false; } if (!p.isOnline()) { - communicators.remove(0); + communicators.removeFirst(); return false; } From b96fdb00f01c92d4394f6afc7e767bdf75a7a358 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sat, 10 Jan 2026 19:30:49 +0100 Subject: [PATCH 07/37] =?UTF-8?q?feat(build):=20=E2=9C=A8=20update=20build?= =?UTF-8?q?=20configuration,=20enhance=20module=20registration,=20and=20im?= =?UTF-8?q?prove=20error=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 ++--- build.gradle.kts | 22 ++-------- .../net/buildtheearth/BuildTeamTools.java | 11 +++-- .../buildtheearth/modules/ModuleHandler.java | 44 ++++++++++--------- .../common/listeners/CommandListener.java | 3 +- .../components/rail/RailScripts.java | 10 ++--- .../modules/plotsystem/PlotSystemModule.java | 14 ++---- src/main/resources/config.yml | 2 +- 8 files changed, 46 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 7ff45773..704f4b04 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,9 @@ Logo

- Logo + Logo

-

BuildTeamTools

@@ -25,7 +24,6 @@

Downloads Count Latest Version - Total Lines Repo Size

@@ -41,11 +39,11 @@ Its primary goal is to significantly speed up the building process by eliminatin ## Features 🔨 **Easy-to-use** Tools for everything around BuildTheEarth
-⏱ **Multi-Version** support from `1.18` - `1.21.4`
+⏱ **Multi-Version** support from `1.18` - `1.21.x`
✔️ **User-friendly** GUIs and Commands
-💬 **Multi-Language** Support (PLANNED)
📆 **Automatic** Updates
🔌 **Easy setup** and configuration
+**Multi-Language** Support (PLANNED)
## Components @@ -64,7 +62,7 @@ The **\*** symbol shows that this feature is still being developed or under main ## Installation 💻 **Requirements:** -- A Server running Paper 1.18 - **1.21.4**. +- A Server running Paper 1.18 - **1.21.x**. 🚩 **How to install:** 1. Download BuildTeamTools [here](https://www.spigotmc.org/resources/buildteamtools.101854/). diff --git a/build.gradle.kts b/build.gradle.kts index c6dd11b1..7ac88f94 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -108,27 +108,10 @@ tasks.shadowJar { exclude("org/jetbrains/annotations/**") // Exclude slf4j classes exclude("org/slf4j/**") - exclude("META-INF/**") - // Exclude duplicate com.sun.* classes - exclude("com/sun/codemodel/**") - exclude("com/sun/tools/xjc/**") - exclude("com/sun/xml/xsom/**") archiveClassifier = "" - val relocationPrefix = "net.buildtheearth.buildteamtools.shaded" - relocate("com.alpsbte.alpslib", "$relocationPrefix.alpslib") - relocate("org.mariadb.jdbc", "$relocationPrefix.jdbc") - relocate("com.zaxxer.hikari", "$relocationPrefix.hikari") - relocate("net.wesjd.anvilgui", "$relocationPrefix.anvilgui") - relocate("com.cryptomorin.xseries", "$relocationPrefix.xseries") - relocate("org.ipvp.canvas", "$relocationPrefix.canvas") - relocate("net.daporkchop.lib.binary", "$relocationPrefix.binary") - relocate("clipper2", "$relocationPrefix.clipper2") - relocate("com.google.gson", "$relocationPrefix.gson") - relocate("de.micromata.jak", "$relocationPrefix.jak") - relocate("org.json", "$relocationPrefix.json") - relocate("com.google.guava", "$relocationPrefix.guava") - relocate("com.squareup.okhttp3", "$relocationPrefix.okhttp3") + relocationPrefix = "net.buildtheearth.buildteamtools.shaded" + enableAutoRelocation = true } tasks.assemble { @@ -136,6 +119,7 @@ tasks.assemble { } tasks.jar { + archiveClassifier = "UNSHADED" enabled = false // Disable the default jar task since we are using shadowJar } diff --git a/src/main/java/net/buildtheearth/BuildTeamTools.java b/src/main/java/net/buildtheearth/BuildTeamTools.java index accc350b..e051cd5a 100644 --- a/src/main/java/net/buildtheearth/BuildTeamTools.java +++ b/src/main/java/net/buildtheearth/BuildTeamTools.java @@ -8,6 +8,7 @@ import net.buildtheearth.modules.miscellaneous.MiscModule; import net.buildtheearth.modules.navigation.NavigationModule; import net.buildtheearth.modules.network.NetworkModule; +import net.buildtheearth.modules.plotsystem.PlotSystemModule; import net.buildtheearth.modules.stats.StatsModule; import net.buildtheearth.utils.io.ConfigUtil; import org.bukkit.configuration.file.FileConfiguration; @@ -37,16 +38,14 @@ public void onEnable() { instance = this; // Register Modules - - // We need to register the Common Module first to have the Config System Available for other modules/logic. - ModuleHandler.getInstance().registerModule(CommonModule.getInstance()); - ModuleHandler.getInstance().enable(CommonModule.getInstance(), null); - ModuleHandler.getInstance().registerModules( + CommonModule.getInstance(), NetworkModule.getInstance(), GeneratorModule.getInstance(), NavigationModule.getInstance(), - MiscModule.getInstance() + MiscModule.getInstance(), + StatsModule.getInstance(), + PlotSystemModule.getInstance() ); ModuleHandler.getInstance().enableAll(null); } diff --git a/src/main/java/net/buildtheearth/modules/ModuleHandler.java b/src/main/java/net/buildtheearth/modules/ModuleHandler.java index 6583f17c..3877ec9b 100644 --- a/src/main/java/net/buildtheearth/modules/ModuleHandler.java +++ b/src/main/java/net/buildtheearth/modules/ModuleHandler.java @@ -12,7 +12,6 @@ import java.util.ArrayList; import java.util.List; -import java.util.Objects; /** * @author Noah Husby @@ -45,11 +44,8 @@ public void registerModule(Module module) { * @param modules {@link Module} */ public void registerModules(Module @NotNull ... modules) { - for (Module m : modules) { - if (!BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES, List.of()).contains(m.getModuleName())) { - registerModule(m); - } - } + for (Module m : modules) + registerModule(m); } /** @@ -64,24 +60,30 @@ public boolean enable(@NotNull Module module, @Nullable CommandSender executor) if (m.getModuleName().equals(module.getModuleName()) && m.isEnabled()) return false; - boolean containsDisabledDependencyModule = false; - for (Module m : module.getDependsOnModules()) - if (!m.isEnabled()) { - module.checkForModuleDependencies(); - containsDisabledDependencyModule = true; + if (!module.getModuleName().equals("Common") && BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES, List.of()).contains(module.getModuleName())) { + module.shutdown("This module is disabled in the config."); + } else { + boolean containsDisabledDependencyModule = false; + for (Module m : module.getDependsOnModules()) + if (!m.isEnabled()) { + module.checkForModuleDependencies(); + containsDisabledDependencyModule = true; + } + + try { + if (!containsDisabledDependencyModule) + module.enable(); + } catch (Exception ex) { + if (BuildTeamTools.getInstance().isDebug()) { + ChatHelper.logError("An error occurred while enabling the %s Module: %s", ex, module.getModuleName(), + ex.getMessage()); + } + + module.shutdown(ex.getMessage()); } + } - try { - if (!containsDisabledDependencyModule) - module.enable(); - } catch (Exception ex) { - if (BuildTeamTools.getInstance().isDebug()) { - ChatHelper.logError("An error occurred while enabling the %s Module: %s", ex, module.getModuleName(), - ex.getMessage()); - } - module.shutdown(ex.getMessage()); - } if (executor != null) { if (module.isEnabled() && BuildTeamTools.getInstance().isDebug()) diff --git a/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java b/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java index 0c474c0a..3eee3f7f 100644 --- a/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java +++ b/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java @@ -20,11 +20,12 @@ public void onCommand(PlayerCommandPreprocessEvent e) { for(Module module : ModuleHandler.getInstance().getModules()) if(!module.isEnabled()) for(PluginCommand command : module.getCommands().keySet()) { + if (command == null) continue; List commands = command.getAliases(); commands.add(command.getLabel()); for (String alias : commands) { - if (message.toLowerCase().startsWith("/" + alias.toLowerCase())) { + if (message.toLowerCase().equalsIgnoreCase("/" + alias.toLowerCase())) { String reason = ""; if (module.getError() != null && !module.getError().isEmpty()) diff --git a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java index 3178a538..8c6bdf5f 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java @@ -1,9 +1,8 @@ package net.buildtheearth.modules.generator.components.rail; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.generator.model.*; +import net.buildtheearth.modules.generator.model.GeneratorComponent; +import net.buildtheearth.modules.generator.model.Script; import net.buildtheearth.modules.generator.utils.GeneratorUtils; -import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -16,7 +15,9 @@ public class RailScripts extends Script { public RailScripts(Player player, GeneratorComponent generatorComponent) { super(player, generatorComponent); - Bukkit.getScheduler().runTaskAsynchronously(BuildTeamTools.getInstance(), this::railScript_v_1_3); + throw new UnsupportedOperationException("RailScripts is currently broken."); + //getPlayer().chat("/clearhistory"); + //Bukkit.getScheduler().runTaskAsynchronously(BuildTeamTools.getInstance(), this::railScript_v_1_3); } public void railScript_v_1_3() { @@ -27,7 +28,6 @@ public void railScript_v_1_3() { int zPos = getPlayer().getLocation().getBlockZ(); int operations = 0; - getPlayer().chat("/clearhistory"); int railWidth = 5; diff --git a/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java b/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java index 18f728c2..c84c2664 100644 --- a/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java +++ b/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java @@ -7,18 +7,9 @@ import com.alpsbte.alpslib.libpsterra.core.config.PSInitializer; import com.alpsbte.alpslib.libpsterra.core.plotsystem.PlotCreator; import com.alpsbte.alpslib.libpsterra.core.plotsystem.PlotPaster;*/ -import net.buildtheearth.BuildTeamTools; + import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.plotsystem.commands.PlotSystemTerraCommand; -import net.buildtheearth.utils.ChatHelper; -import net.buildtheearth.utils.io.ConfigPaths; -import net.buildtheearth.utils.io.ConfigUtil; -import net.buildtheearth.utils.io.Constants; -import net.buildtheearth.utils.io.Errors; -import org.apache.commons.lang3.NotImplementedException; -import org.bukkit.Bukkit; public class PlotSystemModule extends Module { @@ -48,7 +39,8 @@ public static PlotSystemModule getInstance() { @Override public void enable() { - throw new NotImplementedException("Currently broken");/* + shutdown("This module is currently oudated & broken."); + /* // Check if WorldEdit is enabled if (!CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled()) { shutdown(Errors.WORLD_EDIT_NOT_INSTALLED); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index c56d1836..8d7e53a4 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -8,7 +8,7 @@ # The Build Team API Key used to fetch build team info for display. # Find the key on the Minecraft Network at "buildtheearth.net". Navigate: Compass > Build Teams > My Teams > Your Team > API-Key. -# Without this key, some plugin components won't function. For assistance, see #server-support on the staff discord. +# Without this key, some plugin components wont function. For assistance, see #server-support on the staff discord. api-key: 00000000-0000-0000-0000-000000000000 # The main world using the custom BTE Dynmaxion projection From 08e710fe293c3fa9b3bd5cdd0f8d2def1bf239ba Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sat, 10 Jan 2026 19:31:29 +0100 Subject: [PATCH 08/37] =?UTF-8?q?fix(housescripts):=20=E2=9C=A8=20correct?= =?UTF-8?q?=20block=20query=20logic=20for=20roof=20type=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #59. --- .../modules/generator/components/house/HouseScripts.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java index 8fd67493..f2fb1eab 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java @@ -13,7 +13,6 @@ import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import org.bukkit.Bukkit; -import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -425,7 +424,7 @@ public void buildscript_v_1_2(){ for(int i = 0; i < maxRoofHeight; i++) { if(roofType == RoofType.FLATTER_SLABS || roofType == RoofType.MEDIUM_SLABS) //Only select air block that are surrounded by other stone slabs below or which are directly neighbors to lime wool or blue wool - replaceBlocksWithMask("=queryRel(0,-1,0,43)&&" + + replaceBlocksWithMask("=queryRel(0,-1,0,43,0)&&" + "(" + "(" + "queryRel(1,-1,0,43,-1)&&queryRel(-1,-1,0,43,-1)&&queryRel(0,-1,1,43,-1)&&queryRel(0,-1,-1,43,-1)" + From 969aebad38d80bde8091215bb1deac6e08b119a5 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sat, 10 Jan 2026 19:31:58 +0100 Subject: [PATCH 09/37] =?UTF-8?q?fix(generator):=20=E2=9C=A8=20disable=20r?= =?UTF-8?q?ailway=20generator=20temporarly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generator/commands/GeneratorCommand.java | 5 ++++- .../modules/generator/menu/GeneratorMenu.java | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java b/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java index c24ca9c8..33429ede 100644 --- a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java +++ b/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java @@ -6,6 +6,8 @@ import net.buildtheearth.modules.network.model.Permissions; import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.Utils; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -48,7 +50,8 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N // Command Usage: /gen rail ... case "rail": - GeneratorModule.getInstance().getRail().analyzeCommand(p, args); + p.sendMessage(Component.text("This generator have some serious issues and is currently disabled.", NamedTextColor.DARK_RED)); + //GeneratorModule.getInstance().getRail().analyzeCommand(p, args); return true; // Command Usage: /gen tree ... diff --git a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java index a41d33f8..b8c4dd21 100644 --- a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java @@ -3,7 +3,6 @@ import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.common.CommonModule; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.GeneratorCollections; import net.buildtheearth.modules.generator.components.field.Field; import net.buildtheearth.modules.generator.components.field.FieldSettings; import net.buildtheearth.modules.generator.components.field.menu.CropTypeMenu; @@ -11,14 +10,13 @@ import net.buildtheearth.modules.generator.components.house.HouseSettings; import net.buildtheearth.modules.generator.components.house.RoofType; import net.buildtheearth.modules.generator.components.house.menu.WallColorMenu; -import net.buildtheearth.modules.generator.components.rail.Rail; -import net.buildtheearth.modules.generator.components.rail.RailSettings; import net.buildtheearth.modules.generator.components.road.Road; import net.buildtheearth.modules.generator.components.road.RoadSettings; import net.buildtheearth.modules.generator.components.road.menu.RoadColorMenu; import net.buildtheearth.modules.generator.components.tree.Tree; import net.buildtheearth.modules.generator.components.tree.TreeSettings; import net.buildtheearth.modules.generator.components.tree.menu.TreeTypeMenu; +import net.buildtheearth.modules.generator.model.GeneratorCollections; import net.buildtheearth.modules.generator.model.GeneratorType; import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; @@ -26,13 +24,12 @@ import net.buildtheearth.utils.menus.AbstractMenu; import org.bukkit.ChatColor; import org.bukkit.Sound; -import org.bukkit.SoundCategory; -import org.bukkit.SoundGroup; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; + import java.util.ArrayList; public class GeneratorMenu extends AbstractMenu { @@ -110,7 +107,9 @@ protected void setPreviewItems() { "§8Left-click to generate", "§8Right-click for Tutorial"); - ItemStack railwayItem = Item.create(XMaterial.RAIL.parseMaterial(), "§9Generate Railway", railwayLore); + railwayLore = ListUtil.createList("", "§cThis §eGenerator §cis currently broken", "§cRailway Generator is disabled", "", "§8If you want to help fixing ask on Dev Hub!"); + + ItemStack railwayItem = Item.create(XMaterial.RAIL.parseMaterial(), "§9Generate Railway §c(DISABLED)", railwayLore); // Set navigator item getMenu().getSlot(RAILWAY_ITEM_SLOT).setItem(railwayItem); @@ -221,8 +220,9 @@ protected void setItemClickEventsAsync() { sendMoreInformation(clickPlayer, GeneratorType.RAILWAY); return; } + sendMoreInformation(clickPlayer, GeneratorType.RAILWAY); - Rail rail = GeneratorModule.getInstance().getRail(); + /*Rail rail = GeneratorModule.getInstance().getRail(); rail.getPlayerSettings().put(clickPlayer.getUniqueId(), new RailSettings(clickPlayer)); if(!rail.checkForPlayer(clickPlayer)) @@ -231,7 +231,7 @@ protected void setItemClickEventsAsync() { clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); - GeneratorModule.getInstance().getRail().generate(clickPlayer); + GeneratorModule.getInstance().getRail().generate(clickPlayer);*/ })); // Set click event for tree item From 9d7585080c8170aceb13070acb2a5b237de40196 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sat, 10 Jan 2026 21:58:32 +0100 Subject: [PATCH 10/37] =?UTF-8?q?fix(generator):=20=E2=9C=A8=20disable=20f?= =?UTF-8?q?ield=20generator=20temporarily?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/generator/commands/GeneratorCommand.java | 3 ++- .../modules/generator/components/field/FieldScripts.java | 8 ++++---- .../modules/generator/menu/GeneratorMenu.java | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java b/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java index 33429ede..0a7663a9 100644 --- a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java +++ b/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java @@ -61,7 +61,8 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N // Command Usage: /gen field ... case "field": - GeneratorModule.getInstance().getField().analyzeCommand(p, args); + p.sendMessage(Component.text("This generator have some serious issues and is currently disabled.", NamedTextColor.DARK_RED)); + //GeneratorModule.getInstance().getField().analyzeCommand(p, args); return true; // Command Usage: /gen history diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java index ac0592c3..eb4696c4 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java @@ -1,11 +1,9 @@ package net.buildtheearth.modules.generator.components.field; -import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.generator.model.Flag; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.Script; import net.buildtheearth.modules.generator.utils.GeneratorUtils; -import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -18,8 +16,10 @@ public class FieldScripts extends Script { public FieldScripts(Player player, GeneratorComponent generatorComponent) { super(player, generatorComponent); - - Bukkit.getScheduler().runTaskAsynchronously(BuildTeamTools.getInstance(), this::fieldScript_v_1_0); + + throw new UnsupportedOperationException("FieldScripts are currently broken."); + + //Bukkit.getScheduler().runTaskAsynchronously(BuildTeamTools.getInstance(), this::fieldScript_v_1_0); } public void fieldScript_v_1_0() { diff --git a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java index b8c4dd21..833b8dc2 100644 --- a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java @@ -164,7 +164,9 @@ protected void setPreviewItems() { "§8Left-click to generate", "§8Right-click for Tutorial"); - ItemStack fieldItem = Item.create(XMaterial.WHEAT.parseMaterial(), "§6Generate Field", fieldLore); + fieldLore = ListUtil.createList("", "§cThis §eGenerator §cis currently broken", "§cField Generator is disabled", "", "§8If you want to help fixing ask on Dev Hub!"); + + ItemStack fieldItem = Item.create(XMaterial.WHEAT.get(), "§6Generate Field §c(DISABLED)", fieldLore); // Set navigator item getMenu().getSlot(FIELD_ITEM_SLOT).setItem(fieldItem); From ab1105f0fd304d67ac095ecda91677d43cf1bc23 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sat, 10 Jan 2026 21:59:12 +0100 Subject: [PATCH 11/37] =?UTF-8?q?refactor(generator):=20=E2=9C=A8=20update?= =?UTF-8?q?=20generator=20components=20to=20use=20centralized=20wiki=20lin?= =?UTF-8?q?ks=20and=20improve=20constructor=20parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 30 ++-- .../net/buildtheearth/modules/Module.java | 26 ++-- .../modules/common/CommonModule.java | 50 ++----- .../modules/generator/GeneratorModule.java | 27 ++-- .../generator/commands/GeneratorCommand.java | 10 +- .../generator/components/field/Field.java | 1 - .../components/field/menu/CropStageMenu.java | 79 +++++----- .../components/field/menu/CropTypeMenu.java | 54 ++----- .../generator/components/house/House.java | 3 +- .../generator/components/rail/Rail.java | 9 -- .../generator/components/road/Road.java | 8 - .../generator/components/tree/Tree.java | 8 +- .../modules/generator/menu/GeneratorMenu.java | 140 +++++------------- .../generator/model/GeneratorCollections.java | 39 +++-- .../generator/model/GeneratorComponent.java | 78 ++++------ .../generator/model/GeneratorType.java | 17 ++- .../modules/miscellaneous/MiscModule.java | 17 ++- .../modules/navigation/NavigationModule.java | 3 +- .../modules/network/NetworkModule.java | 5 +- .../modules/plotsystem/PlotSystemModule.java | 19 +-- .../modules/stats/StatsModule.java | 18 +-- .../net/buildtheearth/utils/WikiLinks.java | 37 +++++ src/main/resources/config.yml | 4 +- .../resources/modules/navigation/config.yml | 4 +- 24 files changed, 272 insertions(+), 414 deletions(-) create mode 100644 src/main/java/net/buildtheearth/utils/WikiLinks.java diff --git a/README.md b/README.md index 704f4b04..e40c361b 100644 --- a/README.md +++ b/README.md @@ -78,29 +78,29 @@ The **\*** symbol shows that this feature is still being developed or under main **For more help, please see the [wiki](https://resources.buildtheearth.net/s/btt).** ## Contributors -Thank you to the following developers for contributing towards the plugin: -- **MineFact** -- **frikandelworst** -- **Brigart** -- **v4siv** -- **Adam** -- **Noah Husby** -- **Zoriot** +Thanks to all our contributors for contributing towards the plugin development and improvement! +You find them on the [contributors page](https://github.com/BuildTheEarth/BuildTeamTools/graphs/contributors). +Special thanks to the people currently working on the plugin: + +- **[Zoriot](https://github.com/Zoriot)** +- **[Jasupa](https://github.com/Jasupa)** +- **[frikandelworst](https://github.com/kyanvde)** +- **[MineFact](https://github.com/MineFact)** ## Index Click the links below for more information, or see the [wiki](https://resources.buildtheearth.net/s/btt). +- [Sledgehammer](https://resources.buildtheearth.net/s/btt/doc/sledgehammer-module-T7I0PWPsTD) - [Generators](https://resources.buildtheearth.net/s/btt/doc/generator-module-13zqgI4yFA) - [Houses](https://resources.buildtheearth.net/s/btt/doc/house-generator-YKQunon6Bp) - [Roads](https://resources.buildtheearth.net/s/btt/doc/road-generator-QqKBBP0nqO) - - [Railways](https://resources.buildtheearth.net/s/btt/doc/rail-generator-EfgKXdBvk1) + - [Railways [Currently Broken]](https://resources.buildtheearth.net/s/btt/doc/rail-generator-EfgKXdBvk1) - [Trees](https://resources.buildtheearth.net/s/btt/doc/tree-generator-pnDmYC9hzW) - [Fields](https://resources.buildtheearth.net/s/btt/doc/field-generator-OqIN2BrZT7) -- [Sledgehammer](https://resources.buildtheearth.net/s/btt/doc/sledgehammer-module-T7I0PWPsTD) -- [Statistics](https://resources.buildtheearth.net/s/btt/doc/statistics-module-iM7IfoKroF) (PLANNED) -- [Plot System](https://resources.buildtheearth.net/s/btt/doc/plot-system-module-kkcH00jpcQ) (PLANNED) -- [Tutorials](https://resources.buildtheearth.net/s/btt/doc/tutorials-module-lkc3LaOrql) (PLANNED) -- Miscellaneous (PLANNED) -- [Security](https://resources.buildtheearth.net/s/btt/doc/security-module-iOmxV0djrW) (PLANNED) +- [Statistics](https://resources.buildtheearth.net/s/btt/doc/statistics-module-iM7IfoKroF) +- [Miscellaneous](https://resources.buildtheearth.net/doc/miscellaneous-appUzeNc5I) + - [Block Palette GUI](https://resources.buildtheearth.net/doc/block-palette-gui-hW8InCtxcq) +- Tutorials (PLANNED) +- Plot System (PLANNED - use [PST](https://github.com/AlpsBTE/Plot-System-Terra) for now) diff --git a/src/main/java/net/buildtheearth/modules/Module.java b/src/main/java/net/buildtheearth/modules/Module.java index c3b2f9c7..a056a14c 100644 --- a/src/main/java/net/buildtheearth/modules/Module.java +++ b/src/main/java/net/buildtheearth/modules/Module.java @@ -8,7 +8,6 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.PluginCommand; import org.bukkit.command.TabCompleter; -import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; @@ -20,7 +19,7 @@ /** * An interface for BuildTeamTools modules * - * @authors MineFact, Noah Husby + * @author MineFact, Noah Husby */ public abstract class Module implements WikiDocumented { @@ -53,12 +52,13 @@ public abstract class Module implements WikiDocumented { /** Initializes a new module. * * @param moduleName The name of the module + * @param wikiPage The wiki page of the module * @param dependsOnModules The modules that this module depends on. If any of these modules are disabled, this module will be disabled as well. */ - protected Module(String moduleName, Module... dependsOnModules) { + protected Module(String moduleName, String wikiPage, Module... dependsOnModules) { this.moduleName = moduleName; this.dependsOnModules.addAll(Arrays.asList(dependsOnModules)); - this.wikiPage = "https://github.com/BuildTheEarth/BuildTeamTools/wiki/" + moduleName + "-Module"; + this.wikiPage = wikiPage; registerCommands(); registerListeners(); @@ -114,8 +114,8 @@ protected void registerCommands(){} protected void registerCommand(@NonNull String command, @NonNull CommandExecutor executor){ this.commands.put(BuildTeamTools.getInstance().getCommand(command), executor); - if(executor instanceof TabCompleter) - this.tabCompleter.put(BuildTeamTools.getInstance().getCommand(command), (TabCompleter) executor); + if (executor instanceof TabCompleter tc) + this.tabCompleter.put(BuildTeamTools.getInstance().getCommand(command), tc); } /** Registers a command for the module. @@ -133,11 +133,11 @@ protected void registerCommand(@NonNull String command, @NonNull CommandExecutor /** Loads the commands for the module into Bukkit */ private void loadCommands(){ - for(PluginCommand command : commands.keySet()) - command.setExecutor(commands.get(command)); + for (var command : commands.entrySet()) + command.getKey().setExecutor(command.getValue()); - for(PluginCommand command : tabCompleter.keySet()) - command.setTabCompleter(tabCompleter.get(command)); + for (var command : tabCompleter.entrySet()) + command.getKey().setTabCompleter(command.getValue()); } @@ -174,12 +174,12 @@ private void unregisterListeners(){ protected void checkForModuleDependencies(){ for(Module module : dependsOnModules) if(!module.isEnabled()) { - String error = "The " + module.getModuleName() + " Module is currently disabled."; + String moduleDepsError = "The " + module.getModuleName() + " Module is currently disabled."; if(module.getError() != null && !module.getError().isEmpty()) - error = module.getError(); + moduleDepsError = module.getError(); - shutdown(error); + shutdown(moduleDepsError); return; } } diff --git a/src/main/java/net/buildtheearth/modules/common/CommonModule.java b/src/main/java/net/buildtheearth/modules/common/CommonModule.java index b9e67f6c..ac31e512 100644 --- a/src/main/java/net/buildtheearth/modules/common/CommonModule.java +++ b/src/main/java/net/buildtheearth/modules/common/CommonModule.java @@ -17,6 +17,7 @@ import net.buildtheearth.modules.stats.StatsModule; import net.buildtheearth.modules.stats.model.StatsPlayerType; import net.buildtheearth.modules.stats.model.StatsServerType; +import net.buildtheearth.utils.WikiLinks; import net.buildtheearth.utils.io.ConfigPaths; import net.buildtheearth.utils.io.ConfigUtil; import org.bukkit.Bukkit; @@ -43,7 +44,7 @@ public class CommonModule extends Module { private static CommonModule instance = null; public CommonModule() { - super("Common"); + super("Common", WikiLinks.ENTRY); } public static CommonModule getInstance() { @@ -57,7 +58,7 @@ public void enable() { try { YamlFileFactory.registerPlugin(BuildTeamTools.getInstance()); ConfigUtil.init(); - } catch (ConfigNotImplementedException ex) { + } catch (ConfigNotImplementedException ex) { // Fine? } // Reload the configuration file @@ -86,21 +87,10 @@ public void registerCommands() { @Override public void registerListeners() { - super.registerListeners( - new MenuFunctionListener(), - new CommandListener() - ); - - // The ServerExceptionEvent only exists in Paper not in Spigot - try{ - getListeners().add(new ExceptionListener()); - }catch (Exception ignored){} + super.registerListeners(new MenuFunctionListener(), new CommandListener(), new ExceptionListener()); } - - - /** * The main Timer of the plugin that runs once a second. * It calls the tick() function. @@ -109,20 +99,14 @@ private void startTimer() { Bukkit.getScheduler().scheduleSyncRepeatingTask(BuildTeamTools.getInstance(), () -> { time++; - // Every hour - if (time % (20 * 60 * 60) == 0) { - // Do something - } - // Every 10 minutes (+1 second) - if (time % (NetworkModule.CACHE_UPLOAD_SPEED) == 0) { - if(StatsModule.getInstance().isEnabled()) - StatsModule.getInstance().updateAndSave(); - } + if (time % (NetworkModule.CACHE_UPLOAD_SPEED) == 0 && StatsModule.getInstance().isEnabled()) + StatsModule.getInstance().updateAndSave(); + // Every minute if (time % (20 * 60) == 0) { - if(StatsModule.getInstance().isEnabled()){ + if (StatsModule.getInstance().isEnabled()) { StatsModule.getInstance().getStatsServer().addValue(StatsServerType.UPTIME, 1); for (Player p : Bukkit.getOnlinePlayers()) { @@ -131,23 +115,7 @@ private void startTimer() { } } - if(CommonModule.getInstance().isEnabled()) - ExceptionListener.limiter = false; - } - - // Every 5 seconds - if (time % 100 == 0) { - // Do something - } - - // Every second - if (time % 20 == 0) { - // Do something - } - - // Every 0.25 seconds - if (time % 5 == 0) { - // Do something + if (CommonModule.getInstance().isEnabled()) ExceptionListener.limiter = false; } GeneratorModule.getInstance().tick(); diff --git a/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java b/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java index 6a702a7c..5a739166 100644 --- a/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java +++ b/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java @@ -1,7 +1,6 @@ package net.buildtheearth.modules.generator; import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.WorldEdit; import lombok.Getter; import net.buildtheearth.modules.Module; import net.buildtheearth.modules.common.CommonModule; @@ -16,21 +15,17 @@ import net.buildtheearth.modules.generator.listeners.GeneratorListener; import net.buildtheearth.modules.generator.model.Command; import net.buildtheearth.modules.generator.model.GeneratorCollections; -import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.History; -import net.buildtheearth.modules.navigation.components.navigator.listeners.NavigatorJoinListener; -import net.buildtheearth.modules.navigation.components.navigator.listeners.NavigatorOpenListener; -import net.buildtheearth.modules.navigation.components.tpll.listeners.TpllJoinListener; -import net.buildtheearth.modules.navigation.components.tpll.listeners.TpllListener; -import net.buildtheearth.modules.navigation.components.warps.listeners.WarpJoinListener; +import net.buildtheearth.utils.WikiLinks; import org.bukkit.entity.Player; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; public class GeneratorModule extends Module { - public static String INSTALL_WIKI = "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Installation"; - private final HashMap playerHistory = new HashMap<>(); @Getter @@ -52,7 +47,7 @@ public class GeneratorModule extends Module { private static GeneratorModule instance = null; public GeneratorModule() { - super("Generator"); + super("Generator", WikiLinks.GEN); } public static GeneratorModule getInstance() { @@ -74,11 +69,11 @@ public void enable() { tree = new Tree(); field = new Field(); - GeneratorCollections.GENERATOR_COLLECTIONS_VERSION = GeneratorCollections.getRepositoryReleaseVersionString("BuildTheEarth", "GeneratorCollections"); + GeneratorCollections.generatorCollectionsVersion = GeneratorCollections.getRepositoryReleaseVersionString("BuildTheEarth", "GeneratorCollections"); // In case the version could not be retrieved, set it to 3.0 as a fallback - if(GeneratorCollections.GENERATOR_COLLECTIONS_VERSION == null) - GeneratorCollections.GENERATOR_COLLECTIONS_VERSION = "3.0"; + if (GeneratorCollections.generatorCollectionsVersion == null) + GeneratorCollections.generatorCollectionsVersion = "3.0"; // Check if the GeneratorCollections plugin is installed and up to date GeneratorCollections.checkIfGeneratorCollectionsIsInstalled(null); @@ -110,12 +105,12 @@ public void registerListeners() { * @see Command#tick() */ public void tick() { - if (generatorCommands.size() == 0) + if (generatorCommands.isEmpty()) return; // Tick all commands in the queue for(Command command : new ArrayList<>(generatorCommands)){ - if(command.getOperations().size() == 0){ + if (command.getOperations().isEmpty()) { if(!command.isFinished()) command.finish(); generatorCommands.remove(command); diff --git a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java b/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java index 0a7663a9..98d966ac 100644 --- a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java +++ b/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java @@ -18,13 +18,11 @@ public class GeneratorCommand implements CommandExecutor { public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String cmdLabel, String @NotNull [] args) { - if (!(sender instanceof Player)) { + if (!(sender instanceof Player p)) { sender.sendMessage("§cOnly players can execute this command."); return true; } - Player p = (Player) sender; - if(!p.hasPermission(Permissions.GENERATOR_USE)) { p.sendMessage(ChatHelper.getErrorString("You don't have permission to use this command!")); return true; @@ -87,10 +85,10 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N case "redo": GeneratorModule.getInstance().getPlayerHistory(p).redoCommand(p); return true; + default: + sendHelp(p); + return true; } - - sendHelp(p); - return true; } public static void sendHelp(CommandSender sender) { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java b/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java index 49a20638..66a47dc3 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java @@ -9,7 +9,6 @@ public class Field extends GeneratorComponent { public Field() { super(GeneratorType.FIELD); - wikiPage = "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Field-Command"; } @Override diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java index 2a51d919..a0e4a1db 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java @@ -7,25 +7,28 @@ import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; +import net.buildtheearth.utils.WikiLinks; import net.buildtheearth.utils.menus.AbstractMenu; -import org.bukkit.ChatColor; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; +import org.jspecify.annotations.NonNull; -public class CropStageMenu extends AbstractMenu { +import java.util.ArrayList; - public static String CROP_TYPE_INV_NAME = "Choose a Crop Stage"; +public class CropStageMenu extends AbstractMenu { + private static final String CROP_TYPE_INV_NAME = "Choose a Crop Stage"; private final CropType cropType; - private final byte STAGE_ONE_SLOT = 11; - private final byte STAGE_TWO_SLOT = 15; - - private final int BACK_ITEM_SLOT = 18; + private static final byte STAGE_ONE_SLOT = 11; + private static final byte STAGE_TWO_SLOT = 15; + private static final int BACK_ITEM_SLOT = 18; public CropStageMenu(Player player, CropType cropType) { super(3, CROP_TYPE_INV_NAME, player); @@ -41,23 +44,23 @@ protected void setPreviewItems() { ItemStack itemOne = Item.create(XMaterial.BARRIER.parseMaterial()); ItemStack itemTwo = Item.create(XMaterial.BARRIER.parseMaterial()); + ArrayList typeLore = ListUtil.createList("", "§8Left-click to select", "§8Right-click for more information"); switch (cropType) { case POTATO: - itemOne = new Item(XMaterial.SHORT_GRASS.parseItem()).setDisplayName("§bLow").setLore(ListUtil.createList("", "§8Left-click to select", "§8Right-click for more information")).build(); - itemTwo = new Item(XMaterial.TALL_GRASS.parseItem()).setDisplayName("§bTall").setLore(ListUtil.createList("", "§8Left-click to select", "§8Right-click for more information")).build(); + itemOne = new Item(XMaterial.SHORT_GRASS.parseItem()).setDisplayName("§bLow").setLore(typeLore).build(); + itemTwo = new Item(XMaterial.TALL_GRASS.parseItem()).setDisplayName("§bTall").setLore(typeLore).build(); break; case WHEAT: - itemOne = Item.create(XMaterial.BIRCH_FENCE.parseMaterial(), "§bLight", ListUtil.createList("", "§8Left-click to select", "§8Right-click for more information")); - itemTwo = Item.create(XMaterial.DARK_OAK_FENCE.parseMaterial(), "§bDark", ListUtil.createList("", "§8Left-click to select", "§8Right-click for more information")); + itemOne = Item.create(XMaterial.BIRCH_FENCE.parseMaterial(), "§bLight", typeLore); + itemTwo = Item.create(XMaterial.DARK_OAK_FENCE.parseMaterial(), "§bDark", typeLore); break; case CORN: - itemOne = new Item(XMaterial.SHORT_GRASS.parseItem()).setDisplayName("§bHarvested").setLore(ListUtil.createList("", "§8Left-click to select", "§8Right-click for more information")).build(); - itemTwo = new Item(XMaterial.TALL_GRASS.parseItem()).setDisplayName("§bTall").setLore(ListUtil.createList("", "§8Left-click to select", "§8Right-click for more information")).build(); + itemOne = new Item(XMaterial.SHORT_GRASS.parseItem()).setDisplayName("§bHarvested").setLore(typeLore).build(); + itemTwo = new Item(XMaterial.TALL_GRASS.parseItem()).setDisplayName("§bTall").setLore(typeLore).build(); break; - case HARVESTED: case OTHER: - itemOne = Item.create(XMaterial.DEAD_BUSH.parseMaterial(), "§bDry", ListUtil.createList("", "§8Left-click to select", "§8Right-click for more information")); - itemTwo = Item.create(XMaterial.WATER_BUCKET.parseMaterial(), "§bWet", ListUtil.createList("", "§8Left-click to select", "§8Right-click for more information")); + itemOne = Item.create(XMaterial.DEAD_BUSH.parseMaterial(), "§bDry", typeLore); + itemTwo = Item.create(XMaterial.WATER_BUCKET.parseMaterial(), "§bWet", typeLore); break; } @@ -96,7 +99,6 @@ protected void setItemClickEventsAsync() { case CORN: cropstage = CropStage.HARVESTED; break; - case HARVESTED: case OTHER: cropstage = CropStage.DRY; break; @@ -112,19 +114,12 @@ protected void setItemClickEventsAsync() { } CropStage cropstage = CropStage.FALLBACK; - switch (cropType) { - case POTATO: - case CORN: - cropstage = CropStage.TALL; - break; - case WHEAT: - cropstage = CropStage.DARK; - break; - case HARVESTED: - case OTHER: - cropstage = CropStage.WET; - break; - } + cropstage = switch (cropType) { + case POTATO, CORN -> CropStage.TALL; + case WHEAT -> CropStage.DARK; + case HARVESTED, OTHER -> CropStage.WET; + default -> cropstage; + }; performClickAction(clickPlayer, cropstage); })); @@ -144,22 +139,34 @@ private void performClickAction(Player p, CropStage cropStage) { GeneratorModule.getInstance().getField().generate(p); } - private void sendMoreInformation(Player p, CropType cropType) { + public static void sendMoreInformation(Player p, @NonNull CropType cropType) { switch (cropType) { case POTATO: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#potato-requires-lines"); + p.sendMessage(Component.text(WikiLinks.Gen.Field.CROP_POTATO, NamedTextColor.RED)); break; case CORN: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#corn"); + p.sendMessage(Component.text(WikiLinks.Gen.Field.CROP_CORN, NamedTextColor.RED)); break; case WHEAT: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#wheat"); + p.sendMessage(Component.text(WikiLinks.Gen.Field.CROP_WHEAT, NamedTextColor.RED)); break; case HARVESTED: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#harvested-requires-lines"); + p.sendMessage(Component.text(WikiLinks.Gen.Field.CROP_HARVESTED, NamedTextColor.RED)); break; case OTHER: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#other-requires-lines"); + p.sendMessage(Component.text(WikiLinks.Gen.Field.CROP_OTHER, NamedTextColor.RED)); + break; + case VINEYARD: + p.sendMessage(Component.text(WikiLinks.Gen.Field.CROP_VINEYARD, NamedTextColor.RED)); + break; + case PEAR: + p.sendMessage(Component.text(WikiLinks.Gen.Field.CROP_PEAR, NamedTextColor.RED)); + break; + case CATTLE: + p.sendMessage(Component.text(WikiLinks.Gen.Field.CROP_CATTLE, NamedTextColor.RED)); + break; + case MEADOW: + p.sendMessage(Component.text(WikiLinks.Gen.Field.CROP_MEADOW, NamedTextColor.RED)); break; } diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java index 7d9be6d9..c9aabbcf 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java @@ -11,13 +11,13 @@ import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; -import org.bukkit.ChatColor; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; +import org.jspecify.annotations.NonNull; public class CropTypeMenu extends AbstractMenu { @@ -78,7 +78,7 @@ protected void setItemClickEventsAsync() { // Set click events for the crop type items getMenu().getSlot(POTATO_CROP_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { if (clickInformation.getClickType().equals(ClickType.RIGHT)) { - sendMoreInformation(clickPlayer, CropType.POTATO); + CropStageMenu.sendMoreInformation(clickPlayer, CropType.POTATO); return; } performClickAction(clickPlayer, CropType.POTATO); @@ -86,7 +86,7 @@ protected void setItemClickEventsAsync() { getMenu().getSlot(WHEAT_CROP_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { if (clickInformation.getClickType().equals(ClickType.RIGHT)) { - sendMoreInformation(clickPlayer, CropType.WHEAT); + CropStageMenu.sendMoreInformation(clickPlayer, CropType.WHEAT); return; } performClickAction(clickPlayer, CropType.WHEAT); @@ -94,7 +94,7 @@ protected void setItemClickEventsAsync() { getMenu().getSlot(CORN_CROP_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { if (clickInformation.getClickType().equals(ClickType.RIGHT)) { - sendMoreInformation(clickPlayer, CropType.CORN); + CropStageMenu.sendMoreInformation(clickPlayer, CropType.CORN); return; } performClickAction(clickPlayer, CropType.CORN); @@ -102,7 +102,7 @@ protected void setItemClickEventsAsync() { getMenu().getSlot(VINEYARD_CROP_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { if (clickInformation.getClickType().equals(ClickType.RIGHT)) { - sendMoreInformation(clickPlayer, CropType.VINEYARD); + CropStageMenu.sendMoreInformation(clickPlayer, CropType.VINEYARD); return; } performClickAction(clickPlayer, CropType.VINEYARD); @@ -110,7 +110,7 @@ protected void setItemClickEventsAsync() { getMenu().getSlot(PEAR_CROP_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { if (clickInformation.getClickType().equals(ClickType.RIGHT)) { - sendMoreInformation(clickPlayer, CropType.PEAR); + CropStageMenu.sendMoreInformation(clickPlayer, CropType.PEAR); return; } performClickAction(clickPlayer, CropType.PEAR); @@ -118,7 +118,7 @@ protected void setItemClickEventsAsync() { getMenu().getSlot(CATTLE_CROP_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { if (clickInformation.getClickType().equals(ClickType.RIGHT)) { - sendMoreInformation(clickPlayer, CropType.CATTLE); + CropStageMenu.sendMoreInformation(clickPlayer, CropType.CATTLE); return; } performClickAction(clickPlayer, CropType.CATTLE); @@ -126,7 +126,7 @@ protected void setItemClickEventsAsync() { getMenu().getSlot(MEADOW_CROP_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { if (clickInformation.getClickType().equals(ClickType.RIGHT)) { - sendMoreInformation(clickPlayer, CropType.MEADOW); + CropStageMenu.sendMoreInformation(clickPlayer, CropType.MEADOW); return; } performClickAction(clickPlayer, CropType.MEADOW); @@ -134,7 +134,7 @@ protected void setItemClickEventsAsync() { getMenu().getSlot(HARVESTED_CROP_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { if (clickInformation.getClickType().equals(ClickType.RIGHT)) { - sendMoreInformation(clickPlayer, CropType.HARVESTED); + CropStageMenu.sendMoreInformation(clickPlayer, CropType.HARVESTED); return; } performClickAction(clickPlayer, CropType.HARVESTED); @@ -142,7 +142,7 @@ protected void setItemClickEventsAsync() { getMenu().getSlot(OTHER_CROP_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { if (clickInformation.getClickType().equals(ClickType.RIGHT)) { - sendMoreInformation(clickPlayer, CropType.OTHER); + CropStageMenu.sendMoreInformation(clickPlayer, CropType.OTHER); return; } performClickAction(clickPlayer, CropType.OTHER); @@ -151,7 +151,7 @@ protected void setItemClickEventsAsync() { } - private void performClickAction(Player p, CropType cropType) { + private void performClickAction(@NonNull Player p, CropType cropType) { Settings settings = GeneratorModule.getInstance().getField().getPlayerSettings().get(p.getUniqueId()); if (!(settings instanceof FieldSettings)) @@ -174,38 +174,6 @@ private void performClickAction(Player p, CropType cropType) { GeneratorModule.getInstance().getField().generate(p); } - private void sendMoreInformation(Player p, CropType cropType) { - switch (cropType) { - case POTATO: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#potato-requires-lines"); - break; - case CORN: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#corn"); - break; - case WHEAT: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#wheat"); - break; - case HARVESTED: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#harvested-requires-lines"); - break; - case OTHER: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#other-requires-lines"); - break; - case VINEYARD: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#vineyard-requires-lines"); - break; - case PEAR: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#pear-requires-lines"); - break; - case CATTLE: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#cattle"); - break; - case MEADOW: - p.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Crop-Types#meadow"); - break; - } - } - @Override protected Mask getMask() { return BinaryMask.builder(getMenu()) diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/House.java b/src/main/java/net/buildtheearth/modules/generator/components/house/House.java index a0f1bf24..ab9a84d2 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/House.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/House.java @@ -10,7 +10,6 @@ public class House extends GeneratorComponent { public House() { super(GeneratorType.HOUSE); - wikiPage = "https://github.com/BuildTheEarth/BuildTeamTools/wiki/House-Command"; } @Override @@ -18,7 +17,7 @@ public boolean checkForPlayer(Player p) { if (GeneratorUtils.checkForNoWorldEditSelection(p)) return false; - if (getPlayerSettings().get(p.getUniqueId()).getBlocks() == null) + if (getPlayerSettings().get(p.getUniqueId()).getBlocks() == null) // Needed because block checks are made afterwards getPlayerSettings().get(p.getUniqueId()).setBlocks(GeneratorUtils.analyzeRegion(p, p.getWorld())); Block[][][] blocks = getPlayerSettings().get(p.getUniqueId()).getBlocks(); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java b/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java index c7056f34..a484ec5d 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java @@ -1,29 +1,20 @@ package net.buildtheearth.modules.generator.components.rail; -import com.sk89q.worldedit.regions.ConvexPolyhedralRegion; -import com.sk89q.worldedit.regions.Region; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; import net.buildtheearth.modules.generator.utils.GeneratorUtils; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; public class Rail extends GeneratorComponent { public Rail() { super(GeneratorType.RAILWAY); - - wikiPage = "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Road-Command"; } @Override public boolean checkForPlayer(Player p) { return !GeneratorUtils.checkForNoWorldEditSelection(p); - - /* Only needed if block checks are made afterwards like in House Generator - if (getPlayerSettings().get(p.getUniqueId()).getBlocks() == null) - getPlayerSettings().get(p.getUniqueId()).setBlocks(GeneratorUtils.analyzeRegion(p, p.getWorld()));*/ } @Override diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java b/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java index 50ec00ca..7f73dd01 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java @@ -1,7 +1,5 @@ package net.buildtheearth.modules.generator.components.road; -import com.sk89q.worldedit.regions.ConvexPolyhedralRegion; -import com.sk89q.worldedit.regions.Region; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; @@ -12,17 +10,11 @@ public class Road extends GeneratorComponent { public Road() { super(GeneratorType.ROAD); - - wikiPage = "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Road-Command"; } @Override public boolean checkForPlayer(Player p) { return !GeneratorUtils.checkForNoWorldEditSelection(p); - - /* Only needed if block checks are made afterwards like in House Generator - if (getPlayerSettings().get(p.getUniqueId()).getBlocks() == null) - getPlayerSettings().get(p.getUniqueId()).setBlocks(GeneratorUtils.analyzeRegion(p, p.getWorld()));*/ } @Override diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java index d1474bbc..bd0eda8e 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java @@ -9,13 +9,11 @@ public class Tree extends GeneratorComponent { - public static String TREE_PACK_VERSION = "v2.0"; + public static final String TREE_PACK_VERSION = "v2.0"; public Tree() { super(GeneratorType.TREE); - - wikiPage = "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Tree-Command"; } @Override @@ -23,10 +21,6 @@ public boolean checkForPlayer(Player p) { if (!GeneratorCollections.checkIfGeneratorCollectionsIsInstalled(p)) return false; - /* Only needed if block checks are made afterwards like in House Generator - if (getPlayerSettings().get(p.getUniqueId()).getBlocks() == null) - getPlayerSettings().get(p.getUniqueId()).setBlocks(GeneratorUtils.analyzeRegion(p, p.getWorld()));*/ - return GeneratorUtils.checkIfSchematicBrushIsInstalled(p); } diff --git a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java index 833b8dc2..6c5981b6 100644 --- a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java @@ -3,9 +3,6 @@ import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.common.CommonModule; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.field.Field; -import net.buildtheearth.modules.generator.components.field.FieldSettings; -import net.buildtheearth.modules.generator.components.field.menu.CropTypeMenu; import net.buildtheearth.modules.generator.components.house.House; import net.buildtheearth.modules.generator.components.house.HouseSettings; import net.buildtheearth.modules.generator.components.house.RoofType; @@ -22,13 +19,15 @@ import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; -import org.bukkit.ChatColor; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import org.bukkit.inventory.ItemStack; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; +import org.jspecify.annotations.NonNull; import java.util.ArrayList; @@ -44,7 +43,7 @@ public class GeneratorMenu extends AbstractMenu { public static final int TREE_ITEM_SLOT = 15; - public static int FIELD_ITEM_SLOT = 17; + public static final int FIELD_ITEM_SLOT = 17; public GeneratorMenu(Player player, boolean autoLoad) { @@ -54,38 +53,16 @@ public GeneratorMenu(Player player, boolean autoLoad) { @Override protected void setPreviewItems() { // HOUSE ITEM - ArrayList houseLore = ListUtil.createList("", - "§eDescription:", - "Generate basic building shells", - "with multiple floors, windows and roofs", - "", - "§eFeatures:", - "- " + RoofType.values().length + " Roof Types", - "- Custom Wall, Base and Roof Color", - "- Custom Floor and Window Sizes", - "", - "§8Left-click to generate", - "§8Right-click for Tutorial"); - - ItemStack houseItem = Item.create(XMaterial.BIRCH_DOOR.parseMaterial(), "§cGenerate House", houseLore); + ArrayList houseLore = ListUtil.createList("", "§eDescription:", "Generate basic building shells", "with multiple floors, windows and roofs", "", "§eFeatures:", "- " + RoofType.values().length + " Roof Types", "- Custom Wall, Base and Roof Color", "- Custom Floor and Window Sizes", "", "§8Left-click to generate", "§8Right-click for Tutorial"); + + ItemStack houseItem = Item.create(XMaterial.BIRCH_DOOR.get(), "§cGenerate House", houseLore); // Set navigator item getMenu().getSlot(HOUSE_ITEM_SLOT).setItem(houseItem); // ROAD ITEM - ArrayList roadLore = ListUtil.createList("", - "§eDescription:", - "Generate roads and highways", - "with multiple lanes and sidewalks", - "", - "§eFeatures:", - "- Custom Road Width and Color", - "- Custom Sidewalk Width and Color", - "- Custom Lane Count", - "", - "§8Left-click to generate", - "§8Right-click for Tutorial"); + ArrayList roadLore = ListUtil.createList("", "§eDescription:", "Generate roads and highways", "with multiple lanes and sidewalks", "", "§eFeatures:", "- Custom Road Width and Color", "- Custom Sidewalk Width and Color", "- Custom Lane Count", "", "§8Left-click to generate", "§8Right-click for Tutorial"); ItemStack roadItem = new Item(XMaterial.SMOOTH_STONE_SLAB.parseItem()).setDisplayName("§bGenerate Road").setLore(roadLore).build(); @@ -95,21 +72,11 @@ protected void setPreviewItems() { // RAILWAY ITEM - ArrayList railwayLore = ListUtil.createList("", - "§eDescription:", - "Generate railways with multiple tracks", - "and many different designs", - "", - "§eFeatures:", - "- Custom Railway Width and Color (TODO)", - "- Custom Track Count (TODO)", - "", - "§8Left-click to generate", - "§8Right-click for Tutorial"); + ArrayList railwayLore = ListUtil.createList("", "§eDescription:", "Generate railways with multiple tracks", "and many different designs", "", "§eFeatures:", "- Custom Railway Width and Color (TODO)", "- Custom Track Count (TODO)", "", "§8Left-click to generate", "§8Right-click for Tutorial"); railwayLore = ListUtil.createList("", "§cThis §eGenerator §cis currently broken", "§cRailway Generator is disabled", "", "§8If you want to help fixing ask on Dev Hub!"); - ItemStack railwayItem = Item.create(XMaterial.RAIL.parseMaterial(), "§9Generate Railway §c(DISABLED)", railwayLore); + ItemStack railwayItem = Item.create(XMaterial.RAIL.get(), "§9Generate Railway §c(DISABLED)", railwayLore); // Set navigator item getMenu().getSlot(RAILWAY_ITEM_SLOT).setItem(railwayItem); @@ -119,32 +86,23 @@ protected void setPreviewItems() { // TREE ITEM ArrayList treeLore = ListUtil.createList("", "§cPlugin §eSchematicBrush §cis not installed", "§cTree Generator is disabled", "", "§8Leftclick for Installation Instructions"); - ItemStack treeItem = Item.create(XMaterial.OAK_SAPLING.parseMaterial(), "§aGenerate Tree & Forest §c(DISABLED)", treeLore); + ItemStack treeItem = Item.create(XMaterial.OAK_SAPLING.get(), "§aGenerate Tree & Forest §c(DISABLED)", treeLore); // Set navigator item getMenu().getSlot(TREE_ITEM_SLOT).setItem(treeItem); - }else if(GeneratorCollections.checkIfGeneratorCollectionsIsInstalled(getMenuPlayer())){ + } else if (GeneratorCollections.checkIfGeneratorCollectionsIsInstalled(getMenuPlayer())) { // TREE ITEM ArrayList treeLore = ListUtil.createList("", "§cThe §eTree Pack " + Tree.TREE_PACK_VERSION + " §cis not installed", "§cTree Generator is disabled", "", "§8Leftclick for Installation Instructions"); - ItemStack treeItem = Item.create(XMaterial.OAK_SAPLING.parseMaterial(), "§aGenerate Tree & Forest §c(DISABLED)", treeLore); + ItemStack treeItem = Item.create(XMaterial.OAK_SAPLING.get(), "§aGenerate Tree & Forest §c(DISABLED)", treeLore); // Set navigator item getMenu().getSlot(TREE_ITEM_SLOT).setItem(treeItem); - }else{ + } else { // TREE ITEM - ArrayList treeLore = ListUtil.createList("", - "§eDescription:", - "Generate trees from a set of", - "hundreds of different types", - "", - "§eFeatures:", - "- Custom Tree Type", - "", - "§8Left-click to generate", - "§8Right-click for Tutorial"); - - ItemStack treeItem = Item.create(XMaterial.OAK_SAPLING.parseMaterial(), "§aGenerate Tree & Forest", treeLore); + ArrayList treeLore = ListUtil.createList("", "§eDescription:", "Generate trees from a set of", "hundreds of different types", "", "§eFeatures:", "- Custom Tree Type", "", "§8Left-click to generate", "§8Right-click for Tutorial"); + + ItemStack treeItem = Item.create(XMaterial.OAK_SAPLING.get(), "§aGenerate Tree & Forest", treeLore); // Set navigator item getMenu().getSlot(TREE_ITEM_SLOT).setItem(treeItem); @@ -152,17 +110,7 @@ protected void setPreviewItems() { // FIELD ITEM - ArrayList fieldLore = ListUtil.createList("", - "§eDescription:", - "Generate fields with different", - "crops and plants", - "", - "§eFeatures:", - "- Custom Crop Type", - "- Custom Crop Size", - "", - "§8Left-click to generate", - "§8Right-click for Tutorial"); + ArrayList fieldLore = ListUtil.createList("", "§eDescription:", "Generate fields with different", "crops and plants", "", "§eFeatures:", "- Custom Crop Type", "- Custom Crop Size", "", "§8Left-click to generate", "§8Right-click for Tutorial"); fieldLore = ListUtil.createList("", "§cThis §eGenerator §cis currently broken", "§cField Generator is disabled", "", "§8If you want to help fixing ask on Dev Hub!"); @@ -176,13 +124,15 @@ protected void setPreviewItems() { } @Override - protected void setMenuItemsAsync() {} + protected void setMenuItemsAsync() { + // No Async / DB Items + } @Override protected void setItemClickEventsAsync() { // Set click event for house item getMenu().getSlot(HOUSE_ITEM_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { - if(clickInformation.getClickType().equals(ClickType.RIGHT)) { + if (clickInformation.getClickType().equals(ClickType.RIGHT)) { sendMoreInformation(clickPlayer, GeneratorType.HOUSE); return; } @@ -190,8 +140,7 @@ protected void setItemClickEventsAsync() { House house = GeneratorModule.getInstance().getHouse(); house.getPlayerSettings().put(clickPlayer.getUniqueId(), new HouseSettings(clickPlayer)); - if(!house.checkForPlayer(clickPlayer)) - return; + if (!house.checkForPlayer(clickPlayer)) return; clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); @@ -200,7 +149,7 @@ protected void setItemClickEventsAsync() { // Set click event for road item getMenu().getSlot(ROAD_ITEM_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { - if(clickInformation.getClickType().equals(ClickType.RIGHT)) { + if (clickInformation.getClickType().equals(ClickType.RIGHT)) { sendMoreInformation(clickPlayer, GeneratorType.ROAD); return; } @@ -208,8 +157,7 @@ protected void setItemClickEventsAsync() { Road road = GeneratorModule.getInstance().getRoad(); road.getPlayerSettings().put(clickPlayer.getUniqueId(), new RoadSettings(clickPlayer)); - if(!road.checkForPlayer(clickPlayer)) - return; + if (!road.checkForPlayer(clickPlayer)) return; clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); @@ -218,7 +166,7 @@ protected void setItemClickEventsAsync() { // Set click event for railway item getMenu().getSlot(RAILWAY_ITEM_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { - if(clickInformation.getClickType().equals(ClickType.RIGHT)) { + if (clickInformation.getClickType().equals(ClickType.RIGHT)) { sendMoreInformation(clickPlayer, GeneratorType.RAILWAY); return; } @@ -238,7 +186,7 @@ protected void setItemClickEventsAsync() { // Set click event for tree item getMenu().getSlot(TREE_ITEM_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { - if(clickInformation.getClickType().equals(ClickType.RIGHT)) { + if (clickInformation.getClickType().equals(ClickType.RIGHT)) { sendMoreInformation(clickPlayer, GeneratorType.TREE); return; } @@ -246,8 +194,7 @@ protected void setItemClickEventsAsync() { Tree tree = GeneratorModule.getInstance().getTree(); tree.getPlayerSettings().put(clickPlayer.getUniqueId(), new TreeSettings(clickPlayer)); - if(!tree.checkForPlayer(clickPlayer)) - return; + if (!tree.checkForPlayer(clickPlayer)) return; clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); @@ -256,12 +203,13 @@ protected void setItemClickEventsAsync() { // Set click event for field item getMenu().getSlot(FIELD_ITEM_SLOT).setClickHandler(((clickPlayer, clickInformation) -> { - if(clickInformation.getClickType().equals(ClickType.RIGHT)) { + if (clickInformation.getClickType().equals(ClickType.RIGHT)) { sendMoreInformation(clickPlayer, GeneratorType.FIELD); return; } + sendMoreInformation(clickPlayer, GeneratorType.FIELD); - Field field = GeneratorModule.getInstance().getField(); + /*Field field = GeneratorModule.getInstance().getField(); field.getPlayerSettings().put(clickPlayer.getUniqueId(), new FieldSettings(clickPlayer)); if(!field.checkForPlayer(clickPlayer)) @@ -269,34 +217,16 @@ protected void setItemClickEventsAsync() { clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); - new CropTypeMenu(clickPlayer, true); + new CropTypeMenu(clickPlayer, true);*/ })); } - private void sendMoreInformation(Player clickPlayer, GeneratorType generator) { - switch (generator) { - case FIELD: - clickPlayer.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Field-Command"); - break; - case HOUSE: - clickPlayer.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/House-Command"); - break; - case RAILWAY: - clickPlayer.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Rail-Command"); - break; - case ROAD: - clickPlayer.sendMessage(ChatColor.RED + "https://github.com/BuildTheEarth/BuildTeamTools/wiki/Road-Command"); - break; - } + private void sendMoreInformation(@NonNull Player clickPlayer, @NonNull GeneratorType generator) { + clickPlayer.sendMessage(Component.text(generator.getWikiPage(), NamedTextColor.RED)); } @Override protected Mask getMask() { - return BinaryMask.builder(getMenu()) - .item(MenuItems.ITEM_BACKGROUND) - .pattern("111111111") - .pattern("010101010") - .pattern("111111111") - .build(); + return BinaryMask.builder(getMenu()).item(MenuItems.ITEM_BACKGROUND).pattern("111111111").pattern("010101010").pattern("111111111").build(); } } \ No newline at end of file diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java index 3a894dca..2a331680 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java @@ -6,9 +6,9 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; +import lombok.experimental.UtilityClass; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.utils.ChatHelper; import org.bukkit.Bukkit; import org.bukkit.configuration.file.FileConfiguration; @@ -32,10 +32,10 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +@UtilityClass public class GeneratorCollections { - public static String GENERATOR_COLLECTIONS_VERSION; - + public static String generatorCollectionsVersion; /** * Checks if the GeneratorCollections is installed and sends the player a message if it isn't. @@ -82,7 +82,7 @@ else if(CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled() if(p != null) bukkitWorld = new BukkitWorld(p.getWorld()); else - bukkitWorld = new BukkitWorld(Bukkit.getWorlds().get(0)); + bukkitWorld = new BukkitWorld(Bukkit.getWorlds().getFirst()); if (reader != null){ Class readerClass = reader.getClass(); @@ -130,11 +130,11 @@ else if(CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled() * @param repo The name of the repository * @return The latest release version of the repository */ - public static String getRepositoryReleaseVersionString(String owner, String repo){ + public static @Nullable String getRepositoryReleaseVersionString(String owner, String repo) { try { String url = "https://api.github.com/repos/" + owner + "/" + repo + "/releases"; - HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection(); + HttpURLConnection con = (HttpURLConnection) URI.create(url).toURL().openConnection(); con.setRequestProperty("User-Agent", "Mozilla/5.0"); con.setRequestMethod("GET"); @@ -151,7 +151,7 @@ public static String getRepositoryReleaseVersionString(String owner, String repo in.close(); JSONArray releases = new JSONArray(response.toString()); - if (releases.length() > 0) { + if (!releases.isEmpty()) { JSONObject latestRelease = releases.getJSONObject(0); // The first object in the array is the latest release return latestRelease.getString("tag_name").replace("v", ""); @@ -160,7 +160,7 @@ public static String getRepositoryReleaseVersionString(String owner, String repo } else return null; } catch (Exception e) { - e.printStackTrace(); + BuildTeamTools.getInstance().getComponentLogger().warn("Failed to get latest release version of repository {}/{}:", owner, repo, e); return null; } } @@ -208,7 +208,7 @@ private static boolean installZipFolder(String parentURL, String filename, Path out.write(buffer, 0, bytesRead); } }catch (Exception e){ - e.printStackTrace(); + BuildTeamTools.getInstance().getComponentLogger().warn("Failed to download zip file from {}:", url, e); return false; } } else { @@ -265,7 +265,7 @@ private static boolean unzip(Path zipFilePath, @NonNull Path destDirectory) { deleteFile(zipFilePath); // Delete the old zip file }catch (Exception e){ - e.printStackTrace(); + BuildTeamTools.getInstance().getComponentLogger().warn("Failed to unzip zip file:", e); return false; } @@ -290,10 +290,11 @@ private static void deleteDirectory(@NonNull Path path) { * @param path The path to the file to delete */ private static void deleteFile(@NonNull Path path) { - File file = path.toFile(); - boolean success = file.delete(); - if(!success) - BuildTeamTools.getInstance().getComponentLogger().warn("Failed to delete file: {}", path); + try { + Files.delete(path); + } catch (IOException e) { + BuildTeamTools.getInstance().getComponentLogger().warn("Failed to delete file: {}", path, e); + } } /** @@ -313,7 +314,7 @@ private static boolean checkIfGeneratorCollectionsIsUpToDate(Player p){ String oldVersion = cfg.getString("version"); - if(!CommonModule.getInstance().getUpdaterComponent().shouldUpdate(GENERATOR_COLLECTIONS_VERSION, oldVersion)) + if (!CommonModule.getInstance().getUpdaterComponent().shouldUpdate(generatorCollectionsVersion, oldVersion)) return true; else return installGeneratorCollections(p, true); @@ -331,11 +332,7 @@ private static boolean checkIfGeneratorCollectionsIsUpToDate(Player p){ * @param p The player to send the message to */ private static void sendGeneratorCollectionsError(@Nullable Player p){ - ChatHelper.logPlayerAndConsole(p, "§cAn error occurred while installing the Generator Collections.", Level.INFO); - ChatHelper.logPlayerAndConsole(p, "§cPlease install the Generator Collections v" + GENERATOR_COLLECTIONS_VERSION + " to use this tool. You can ask the server administrator to install it.", Level.INFO); - ChatHelper.logPlayerAndConsole(p, " ", Level.INFO); - ChatHelper.logPlayerAndConsole(p, "§cFor more installation help, please see the wiki:", Level.INFO); - ChatHelper.logPlayerAndConsole(p, "§c" + GeneratorModule.INSTALL_WIKI, Level.INFO); + ChatHelper.logPlayerAndConsole(p, "§cAn error occurred while installing the Generator Collections. Please report that with the log!", Level.INFO); } @@ -371,7 +368,7 @@ else if(CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled() success = moveVersionFile(generatorModulePath, path.resolve("GeneratorCollections"), "config.yml", "generatorCollectionsVersion.yml"); if(success) { - ChatHelper.logPlayerAndConsole(p, "§7Successfully installed §eGenerator Collections v" + GENERATOR_COLLECTIONS_VERSION + "§7!", Level.INFO); + ChatHelper.logPlayerAndConsole(p, "§7Successfully installed §eGenerator Collections v" + generatorCollectionsVersion + "§7!", Level.INFO); return true; }else { diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java index 9c84694b..7c66078d 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java @@ -19,22 +19,19 @@ import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import org.bukkit.Sound; import org.bukkit.entity.Player; +import org.jspecify.annotations.NonNull; import java.util.HashMap; import java.util.UUID; public abstract class GeneratorComponent extends ModuleComponent implements WikiDocumented { - - @Getter - public String wikiPage; - @Getter private final GeneratorType generatorType; @Getter private final HashMap playerSettings = new HashMap<>(); - public GeneratorComponent(GeneratorType type) { + protected GeneratorComponent(@NonNull GeneratorType type) { super(type.getName()); generatorType = type; } @@ -75,50 +72,40 @@ public void addPlayerSetting(Player p){ } } - public void sendHelp(Player p, String[] args){ - if (args.length == 2) - if (args[1].equals("info") || args[1].equals("help") || args[1].equals("?")) + public void sendHelp(Player p, String @NonNull [] args) { + if (args.length == 2 && (args[1].equals("info") || args[1].equals("help") || args[1].equals("?"))) sendHelp(p); } - public void sendHelp(Player p){ - //TODO send houses help - p.sendMessage("TODO send Houses Help"); + public void sendHelp(@NonNull Player p) { + p.sendMessage(Component.text(getWikiPage(), NamedTextColor.YELLOW)); } public void sendMoreInfo(Player p) { p.sendMessage(" "); p.sendMessage("§cFor more information take a look at the wiki:"); - p.sendMessage("§c" + wikiPage); + p.sendMessage("§c" + getWikiPage()); } public void sendError(Player p) { p.sendMessage("§cThere was an error while generating the house. Please contact the admins"); } - public String getCommand(Player p) { + public String getCommand(@NonNull Player p) { HashMap flags = getPlayerSettings().get(p.getUniqueId()).getValuesAsString(); - String type = "house"; - - switch (generatorType) { - case HOUSE: - type = "house"; - break; - case ROAD: - type = "road"; - break; - case RAILWAY: - type = "railway"; - break; - case TREE: - type = "tree"; - break; - } + String type = switch (generatorType) { + case HOUSE -> "house"; + case ROAD -> "road"; + case RAILWAY -> "railway"; + case TREE -> "tree"; + case FIELD -> "field"; + }; StringBuilder command = new StringBuilder("/gen " + type); - for(Flag flag : flags.keySet()) - command.append(" -").append(flag.getFlag()).append(" ").append(flags.get(flag)); + + for (var flag : flags.entrySet()) + command.append(" -").append(flag.getKey().getFlag()).append(" ").append(flag.getValue()); return command.toString(); } @@ -138,23 +125,14 @@ public void sendSuccessMessage(Player p){ p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1.0F, 1.0F); } - private TextComponent getMessage() { - String type = "Building"; - - switch (generatorType){ - case HOUSE: - type = "House"; - break; - case ROAD: - type = "Road"; - break; - case RAILWAY: - type = "Railway"; - break; - case TREE: - type = "Tree"; - break; - } + private @NonNull TextComponent getMessage() { + String type = switch (generatorType) { + case HOUSE -> "House"; + case ROAD -> "Road"; + case RAILWAY -> "Railway"; + case TREE -> "Tree"; + case FIELD -> "Field"; + }; return LegacyComponentSerializer.legacyAmpersand().deserialize(BuildTeamTools.PREFIX + type + "§a successfully §7generated."); } @@ -195,4 +173,8 @@ protected void convertArgsToSettings(Player p, String[] args){ if(getPlayerSettings().get(p.getUniqueId()).getValues().isEmpty() && args.length > 1) sendHelp(p); } + + public String getWikiPage() { + return generatorType.getWikiPage(); + } } diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorType.java b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorType.java index 0321ca98..1e00d64b 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorType.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorType.java @@ -1,20 +1,25 @@ package net.buildtheearth.modules.generator.model; import lombok.Getter; +import net.buildtheearth.utils.WikiLinks; public enum GeneratorType { - HOUSE("House"), - ROAD("Road"), - RAILWAY("Railway"), - TREE("Tree"), - FIELD("Field"); + HOUSE("House", WikiLinks.Gen.HOUSE), + ROAD("Road", WikiLinks.Gen.ROAD), + RAILWAY("Railway", WikiLinks.Gen.RAIL), + TREE("Tree", WikiLinks.Gen.TREE), + FIELD("Field", WikiLinks.Gen.FIELD); @Getter private final String name; - GeneratorType(String name) { + @Getter + private final String wikiPage; + + GeneratorType(String name, String wikiPage) { this.name = name; + this.wikiPage = wikiPage; } } diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/MiscModule.java b/src/main/java/net/buildtheearth/modules/miscellaneous/MiscModule.java index a2af3b9a..4c7b77b1 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/MiscModule.java +++ b/src/main/java/net/buildtheearth/modules/miscellaneous/MiscModule.java @@ -1,13 +1,15 @@ package net.buildtheearth.modules.miscellaneous; import net.buildtheearth.modules.Module; +import net.buildtheearth.modules.miscellaneous.blockpalettegui.BlockPaletteCommand; import net.buildtheearth.modules.miscellaneous.blockpalettegui.BlockPaletteGUI; import net.buildtheearth.modules.miscellaneous.blockpalettegui.BlockPaletteManager; -import net.buildtheearth.modules.miscellaneous.blockpalettegui.BlockPaletteCommand; +import net.buildtheearth.utils.WikiLinks; import org.bukkit.command.CommandExecutor; import org.bukkit.command.PluginCommand; import org.bukkit.command.TabCompleter; import org.bukkit.plugin.java.JavaPlugin; +import org.jspecify.annotations.NonNull; import java.lang.reflect.Constructor; @@ -17,7 +19,7 @@ public class MiscModule extends Module { private static MiscModule instance = null; public MiscModule() { - super("Misc"); + super("Misc", WikiLinks.MISC); } public static MiscModule getInstance() { @@ -50,17 +52,18 @@ public void disable() { @Override public void registerListeners() { + // No Listeners } - private JavaPlugin resolvePlugin() { + private @NonNull JavaPlugin resolvePlugin() { try { return JavaPlugin.getProvidingPlugin(MiscModule.class); - } catch (Throwable t) { + } catch (Exception t) { throw new IllegalStateException("Cannot resolve JavaPlugin for MiscModule", t); } } - private void registerCommandSafely(JavaPlugin plugin, String name, BlockPaletteManager manager) { + private void registerCommandSafely(@NonNull JavaPlugin plugin, String name, BlockPaletteManager manager) { PluginCommand cmd = plugin.getCommand(name); if (cmd == null) { return; @@ -71,7 +74,7 @@ private void registerCommandSafely(JavaPlugin plugin, String name, BlockPaletteM if (obj instanceof TabCompleter tab) cmd.setTabCompleter(tab); } - private Object createCommandInstance(BlockPaletteManager manager, JavaPlugin plugin) { + private @NonNull Object createCommandInstance(BlockPaletteManager manager, JavaPlugin plugin) { try { Class c = BlockPaletteCommand.class; Constructor k; @@ -92,7 +95,7 @@ private Object createCommandInstance(BlockPaletteManager manager, JavaPlugin plu } catch (NoSuchMethodException ignored) {} return c.getDeclaredConstructor().newInstance(); - } catch (Throwable t) { + } catch (Exception t) { throw new RuntimeException("Cannot construct BlockPaletteCommand", t); } } diff --git a/src/main/java/net/buildtheearth/modules/navigation/NavigationModule.java b/src/main/java/net/buildtheearth/modules/navigation/NavigationModule.java index e903e0da..79f8f36b 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/NavigationModule.java +++ b/src/main/java/net/buildtheearth/modules/navigation/NavigationModule.java @@ -15,6 +15,7 @@ import net.buildtheearth.modules.navigation.components.warps.commands.WarpsBtCommand; import net.buildtheearth.modules.navigation.components.warps.listeners.WarpJoinListener; import net.buildtheearth.modules.network.NetworkModule; +import net.buildtheearth.utils.WikiLinks; /** * Manages all things related to universal tpll @@ -33,7 +34,7 @@ public class NavigationModule extends Module { private static NavigationModule instance = null; public NavigationModule() { - super("Navigation", NetworkModule.getInstance()); + super("Navigation", WikiLinks.NAV, NetworkModule.getInstance()); } public static NavigationModule getInstance() { diff --git a/src/main/java/net/buildtheearth/modules/network/NetworkModule.java b/src/main/java/net/buildtheearth/modules/network/NetworkModule.java index 355dc8a0..ac75a8a4 100644 --- a/src/main/java/net/buildtheearth/modules/network/NetworkModule.java +++ b/src/main/java/net/buildtheearth/modules/network/NetworkModule.java @@ -12,6 +12,7 @@ import net.buildtheearth.modules.network.model.BuildTeam; import net.buildtheearth.modules.network.model.Region; import net.buildtheearth.modules.network.model.RegionType; +import net.buildtheearth.utils.WikiLinks; import net.buildtheearth.utils.io.ConfigPaths; import net.buildtheearth.utils.io.Constants; import net.buildtheearth.utils.io.Errors; @@ -51,7 +52,7 @@ public class NetworkModule extends Module { private static NetworkModule instance = null; public NetworkModule() { - super("Network"); + super("Network", WikiLinks.ENTRY); } public static NetworkModule getInstance() { @@ -130,7 +131,7 @@ public void ping(Player p) { ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeUTF("Ping"); out.writeUTF(p.getUniqueId().toString()); - out.writeUTF("Version: " + BuildTeamTools.getInstance().getDescription().getVersion()); + out.writeUTF("Version: " + BuildTeamTools.getInstance().getPluginMeta().getVersion()); p.sendPluginMessage(BuildTeamTools.getInstance(), "btt:buildteam", out.toByteArray()); } diff --git a/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java b/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java index c84c2664..ad38318b 100644 --- a/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java +++ b/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java @@ -1,15 +1,8 @@ package net.buildtheearth.modules.plotsystem; - -/*import com.alpsbte.alpslib.libpsterra.core.Connection; -import com.alpsbte.alpslib.libpsterra.core.PSTerraSetup; -import com.alpsbte.alpslib.libpsterra.core.config.ConfigManager; -import com.alpsbte.alpslib.libpsterra.core.config.PSInitializer; -import com.alpsbte.alpslib.libpsterra.core.plotsystem.PlotCreator; -import com.alpsbte.alpslib.libpsterra.core.plotsystem.PlotPaster;*/ - import net.buildtheearth.modules.Module; import net.buildtheearth.modules.plotsystem.commands.PlotSystemTerraCommand; +import net.buildtheearth.utils.WikiLinks; public class PlotSystemModule extends Module { @@ -17,19 +10,19 @@ public class PlotSystemModule extends Module { private static PlotSystemModule instance = null; /* private ConfigManager configManager; - private PlotPaster plotPaster;*/ + private PlotPaster plotPaster; private boolean pluginEnabled = false; public String version; public String newVersion; public boolean updateInstalled = false; -/* + private Connection connection; private PlotCreator plotCreator;*/ public PlotSystemModule() { - super("PlotSystem"); + super("PlotSystem", WikiLinks.PLOT); } public static PlotSystemModule getInstance() { @@ -128,7 +121,9 @@ public void registerCommands() { } @Override - public void registerListeners() {} + public void registerListeners() { + // No Listeners + } } diff --git a/src/main/java/net/buildtheearth/modules/stats/StatsModule.java b/src/main/java/net/buildtheearth/modules/stats/StatsModule.java index 9b505666..d8257ff4 100644 --- a/src/main/java/net/buildtheearth/modules/stats/StatsModule.java +++ b/src/main/java/net/buildtheearth/modules/stats/StatsModule.java @@ -2,12 +2,14 @@ import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; +import lombok.Getter; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.Module; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.stats.listeners.StatsListener; import net.buildtheearth.modules.stats.model.StatsPlayer; import net.buildtheearth.modules.stats.model.StatsServer; +import net.buildtheearth.utils.WikiLinks; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.json.JSONArray; @@ -19,8 +21,9 @@ public class StatsModule extends Module { - public static int RATE_LIMIT = NetworkModule.CACHE_UPLOAD_SPEED / 20; + public static final int RATE_LIMIT = NetworkModule.CACHE_UPLOAD_SPEED / 20; + @Getter private StatsServer statsServer; private HashMap statsPlayerList; @@ -29,7 +32,7 @@ public class StatsModule extends Module { private static StatsModule instance = null; public StatsModule() { - super("Stats"); + super("Stats", WikiLinks.STATS); } public static StatsModule getInstance() { @@ -71,13 +74,6 @@ public void registerListeners() { super.registerListeners(new StatsListener()); } - - - - public StatsServer getStatsServer() { - return statsServer; - } - public StatsPlayer getStatsPlayer(UUID uuid) { if (statsPlayerList.get(uuid) == null) addStatsPlayer(uuid); @@ -133,8 +129,8 @@ public JSONObject getCurrentCache() { //Player Stats JSONArray jsonArray = new JSONArray(); - for (UUID uuid : statsPlayerList.keySet()) - jsonArray.put(statsPlayerList.get(uuid).toJSON()); + for (StatsPlayer statsPlayer : statsPlayerList.values()) + jsonArray.put(statsPlayer.toJSON()); jsonObject.put("PLAYERS", jsonArray); return jsonObject; diff --git a/src/main/java/net/buildtheearth/utils/WikiLinks.java b/src/main/java/net/buildtheearth/utils/WikiLinks.java new file mode 100644 index 00000000..dc6a83a3 --- /dev/null +++ b/src/main/java/net/buildtheearth/utils/WikiLinks.java @@ -0,0 +1,37 @@ +package net.buildtheearth.utils; + +import lombok.experimental.UtilityClass; + +@UtilityClass +public class WikiLinks { + private static final String WIKI_BASE_URL = "https://resources.buildtheearth.net/doc/"; + public static final String ENTRY = WIKI_BASE_URL + "build-team-tools-gwhwx9xRsX"; + public static final String GEN = WIKI_BASE_URL + "generator-module-13zqgI4yFA"; + public static final String NAV = WIKI_BASE_URL + "sledgehammer-module-T7I0PWPsTD"; + public static final String MISC = WIKI_BASE_URL + "miscellaneous-appUzeNc5I"; + public static final String STATS = WIKI_BASE_URL + "statistics-module-iM7IfoKroF"; + public static final String PLOT = "https://github.com/AlpsBTE/Plot-System/wiki/Installation#setting-up-the-terra-servers"; + + @UtilityClass + public static class Gen { + public static final String RAIL = WIKI_BASE_URL + "rail-generator-EfgKXdBvk1"; + public static final String ROAD = WIKI_BASE_URL + "road-generator-QqKBBP0nqO"; + public static final String TREE = WIKI_BASE_URL + "tree-generator-pnDmYC9hzW"; + public static final String HOUSE = WIKI_BASE_URL + "house-generator-YKQunon6Bp"; + public static final String FIELD = WIKI_BASE_URL + "field-generator-OqIN2BrZT7"; + + @UtilityClass + public static class Field { + private static final String CROP_BASE = WIKI_BASE_URL + "crop-types-z7ww6RZK2J"; + public static final String CROP_POTATO = CROP_BASE + "#h-potato-field"; + public static final String CROP_CORN = CROP_BASE + "#h-corn-field"; + public static final String CROP_WHEAT = CROP_BASE + "#h-wheat-field"; + public static final String CROP_HARVESTED = CROP_BASE + "#h-harvested-field"; + public static final String CROP_OTHER = CROP_BASE + "#h-other"; + public static final String CROP_VINEYARD = CROP_BASE + "#h-vineyard-field"; + public static final String CROP_PEAR = CROP_BASE + "#h-pear-field"; + public static final String CROP_CATTLE = CROP_BASE + "#h-cattle"; + public static final String CROP_MEADOW = CROP_BASE + "#h-meadow"; + } + } +} diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 8d7e53a4..3fc73a47 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -2,8 +2,8 @@ # | BuildTeamTools - by BuildTheEarth # ---------------------------------------------------------------------------------------------- # | [Github Repo] https://github.com/BuildTheEarth/BuildTeamTools -# | [Config Documentation] https://github.com/BuildTheEarth/BuildTeamTools/wiki/Configuration -# | [Contacts - Discord] BuildTheEarth Staff Discord, @minefact +# | [Config Documentation] https://resources.buildtheearth.net/doc/configuration-tpEHSZ6Zt2#h-general-configuration +# | [Contacts - Discord] BTE Development Hub, @zoriot # ---------------------------------------------------------------------------------------------- # The Build Team API Key used to fetch build team info for display. diff --git a/src/main/resources/modules/navigation/config.yml b/src/main/resources/modules/navigation/config.yml index dd644f89..6bbb5662 100644 --- a/src/main/resources/modules/navigation/config.yml +++ b/src/main/resources/modules/navigation/config.yml @@ -4,8 +4,8 @@ # | The navigator module allows the player to navigate through the project # ---------------------------------------------------------------------------------------------- # | [Github Repo] https://github.com/BuildTheEarth/BuildTeamTools -# | [Config Documentation] https://github.com/BuildTheEarth/BuildTeamTools/wiki/Configuration -# | [Contacts - Discord] BuildTheEarth Staff Discord, @minefact +# | [Config Documentation] https://resources.buildtheearth.net/doc/configuration-tpEHSZ6Zt2#h-navigation +# | [Contacts - Discord] BTE Development Hub, @zoriot # ---------------------------------------------------------------------------------------------- # Configures the navigator item in the players hotbar From bc32c9b53299343c9d7463d47dde11b344375cc1 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sun, 11 Jan 2026 16:41:17 +0100 Subject: [PATCH 12/37] =?UTF-8?q?refactor(tree):=20=E2=9C=A8=20update=20tr?= =?UTF-8?q?ee=20component=20logic=20and=20improve=20menu=20interactions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 1 - gradle/libs.versions.toml | 4 +- .../dependency/DependencyComponent.java | 37 +---- .../modules/generator/GeneratorModule.java | 4 +- .../generator/components/tree/Tree.java | 31 +++- .../generator/components/tree/TreeFlag.java | 20 ++- .../components/tree/TreeScripts.java | 66 +++------ .../generator/components/tree/TreeType.java | 9 ++ .../generator/components/tree/TreeWidth.java | 9 ++ .../components/tree/menu/TreeHeightMenu.java | 62 ++++++++ .../components/tree/menu/TreeTypeMenu.java | 30 ++-- .../components/tree/menu/TreeWidthMenu.java | 31 ++-- .../modules/generator/menu/GeneratorMenu.java | 2 +- .../modules/generator/model/Flag.java | 24 ++-- .../modules/generator/model/FlagType.java | 4 +- .../generator/model/GeneratorCollections.java | 4 +- .../utils/menus/NameListMenu.java | 133 ++++++++++++++++++ 17 files changed, 320 insertions(+), 151 deletions(-) create mode 100644 src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java create mode 100644 src/main/java/net/buildtheearth/utils/menus/NameListMenu.java diff --git a/build.gradle.kts b/build.gradle.kts index 7ac88f94..c9a1b3a3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -74,7 +74,6 @@ dependencies { implementation(libs.micycle.clipper2) implementation(libs.org.json.json) implementation(libs.com.google.code.gson.gson) - implementation(libs.com.google.guava.guava) implementation(libs.com.squareup.okhttp3.okhttp.jvm) implementation(libs.javaapiforkml) { exclude(group = "com.sun.xml.bind", module = "jaxb-xjc") // Else Remapping will yell of duplicated classes diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4c86f938..1004ecaa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,9 +6,8 @@ com-alpsbte-alpslib-alpslib-libpsterra = "1.1.3" com-alpsbte-canvas = "1.3" com-fastasyncworldedit-fastasyncworldedit-bukkit = "2.12.3" com-fastasyncworldedit-fastasyncworldedit-core = "2.12.3" -com-github-cryptomorin-xseries = "13.6.0" +com-github-cryptomorin-xseries = "13.6.0" # https://github.com/CryptoMorin/XSeries/releases com-google-code-gson-gson = "2.13.1" -com-google-guava-guava = "33.4.8-jre" com-mojang-authlib = "7.0.61" com-squareup-okhttp3-okhttp-jvm = "5.1.0" javaapiforkml = "3.0.10" # https://github.com/urbancamo/javaapiforkml @@ -31,7 +30,6 @@ com-fastasyncworldedit-fastasyncworldedit-bukkit = { module = "com.fastasyncworl com-fastasyncworldedit-fastasyncworldedit-core = { module = "com.fastasyncworldedit:FastAsyncWorldEdit-Core", version.ref = "com-fastasyncworldedit-fastasyncworldedit-core" } com-github-cryptomorin-xseries = { module = "com.github.cryptomorin:XSeries", version.ref = "com-github-cryptomorin-xseries" } com-google-code-gson-gson = { module = "com.google.code.gson:gson", version.ref = "com-google-code-gson-gson" } -com-google-guava-guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" } com-mojang-authlib = { module = "com.mojang:authlib", version.ref = "com-mojang-authlib" } com-squareup-okhttp3-okhttp-jvm = { module = "com.squareup.okhttp3:okhttp-jvm", version.ref = "com-squareup-okhttp3-okhttp-jvm" } javaapiforkml = { module = "uk.m0nom:javaapiforkml", version.ref = "javaapiforkml" } diff --git a/src/main/java/net/buildtheearth/modules/common/components/dependency/DependencyComponent.java b/src/main/java/net/buildtheearth/modules/common/components/dependency/DependencyComponent.java index 1f216d9e..09a70b8e 100644 --- a/src/main/java/net/buildtheearth/modules/common/components/dependency/DependencyComponent.java +++ b/src/main/java/net/buildtheearth/modules/common/components/dependency/DependencyComponent.java @@ -4,6 +4,8 @@ import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.ModuleComponent; +import java.util.Objects; + /** * This class handles checking if the required dependencies for certain features are present */ @@ -31,42 +33,13 @@ public boolean isLegacyWorldEdit(){ if(!isWorldEditEnabled()) return false; - String version = BuildTeamTools.getInstance().getServer().getPluginManager().getPlugin("WorldEdit").getDescription().getVersion(); + String version = Objects.requireNonNull(BuildTeamTools.getInstance().getServer().getPluginManager() + .getPlugin("WorldEdit"), "World Edit was not found!").getPluginMeta().getVersion(); int major = Integer.parseInt(version.split("\\.")[0]); return major < 7; } - /** - * Checks if the server is running on a Paper-based server. - * - * @return True if the server is running on a Paper-based server, false if it is not - */ - public boolean isPaper(){ - try { - // Try to load a Paper-specific class - Class.forName("com.destroystokyo.paper.PaperConfig"); - return true; - } catch (ClassNotFoundException e) { - return false; - } - } - - /** - * Checks if the server is running on a Spigot-based server. - * - * @return True if the server is running on a Spigot-based server, false if it is not - */ - public boolean isSpigot(){ - try { - // Try to load a Spigot-specific class - Class.forName("org.spigotmc.SpigotConfig"); - return true; - } catch (ClassNotFoundException e) { - return false; - } - } - /** * Checks if the plugin "FastAsyncWorldEdit" is enabled. * @@ -82,7 +55,7 @@ public boolean isFastAsyncWorldEditEnabled() { * @return True if SchematicBrush is enabled, false if it is not enabled */ public boolean isSchematicBrushEnabled() { - return BuildTeamTools.getInstance().getServer().getPluginManager().isPluginEnabled("SchematicBrush"); + return BuildTeamTools.getInstance().getServer().getPluginManager().isPluginEnabled("SchematicBrushReborn"); } /** diff --git a/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java b/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java index 5a739166..ec1887de 100644 --- a/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java +++ b/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java @@ -42,8 +42,6 @@ public class GeneratorModule extends Module { @Getter private Field field; - - private static GeneratorModule instance = null; public GeneratorModule() { @@ -76,7 +74,7 @@ public void enable() { GeneratorCollections.generatorCollectionsVersion = "3.0"; // Check if the GeneratorCollections plugin is installed and up to date - GeneratorCollections.checkIfGeneratorCollectionsIsInstalled(null); + GeneratorCollections.hasUpdatedGeneratorCollections(null); LocalSession.MAX_HISTORY_SIZE = 500; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java index bd0eda8e..d353739d 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java @@ -1,24 +1,47 @@ package net.buildtheearth.modules.generator.components.tree; -import net.buildtheearth.modules.generator.GeneratorModule; +import lombok.Getter; +import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.generator.model.GeneratorCollections; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; import net.buildtheearth.modules.generator.utils.GeneratorUtils; +import org.bukkit.Bukkit; import org.bukkit.entity.Player; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashSet; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + public class Tree extends GeneratorComponent { public static final String TREE_PACK_VERSION = "v2.0"; - + @Getter + private Set heights = new HashSet<>(); public Tree() { super(GeneratorType.TREE); + Bukkit.getScheduler().runTaskAsynchronously(BuildTeamTools.getInstance(), () -> { + Path basePath = Path.of(GeneratorUtils.getWorldEditSchematicsFolderPath(), "GeneratorCollections", "treepack"); + try (Stream paths = Files.walk(basePath, 2)) { + heights = paths + .filter(p -> basePath.relativize(p).getNameCount() == 2) + .filter(Files::isDirectory) + .map(p -> p.getFileName().toString()) + .collect(Collectors.toSet()); + } catch (IOException e) { + BuildTeamTools.getInstance().getComponentLogger().warn("Failed to load tree pack heights:", e); + } + }); } @Override public boolean checkForPlayer(Player p) { - if (!GeneratorCollections.checkIfGeneratorCollectionsIsInstalled(p)) + if (!GeneratorCollections.hasUpdatedGeneratorCollections(p)) return false; return GeneratorUtils.checkIfSchematicBrushIsInstalled(p); @@ -26,7 +49,7 @@ public boolean checkForPlayer(Player p) { @Override public void generate(Player p) { - if (!GeneratorModule.getInstance().getRoad().checkForPlayer(p)) + if (!checkForPlayer(p)) return; TreeScripts.treescript_v_1_0(p, this); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeFlag.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeFlag.java index bece460a..85fd4de9 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeFlag.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeFlag.java @@ -1,15 +1,20 @@ package net.buildtheearth.modules.generator.components.tree; -import net.buildtheearth.modules.generator.model.FlagType; +import lombok.Getter; import net.buildtheearth.modules.generator.model.Flag; +import net.buildtheearth.modules.generator.model.FlagType; +import org.jspecify.annotations.Nullable; public enum TreeFlag implements Flag { TYPE("t", FlagType.TREE_TYPE), WIDTH("w", FlagType.TREE_WIDTH), - HEIGHT("h", FlagType.INTEGER); + HEIGHT("h", FlagType.STRING); + @Getter private final String flag; + + @Getter private final FlagType flagType; TreeFlag(String flag, FlagType flagType){ @@ -17,16 +22,7 @@ public enum TreeFlag implements Flag { this.flagType = flagType; } - public String getFlag() { - return flag; - } - - @Override - public FlagType getFlagType() { - return null; - } - - public static TreeFlag byString(String flag){ + public static @Nullable TreeFlag byString(String flag) { for(TreeFlag treeFlag : TreeFlag.values()) if(treeFlag.getFlag().equalsIgnoreCase(flag)) return treeFlag; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java index e6c2dfe4..889d7b77 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java @@ -5,59 +5,31 @@ import net.buildtheearth.utils.Item; import org.bukkit.Material; import org.bukkit.entity.Player; +import org.jspecify.annotations.NonNull; public class TreeScripts { - public static void treescript_v_1_0(Player p, Tree tree) { - String[] args = new String[4]; - + public static void treescript_v_1_0(@NonNull Player p, @NonNull Tree tree) { Settings settings = tree.getPlayerSettings().get(p.getUniqueId()); - args[1] = (String) settings.getValues().get(TreeFlag.TYPE); - args[2] = (String) settings.getValues().get(TreeFlag.HEIGHT); - args[3] = (String) settings.getValues().get(TreeFlag.WIDTH); - + TreeType treeType = (TreeType) settings.getValues().get(TreeFlag.TYPE); + if (treeType == null) treeType = TreeType.ANY; + String height = String.valueOf(settings.getValues().get(TreeFlag.HEIGHT)); + TreeWidth treeWidth = (TreeWidth) settings.getValues().get(TreeFlag.WIDTH); + if (treeWidth == null) treeWidth = TreeWidth.ANY; // In case the player is holding no item, give him a diamond sword - if(p.getItemOnCursor() == null || p.getInventory().getItemInMainHand().getType() == Material.AIR) - p.getInventory().setItem(p.getInventory().getHeldItemSlot(), Item.create(XMaterial.DIAMOND_SWORD.parseMaterial())); - - - if(args.length == 1) { - p.chat("//schbr newtrees/*@** -place:bottom -yoff:2"); - - }else if(args.length >= 2) { - String type = args[1]; - - if(args.length == 2) { - if(type.equalsIgnoreCase("any")) - p.chat("//schbr newtrees/*@** -place:bottom -yoff:2"); - else - p.chat("//schbr newtrees/" + type + "*@** -place:bottom -yoff:2"); - - }else if(args.length == 3) { - String scale = args[2]; - - if(type.equalsIgnoreCase("any")) - p.chat("//schbr newtrees/*/" + scale + "/*@** -place:bottom -yoff:2"); - else - p.chat("//schbr newtrees/"+ type + "/" + scale + "/*@** -place:bottom -yoff:2"); - - }else if(args.length == 4) { - String scale = args[2]; - String option = args[3]; - - if(type.equalsIgnoreCase("any")) { - if(scale.equalsIgnoreCase("any")) - p.chat("//schbr newtrees/*/*/*"+ option +"/*@** -place:bottom -yoff:2"); - else - p.chat("//schbr newtrees/*/" + scale + "/*" + option + "/*@** -place:bottom -yoff:2"); - } else { - if(scale.equalsIgnoreCase("any")) - p.chat("//schbr newtrees/" + type + "/*/*" + option + "/*@** -place:bottom -yoff:2"); - else - p.chat("//schbr newtrees/" + type + "/" + scale + "/*" + option + "/*@** -place:bottom -yoff:2"); - } - } + if (p.getInventory().getItemInMainHand().getType() == Material.AIR) + p.getInventory().setItem(p.getInventory().getHeldItemSlot(), Item.create(XMaterial.DIAMOND_SWORD.get())); + + if (treeType.getName().equalsIgnoreCase("any")) { + p.chat("/schbr $GeneratorCollections/treepack/* -place:bottom -yoff:2"); + } else if (height.equalsIgnoreCase("null") || height.equalsIgnoreCase("any")) { + p.chat("/schbr $GeneratorCollections/treepack/" + treeType.getName() + "/* -place:bottom -yoff:2"); + } else if (treeWidth.getName().equalsIgnoreCase("any")) { + p.chat("/schbr $GeneratorCollections/treepack/" + treeType.getName() + "/" + height + "/* -place:bottom -yoff:2"); + } else { + p.chat("/schbr $GeneratorCollections/treepack/" + treeType.getName() + "/" + height + "/" + + treeWidth.getName() + "/* -place:bottom -yoff:2"); } } } diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeType.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeType.java index b4ed37ad..1e0379ad 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeType.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeType.java @@ -1,6 +1,7 @@ package net.buildtheearth.modules.generator.components.tree; import lombok.Getter; +import org.jspecify.annotations.Nullable; public enum TreeType { @@ -50,4 +51,12 @@ public enum TreeType { TreeType(String name) { this.name = name; } + + public static @Nullable TreeType byString(String check) { + for (TreeType type : TreeType.values()) + if (type.getName().equalsIgnoreCase(check)) + return type; + + return null; + } } diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeWidth.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeWidth.java index dace5fa6..af1eb7e3 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeWidth.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeWidth.java @@ -1,6 +1,7 @@ package net.buildtheearth.modules.generator.components.tree; import lombok.Getter; +import org.jspecify.annotations.Nullable; public enum TreeWidth { @@ -17,4 +18,12 @@ public enum TreeWidth { TreeWidth(String name) { this.name = name; } + + public static @Nullable TreeWidth byString(String width) { + for (TreeWidth treeWidth : TreeWidth.values()) + if (treeWidth.getName().equalsIgnoreCase(width)) + return treeWidth; + + return null; + } } diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java new file mode 100644 index 00000000..5e5d79f9 --- /dev/null +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java @@ -0,0 +1,62 @@ +package net.buildtheearth.modules.generator.components.tree.menu; + +import com.cryptomorin.xseries.XMaterial; +import net.buildtheearth.modules.generator.GeneratorModule; +import net.buildtheearth.modules.generator.components.tree.TreeFlag; +import net.buildtheearth.modules.generator.components.tree.TreeSettings; +import net.buildtheearth.modules.generator.model.Settings; +import net.buildtheearth.utils.Item; +import net.buildtheearth.utils.menus.NameListMenu; +import net.daporkchop.lib.common.misc.Tuple; +import org.apache.commons.lang3.StringUtils; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.jspecify.annotations.NonNull; + +import java.util.ArrayList; +import java.util.List; + +public class TreeHeightMenu extends NameListMenu { + + public static final String TREE_TYPE_INV_NAME = "Choose a Tree Width"; + + public TreeHeightMenu(Player player, boolean autoLoad) { + super(player, TREE_TYPE_INV_NAME, getTreeHeights(), new TreeTypeMenu(player, false), autoLoad); + } + + /** + * Get a list of all tree widths + */ + private static @NonNull List> getTreeHeights() { + List> treeHeights = new ArrayList<>(); + + treeHeights.add(new Tuple<>(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build(), "Any")); + + GeneratorModule.getInstance().getTree().getHeights().forEach(h -> + treeHeights.add(new Tuple<>(Item.create(XMaterial.PAPER.get(), StringUtils.capitalize(h)), h))); + + return treeHeights; + } + + @Override + protected void setItemClickEventsAsync() { + super.setItemClickEventsAsync(); + + // Set click event for next item + if (canProceed()) + getMenu().getSlot(NEXT_ITEM_SLOT).setClickHandler((clickPlayer, clickInformation) -> { + Settings settings = GeneratorModule.getInstance().getTree().getPlayerSettings().get(clickPlayer.getUniqueId()); + + if (!(settings instanceof TreeSettings treeSettings)) + return; + + treeSettings.setValue(TreeFlag.HEIGHT, selectedNames.getFirst()); + + clickPlayer.closeInventory(); + clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); + + new TreeWidthMenu(clickPlayer, true); + }); + } +} diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java index ac766927..2add790e 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java @@ -2,23 +2,24 @@ import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.GeneratorModule; +import net.buildtheearth.modules.generator.components.tree.TreeFlag; +import net.buildtheearth.modules.generator.components.tree.TreeSettings; +import net.buildtheearth.modules.generator.components.tree.TreeType; import net.buildtheearth.modules.generator.menu.GeneratorMenu; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.modules.generator.components.road.RoadFlag; -import net.buildtheearth.modules.generator.components.road.RoadSettings; -import net.buildtheearth.modules.generator.components.tree.TreeType; import net.buildtheearth.utils.Item; -import net.buildtheearth.utils.menus.BlockListMenu; +import net.buildtheearth.utils.menus.NameListMenu; +import net.daporkchop.lib.common.misc.Tuple; import org.apache.commons.lang3.StringUtils; -import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import org.jspecify.annotations.NonNull; import java.util.ArrayList; import java.util.List; -public class TreeTypeMenu extends BlockListMenu { +public class TreeTypeMenu extends NameListMenu { public static final String TREE_TYPE_INV_NAME = "Choose a Tree Type"; @@ -27,13 +28,13 @@ public TreeTypeMenu(Player player, boolean autoLoad) { } /** Get a list of all tree types */ - private static List getTreeTypes() { - List treeTypes = new ArrayList<>(); + private static @NonNull List> getTreeTypes() { + List> treeTypes = new ArrayList<>(); - treeTypes.add(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build()); + treeTypes.add(new Tuple<>(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build(), "Any")); for(TreeType treeType : TreeType.values()) - treeTypes.add(Item.create(XMaterial.OAK_SAPLING.parseMaterial(), StringUtils.capitalize(treeType.getName()))); + treeTypes.add(new Tuple<>(Item.create(XMaterial.OAK_SAPLING.get(), StringUtils.capitalize(treeType.getName())), treeType.getName())); return treeTypes; } @@ -45,16 +46,17 @@ protected void setItemClickEventsAsync() { // Set click event for next item if(canProceed()) getMenu().getSlot(NEXT_ITEM_SLOT).setClickHandler((clickPlayer, clickInformation) -> { - Settings settings = GeneratorModule.getInstance().getRoad().getPlayerSettings().get(clickPlayer.getUniqueId()); + Settings settings = GeneratorModule.getInstance().getTree().getPlayerSettings().get(clickPlayer.getUniqueId()); - if(!(settings instanceof RoadSettings)) + if (!(settings instanceof TreeSettings treeSettings)) return; - RoadSettings roadSettings = (RoadSettings) settings; - roadSettings.setValue(RoadFlag.ROAD_MATERIAL, Item.createStringFromItemList(selectedMaterials)); + treeSettings.setValue(TreeFlag.TYPE, selectedNames.getFirst()); clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); + + new TreeHeightMenu(clickPlayer, true); }); } } diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java index fe184127..a1d2f605 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java @@ -2,21 +2,23 @@ import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.modules.generator.components.road.RoadFlag; -import net.buildtheearth.modules.generator.components.road.RoadSettings; +import net.buildtheearth.modules.generator.components.tree.TreeFlag; +import net.buildtheearth.modules.generator.components.tree.TreeSettings; import net.buildtheearth.modules.generator.components.tree.TreeWidth; +import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.utils.Item; -import net.buildtheearth.utils.menus.BlockListMenu; +import net.buildtheearth.utils.menus.NameListMenu; +import net.daporkchop.lib.common.misc.Tuple; import org.apache.commons.lang3.StringUtils; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import org.jspecify.annotations.NonNull; import java.util.ArrayList; import java.util.List; -public class TreeWidthMenu extends BlockListMenu { +public class TreeWidthMenu extends NameListMenu { public static final String TREE_TYPE_INV_NAME = "Choose a Tree Width"; @@ -27,15 +29,15 @@ public TreeWidthMenu(Player player, boolean autoLoad) { /** * Get a list of all tree widths */ - private static List getTreeWidths() { - List treeTypes = new ArrayList<>(); + private static @NonNull List> getTreeWidths() { + List> treeWidths = new ArrayList<>(); - treeTypes.add(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build()); + treeWidths.add(new Tuple<>(new Item(XMaterial.LIME_CONCRETE.parseItem()).setDisplayName("Any").build(), "Any")); for (TreeWidth treeWidth : TreeWidth.values()) - treeTypes.add(Item.create(XMaterial.PAPER.parseMaterial(), StringUtils.capitalize(treeWidth.getName()))); + treeWidths.add(new Tuple<>(Item.create(XMaterial.JUNGLE_SAPLING.get(), StringUtils.capitalize(treeWidth.getName())), treeWidth.getName())); - return treeTypes; + return treeWidths; } @Override @@ -45,18 +47,17 @@ protected void setItemClickEventsAsync() { // Set click event for next item if (canProceed()) getMenu().getSlot(NEXT_ITEM_SLOT).setClickHandler((clickPlayer, clickInformation) -> { - Settings settings = GeneratorModule.getInstance().getRoad().getPlayerSettings().get(clickPlayer.getUniqueId()); + Settings settings = GeneratorModule.getInstance().getTree().getPlayerSettings().get(clickPlayer.getUniqueId()); - if (!(settings instanceof RoadSettings)) + if (!(settings instanceof TreeSettings treeSettings)) return; - RoadSettings roadSettings = (RoadSettings) settings; - roadSettings.setValue(RoadFlag.ROAD_MATERIAL, Item.createStringFromItemList(selectedMaterials)); + treeSettings.setValue(TreeFlag.WIDTH, selectedNames.getFirst()); clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); - //new SidewalkColorMenu(clickPlayer); + GeneratorModule.getInstance().getTree().generate(clickPlayer); }); } } diff --git a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java index 6c5981b6..c325d8fd 100644 --- a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java @@ -90,7 +90,7 @@ protected void setPreviewItems() { // Set navigator item getMenu().getSlot(TREE_ITEM_SLOT).setItem(treeItem); - } else if (GeneratorCollections.checkIfGeneratorCollectionsIsInstalled(getMenuPlayer())) { + } else if (!GeneratorCollections.hasUpdatedGeneratorCollections(getMenuPlayer())) { // TREE ITEM ArrayList treeLore = ListUtil.createList("", "§cThe §eTree Pack " + Tree.TREE_PACK_VERSION + " §cis not installed", "§cTree Generator is disabled", "", "§8Leftclick for Installation Instructions"); diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Flag.java b/src/main/java/net/buildtheearth/modules/generator/model/Flag.java index 156873e1..d49d80d1 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Flag.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/Flag.java @@ -1,11 +1,11 @@ package net.buildtheearth.modules.generator.model; -import lombok.Getter; import net.buildtheearth.modules.generator.components.field.FieldFlag; import net.buildtheearth.modules.generator.components.house.HouseFlag; import net.buildtheearth.modules.generator.components.rail.RailFlag; import net.buildtheearth.modules.generator.components.road.RoadFlag; import net.buildtheearth.modules.generator.components.tree.TreeFlag; +import org.jspecify.annotations.NonNull; public interface Flag { @@ -14,19 +14,13 @@ public interface Flag { FlagType getFlagType(); /** @return the flag by the given string and generator type */ - static Flag byString(GeneratorType generatorType, String flag) { - switch (generatorType) { - case HOUSE: - return HouseFlag.byString(flag); - case ROAD: - return RoadFlag.byString(flag); - case TREE: - return TreeFlag.byString(flag); - case RAILWAY: - return RailFlag.byString(flag); - case FIELD: - return FieldFlag.byString(flag); - } - return null; + static Flag byString(@NonNull GeneratorType generatorType, String flag) { + return switch (generatorType) { + case HOUSE -> HouseFlag.byString(flag); + case ROAD -> RoadFlag.byString(flag); + case TREE -> TreeFlag.byString(flag); + case RAILWAY -> RailFlag.byString(flag); + case FIELD -> FieldFlag.byString(flag); + }; } } diff --git a/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java b/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java index b7b5d18e..681d2a0a 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java @@ -86,9 +86,9 @@ public static Object convertToFlagType(Flag flag, String value){ case CROP_STAGE: return CropStage.getByIdentifier(value); case TREE_TYPE: - return TreeType.valueOf(value); + return TreeType.byString(value); case TREE_WIDTH: - return TreeWidth.valueOf(value); + return TreeWidth.byString(value); } return null; } diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java index 2a331680..f50b304a 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java @@ -43,7 +43,7 @@ public class GeneratorCollections { * @param p The player to check for. If null, the console will be used instead. * @return Whether the Generator Collections package is installed */ - public static boolean checkIfGeneratorCollectionsIsInstalled(@Nullable Player p){ + public static boolean hasUpdatedGeneratorCollections(@Nullable Player p) { // Load the schematic file try { String folder; @@ -327,7 +327,7 @@ private static boolean checkIfGeneratorCollectionsIsUpToDate(Player p){ /** * Sends the player and console a message with more information about the generator collections package in case it isn't installed. * - * @see #checkIfGeneratorCollectionsIsInstalled(Player) + * @see #hasUpdatedGeneratorCollections(Player) * * @param p The player to send the message to */ diff --git a/src/main/java/net/buildtheearth/utils/menus/NameListMenu.java b/src/main/java/net/buildtheearth/utils/menus/NameListMenu.java new file mode 100644 index 00000000..e63308df --- /dev/null +++ b/src/main/java/net/buildtheearth/utils/menus/NameListMenu.java @@ -0,0 +1,133 @@ +package net.buildtheearth.utils.menus; + +import net.buildtheearth.utils.CustomHeads; +import net.buildtheearth.utils.Item; +import net.buildtheearth.utils.MenuItems; +import net.daporkchop.lib.common.misc.Tuple; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.ipvp.canvas.mask.BinaryMask; +import org.ipvp.canvas.mask.Mask; +import org.jspecify.annotations.NonNull; + +import java.util.ArrayList; +import java.util.List; + +/** + * A menu that allows the player to select a block from a list of blocks. It is possible to switch pages and to proceed to the next menu once a block has been selected. It is also possible to select multiple blocks. + * To change the items that are displayed in the menu, override the {@link #getSource()} method. + * To perform an action when a block is selected, override the {@link #setItemClickEventsAsync()} method. + */ +public class NameListMenu extends AbstractPaginatedMenu { + + public static final int SWITCH_PAGE_ITEM_SLOT = 31; + public static final int NEXT_ITEM_SLOT = 35; + public static final int BACK_ITEM_SLOT = 27; + + protected final List selectedNames; + private final List> items; + + private final AbstractMenu backMenu; + + + public NameListMenu(Player player, String invName, List> items, AbstractMenu backMenu, boolean autoLoad) { + super(4, 3, invName, player, autoLoad); + + this.items = items; + this.backMenu = backMenu; + selectedNames = new ArrayList<>(); + } + + @Override + protected void setPreviewItems() { + if (backMenu != null) + setBackItem(BACK_ITEM_SLOT, backMenu); + + setSwitchPageItems(SWITCH_PAGE_ITEM_SLOT); + + if (canProceed()) + getMenu().getSlot(NEXT_ITEM_SLOT).setItem(CustomHeads.getCheckmarkItem("§eNext")); + else + getMenu().getSlot(NEXT_ITEM_SLOT).setItem(MenuItems.ITEM_BACKGROUND); + + super.setPreviewItems(); + } + + @Override + protected void setMenuItemsAsync() { + // + } + + @Override + protected void setItemClickEventsAsync() { + setSwitchPageItemClickEvents(SWITCH_PAGE_ITEM_SLOT); + } + + @Override + protected Mask getMask() { + String backSlot = backMenu == null ? "1" : "0"; + + return BinaryMask.builder(getMenu()) + .item(MenuItems.ITEM_BACKGROUND) + .pattern("000000000") + .pattern("000000000") + .pattern("000000000") + .pattern(backSlot + "11000110") + .build(); + } + + @Override + protected List getSource() { + return items; + } + + @Override + protected void setPaginatedPreviewItems(List source) { + // Set pagignated items + List> pagItems = source.stream().map(l -> (Tuple) l).toList(); + int slot = 0; + for (Tuple item : pagItems) { + if (selectedNames.contains(item.getB())) + item.setA(new Item(item.getA()).setAmount(1).addEnchantment(Enchantment.LUCK_OF_THE_SEA, 1).hideEnchantments(true).build()); + + getMenu().getSlot(slot).setItem(item.getA()); + slot++; + } + } + + @Override + protected void setPaginatedMenuItemsAsync(List source) { + // No Async / DB Items + } + + @Override + protected void setPaginatedItemClickEventsAsync(@NonNull List source) { + List> pagItems = source.stream().map(l -> (Tuple) l).toList(); + int slot = 0; + for (Tuple item : pagItems) { + final int _slot = slot; + getMenu().getSlot(_slot).setClickHandler((clickPlayer, clickInformation) -> { + String type = (item.getB().toLowerCase()); + + if (selectedNames.contains(type)) + selectedNames.remove(type); + else + selectedNames.add(type); + + reloadMenuAsync(); + }); + slot++; + } + } + + /** + * Checks if the player has selected at least one block. + * + * @return true if the player has selected at least one block, false otherwise. + */ + protected boolean canProceed() { + return !selectedNames.isEmpty(); + } +} + From 43cae29a950f694eb1edc8796d42c3ffbf972386 Mon Sep 17 00:00:00 2001 From: MineFact Date: Fri, 18 Jul 2025 11:27:35 +0200 Subject: [PATCH 13/37] feat(util): Update GeneratorUtils to 1.7.3 --- .../generator/utils/GeneratorUtils.java | 375 ++++++++++++------ 1 file changed, 248 insertions(+), 127 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java b/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java index 6c32b9e5..ce83bcf3 100644 --- a/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java +++ b/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java @@ -14,6 +14,7 @@ import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; +import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; @@ -21,6 +22,8 @@ import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.Mask; +import com.sk89q.worldedit.function.operation.ForwardExtentCopy; +import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.pattern.ClipboardPattern; import com.sk89q.worldedit.function.pattern.Pattern; @@ -38,18 +41,15 @@ import com.sk89q.worldedit.world.block.BlockTypes; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.WikiDocumented; -import net.buildtheearth.modules.common.CommonModule; import net.buildtheearth.utils.ChatHelper; -import net.buildtheearth.utils.MenuItems; import org.apache.commons.lang3.StringUtils; -import org.bukkit.Sound; -import org.bukkit.World; -import org.bukkit.Location; -import org.bukkit.Material; +import org.bukkit.*; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginDescriptionFile; +import org.bukkit.plugin.PluginManager; import org.bukkit.util.Vector; import java.io.File; @@ -99,10 +99,12 @@ *
• {@link #createCuboidSelection(Player, Vector, Vector)} *
• {@link #createPolySelection(Player, List, Block[][][])} *
• {@link #createPolySelection(Player, List, int, int)} + *
• {@link #changeRegionWorld(Region, com.sk89q.worldedit.world.World)} * *

WorldEdit Operation Functions: *
• {@link #prepareScriptSession(LocalSession, Actor, Player, com.sk89q.worldedit.world.World, int, boolean, boolean, boolean)} *
• {@link #analyzeRegion(Player, World)} + *
• {@link #copyRegion(LocalSession, Actor, Region, World, World)} *
• {@link #replaceBlocksWithMasks(LocalSession, Actor, com.sk89q.worldedit.world.World, List, BlockState, BlockState[], int)} *
• {@link #replaceBlocksWithSchematic(LocalSession, Actor, com.sk89q.worldedit.world.World, BlockState[], String)} *
• {@link #replaceBlocks(LocalSession, Actor, com.sk89q.worldedit.world.World, BlockState[], BlockState[])} @@ -141,9 +143,10 @@ *
• {@link #checkForBrickOutline(Block[][][], Player, WikiDocumented)} *
• {@link #checkForWoolBlock(Block[][][], Player, WikiDocumented)} * - * @version 1.5 + * @version 1.7.3 * @author MineFact */ +@SuppressWarnings("unused") public class GeneratorUtils { @@ -160,28 +163,60 @@ private static Plugin getPlugin(){ /** Checks if the plugin "FastAsyncWorldEdit" is enabled. */ private static boolean isFastAsyncWorldEditEnabled(){ - return CommonModule.getInstance().getDependencyComponent().isFastAsyncWorldEditEnabled(); + return getPlugin().getServer().getPluginManager().isPluginEnabled("FastAsyncWorldEdit"); } - /** Checks if only the plugin "WorldEdit" is enabled and not "FastAsyncWorldEdit". */ - private static boolean isLegacyWorldEditEnabled(){ - return CommonModule.getInstance().getDependencyComponent().isLegacyWorldEdit(); + private static boolean isLegacyWorldEditEnabled() { + if (isFastAsyncWorldEditEnabled()) + return false; + + PluginManager pluginManager = getPlugin().getServer().getPluginManager(); + if (!pluginManager.isPluginEnabled("WorldEdit")) + return false; + + Plugin plugin = pluginManager.getPlugin("WorldEdit"); + if (plugin == null) + return false; + + @SuppressWarnings("deprecation") + PluginDescriptionFile description = plugin.getDescription(); + String version = description.getVersion(); + int major; + try { + major = Integer.parseInt(version.split("\\.")[0]); + } catch (NumberFormatException e) { + // Fallback or assume not legacy if version can't be parsed + return false; + } + + return major < 7; } + /** Checks if the plugin "SchematicBrush" is enabled. */ private static boolean isSchematicBrushEnabled(){ - return CommonModule.getInstance().getDependencyComponent().isSchematicBrushEnabled(); - } + return getPlugin().getServer().getPluginManager().isPluginEnabled("SchematicBrush"); + } // e.g., "1.21.4" + /** Checks if the server version is 1.12. */ private static boolean isServerVersion1_12(){ - return CommonModule.getInstance().getVersionComponent().is_1_12(); + String rawVersion = Bukkit.getBukkitVersion().split("-")[0]; + return rawVersion.equals("1.12.2") || rawVersion.equals("1.12.1") || rawVersion.equals("1.12"); } /** Get the ignored materials. */ private static Material[] getIgnoredMaterials(){ - return MenuItems.getIgnoredMaterials(); + return new Material[]{}; } + + private static void sendWikiLink(Player p) { + p.sendMessage("§cFor more information, see the Wiki."); + } + + + + /*=============================================** @@ -234,12 +269,14 @@ public static BlockState getBlockState(XMaterial xMaterial){ return null; BlockType blockType = BlockTypes.get(xMaterial.getId() + ""); + ItemStack item = xMaterial.parseItem(); + if (blockType == null && item != null) + blockType = BlockTypes.get(item.getType().getKey().asString()); - if(blockType == null && xMaterial.parseMaterial() != null) - blockType = BlockTypes.get(xMaterial.parseMaterial().getKey().asString()); - - if(blockType == null) - throw new IllegalArgumentException("Invalid block type: " + xMaterial.parseMaterial().name()); + if (blockType == null && item != null) + throw new IllegalArgumentException("Invalid block type: " + item.getType().name()); + else if (blockType == null) + throw new IllegalArgumentException("Invalid block type: " + xMaterial.name()); return blockType.getDefaultState(); } @@ -299,83 +336,82 @@ public static String getWorldEditSchematicsFolderPath(){ public static List getSelectionPointsFromRegion(Region region) { List points = new ArrayList<>(); - if (region instanceof Polygonal2DRegion) { - Polygonal2DRegion polyRegion = (Polygonal2DRegion) region; - ChatHelper.logDebug("Polygonal2DRegion found"); - // In latest FAWE, the points are stored as BlockVector2 - // In 1.12 WorldEdit, the points are stored as BlockVector2D - // Both classes have the same methods, so we can use reflection to get the methods - for (Object blockVectorObj : polyRegion.getPoints()) { - ChatHelper.logDebug("BlockVector2:" + blockVectorObj); - try { - Class blockVectorClass = blockVectorObj.getClass(); - Method getXMethod = blockVectorClass.getMethod("getBlockX"); - Method getZMethod = blockVectorClass.getMethod("getBlockZ"); - - int x = (Integer) getXMethod.invoke(blockVectorObj); - int z = (Integer) getZMethod.invoke(blockVectorObj); - - points.add(new Vector(x, 0, z)); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); + switch (region) { + case Polygonal2DRegion polyRegion -> { + ChatHelper.logDebug("Polygonal2DRegion found"); + // In latest FAWE, the points are stored as BlockVector2 + // In 1.12 WorldEdit, the points are stored as BlockVector2D + // Both classes have the same methods, so we can use reflection to get the methods + for (Object blockVectorObj : polyRegion.getPoints()) { + ChatHelper.logDebug("BlockVector2:" + blockVectorObj); + try { + Class blockVectorClass = blockVectorObj.getClass(); + Method getXMethod = blockVectorClass.getMethod("getBlockX"); + Method getZMethod = blockVectorClass.getMethod("getBlockZ"); + + int x = (Integer) getXMethod.invoke(blockVectorObj); + int z = (Integer) getZMethod.invoke(blockVectorObj); + + points.add(new Vector(x, 0, z)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + ChatHelper.logDebug("Exception while processing region: " + e.getMessage()); + } } } - - } else if (region instanceof ConvexPolyhedralRegion) { - ConvexPolyhedralRegion convexRegion = (ConvexPolyhedralRegion) region; - - // In latest FAWE, the points are stored as BlockVector2 - // In 1.12 WorldEdit, the points are stored as BlockVector2D - // Both classes have the same methods, so we can use reflection to get the methods - for (Object blockVectorObj : convexRegion.getVertices()) { - try { - Class blockVectorClass = blockVectorObj.getClass(); - Method getXMethod = blockVectorClass.getMethod("getBlockX"); - Method getYMethod = blockVectorClass.getMethod("getBlockY"); - Method getZMethod = blockVectorClass.getMethod("getBlockZ"); - - int x = (Integer) getXMethod.invoke(blockVectorObj); - int y = (Integer) getYMethod.invoke(blockVectorObj); - int z = (Integer) getZMethod.invoke(blockVectorObj); - - points.add(new Vector(x, y, z)); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); + case ConvexPolyhedralRegion convexRegion -> { + // In latest FAWE, the points are stored as BlockVector2 + // In 1.12 WorldEdit, the points are stored as BlockVector2D + // Both classes have the same methods, so we can use reflection to get the methods + for (Object blockVectorObj : convexRegion.getVertices()) { + try { + Class blockVectorClass = blockVectorObj.getClass(); + Method getXMethod = blockVectorClass.getMethod("getBlockX"); + Method getYMethod = blockVectorClass.getMethod("getBlockY"); + Method getZMethod = blockVectorClass.getMethod("getBlockZ"); + + int x = (Integer) getXMethod.invoke(blockVectorObj); + int y = (Integer) getYMethod.invoke(blockVectorObj); + int z = (Integer) getZMethod.invoke(blockVectorObj); + + points.add(new Vector(x, y, z)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + ChatHelper.logDebug("Exception while processing region: " + e.getMessage()); + } } } + case CuboidRegion cuboidRegion -> { + try { + Class regionClass = cuboidRegion.getClass(); + Method getPos1Method = regionClass.getMethod("getPos1"); + Method getPos2Method = regionClass.getMethod("getPos2"); - }else if (region instanceof CuboidRegion) { - CuboidRegion cuboidRegion = (CuboidRegion) region; - - try { - Class regionClass = cuboidRegion.getClass(); - Method getPos1Method = regionClass.getMethod("getPos1"); - Method getPos2Method = regionClass.getMethod("getPos2"); - - Class vectorClass = getPos1Method.getReturnType(); + Class vectorClass = getPos1Method.getReturnType(); - Method getXMethod = vectorClass.getMethod("getBlockX"); - Method getYMethod = vectorClass.getMethod("getBlockY"); - Method getZMethod = vectorClass.getMethod("getBlockZ"); + Method getXMethod = vectorClass.getMethod("getBlockX"); + Method getYMethod = vectorClass.getMethod("getBlockY"); + Method getZMethod = vectorClass.getMethod("getBlockZ"); - Object pos1 = getPos1Method.invoke(region); - Object pos2 = getPos2Method.invoke(region); + Object pos1 = getPos1Method.invoke(region); + Object pos2 = getPos2Method.invoke(region); - int x1 = (Integer) getXMethod.invoke(pos1); - int y1 = (Integer) getYMethod.invoke(pos1); - int z1 = (Integer) getZMethod.invoke(pos1); + int x1 = (Integer) getXMethod.invoke(pos1); + int y1 = (Integer) getYMethod.invoke(pos1); + int z1 = (Integer) getZMethod.invoke(pos1); - int x2 = (Integer) getXMethod.invoke(pos2); - int y2 = (Integer) getYMethod.invoke(pos2); - int z2 = (Integer) getZMethod.invoke(pos2); + int x2 = (Integer) getXMethod.invoke(pos2); + int y2 = (Integer) getYMethod.invoke(pos2); + int z2 = (Integer) getZMethod.invoke(pos2); - points.add(new Vector(x1, y1, z1)); - points.add(new Vector(x2, y2, z2)); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); + points.add(new Vector(x1, y1, z1)); + points.add(new Vector(x2, y2, z2)); + } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + ChatHelper.logDebug("Exception while processing region: " + e.getMessage()); + } } - } else - return null; + case null, default -> { + return null; + } + } return points; } @@ -415,7 +451,7 @@ public static Vector[] getMinMaxPoints(Region region){ minMax[1] = new Vector(maxX, maxY, maxZ); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - e.printStackTrace(); + ChatHelper.logDebug("Exception while processing MinMax Points: " + e.getMessage()); } return minMax; @@ -481,14 +517,11 @@ public static boolean containsBlock(Block[][][] blocks, XMaterial xMaterial, int int amountFound = 0; for (Block[][] block2D : blocks) for (Block[] block1D : block2D) - for (Block block : block1D) - if (isServerVersion1_12()) { - if (block != null && block.getType() == xMaterial.parseMaterial() && block.getData() == xMaterial.getData()) + for (Block block : block1D) { + ItemStack item = xMaterial.parseItem(); + if (block != null && item != null && block.getType() == item.getType()) amountFound++; - }else { - if (block != null && block.getType() == xMaterial.parseMaterial()) - amountFound++; - } + } return amountFound >= requiredAmount; } @@ -597,13 +630,46 @@ public static void createPolySelection(Player p, List points, int minY, ChatHelper.logDebug("Created polygonal selection with " + points.size() + " points. minY: " + minY + " maxY: " + maxY); } + + /** + * Rebuilds a region with a different world while keeping its coordinates. + * Currently, supports {@link Polygonal2DRegion} and {@link CuboidRegion}. + * + * @param region The region to rebuild + * @param world The world that should be used for the new region + * @return A new region with the supplied world or {@code null} if the type is unsupported + */ + public static Region changeRegionWorld(Region region, com.sk89q.worldedit.world.World world) { + if (region instanceof Polygonal2DRegion) { + List points = getSelectionPointsFromRegion(region); + if (points == null) + return null; + + List blockPoints = new ArrayList<>(); + for (Vector v : points) + blockPoints.add(BlockVector2.at(v.getBlockX(), v.getBlockZ())); + + Vector[] minMax = getMinMaxPoints(region); + int minY = minMax[0].getBlockY(); + int maxY = minMax[1].getBlockY(); + + return new Polygonal2DRegion(world, blockPoints, minY, maxY); + } else if (region instanceof CuboidRegion) { + Vector[] minMax = getMinMaxPoints(region); + BlockVector3 min = BlockVector3.at(minMax[0].getBlockX(), minMax[0].getBlockY(), minMax[0].getBlockZ()); + BlockVector3 max = BlockVector3.at(minMax[1].getBlockX(), minMax[1].getBlockY(), minMax[1].getBlockZ()); + return new CuboidRegion(world, min, max); + } + + return null; + } + - - - - - - + + + + + /*=============================================** WORLDEDIT OPERATION FUNCTIONS @@ -694,7 +760,7 @@ public static Block[][][] analyzeRegion(Player p, World world) { if(isLegacyWorldEditEnabled()) contains = regionClass.getMethod("contains", Class.forName("com.sk89q.worldedit.Vector")); else - contains = regionClass.getMethod("contains", com.sk89q.worldedit.math.BlockVector3.class); + contains = regionClass.getMethod("contains", BlockVector3.class); Object minPoint = getMinimumPoint.invoke(region); Object maxPoint = getMaximumPoint.invoke(region); @@ -743,11 +809,71 @@ public static Block[][][] analyzeRegion(Player p, World world) { return blocks; } catch (Exception e) { - e.printStackTrace(); + ChatHelper.logDebug("Exception while analyzing region: " + e.getMessage()); return null; } } + /** + * Copies all blocks inside a region from one world to another to the same coordinates. + * + * @param region The region to copy. + * @param fromWorld The source world. + * @param toWorld The destination world. + */ + public static CompletableFuture copyRegion(LocalSession localSession, Actor actor, + Region region, World fromWorld, + World toWorld) { + CompletableFuture future = new CompletableFuture<>(); + Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { + com.sk89q.worldedit.world.World weFrom = BukkitAdapter.adapt(fromWorld); + com.sk89q.worldedit.world.World weTo = BukkitAdapter.adapt(toWorld); + Region copyRegion = region; + + try (EditSession sourceEditSession = WorldEdit.getInstance().newEditSession(weFrom); + EditSession targetEditSession = WorldEdit.getInstance().newEditSession(weTo)) { + + if (copyRegion.getWorld() != null && !copyRegion.getWorld().getName().equals(fromWorld.getName())) + copyRegion = changeRegionWorld(region, weFrom); + + if (copyRegion == null) { + ChatHelper.logError("Failed to copy region from " + fromWorld.getName() + " to " + toWorld.getName() + " because region is null."); + return; + } + + BlockArrayClipboard clipboard = new BlockArrayClipboard(copyRegion); + ForwardExtentCopy forwardCopy = new ForwardExtentCopy(sourceEditSession, copyRegion, + clipboard, region.getMinimumPoint()); + forwardCopy.setCopyingEntities(true); + forwardCopy.setCopyingBiomes(true); + Operations.complete(forwardCopy); + + ChatHelper.log("Pasting at: " + region.getMinimumPoint() + " in world " + toWorld.getName()); + ChatHelper.log("Clipboard size: " + clipboard.getRegion().getVolume()); + + Operation paste = new ClipboardHolder(clipboard) + .createPaste(targetEditSession) + .to(region.getMinimumPoint()) + .copyEntities(true) + .copyBiomes(true) + .ignoreAirBlocks(false) + .build(); + Operations.complete(paste); + targetEditSession.flushQueue(); + + saveEditSession(targetEditSession, localSession, actor); + } catch (WorldEditException e) { + ChatHelper.logError("Failed to copy region: " + e.getMessage()); + future.completeExceptionally(e); + return; + } + + future.complete(null); + }); + + return future; + } + /** * Replaces all blocks in a region with the given masks and a pattern. * @@ -766,7 +892,7 @@ public static CompletableFuture replaceBlocksWithMasks(LocalSession localS throw new IllegalArgumentException("BlockState[] to is empty"); CompletableFuture future = new CompletableFuture<>(); - Thread thread = new Thread(() -> { + Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { for (int i = 0; i < iterations; i++) { try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { @@ -815,7 +941,6 @@ public static CompletableFuture replaceBlocksWithMasks(LocalSession localS future.complete(null); }); - thread.start(); return future; } @@ -832,7 +957,7 @@ public static CompletableFuture replaceBlocksWithMasks(LocalSession localS */ public static CompletableFuture replaceBlocksWithSchematic(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, BlockState[] from, String schematicPath) { CompletableFuture future = new CompletableFuture<>(); - Thread thread = new Thread(() -> { + Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { ChatHelper.logDebug("Replacing blocks from " + Arrays.toString(from) + " to " + schematicPath); try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { @@ -858,7 +983,7 @@ public static CompletableFuture replaceBlocksWithSchematic(LocalSession lo }else editSession.setBlocks(region, pattern); } catch (IOException e) { - e.printStackTrace(); + ChatHelper.logDebug("Exception while replacing blocks with schematic: " + e.getMessage()); return; } @@ -869,7 +994,7 @@ public static CompletableFuture replaceBlocksWithSchematic(LocalSession lo future.complete(null); }); - thread.start(); + return future; } @@ -889,7 +1014,7 @@ public static CompletableFuture replaceBlocks(LocalSession localSession, A throw new IllegalArgumentException("BlockState[] to is empty"); CompletableFuture future = new CompletableFuture<>(); - Thread thread = new Thread(() -> { + Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { ChatHelper.logDebug("Replacing blocks from " + Arrays.toString(from) + " to " + Arrays.toString(to)); try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { @@ -922,7 +1047,6 @@ public static CompletableFuture replaceBlocks(LocalSession localSession, A future.complete(null); }); - thread.start(); return future; } @@ -951,14 +1075,14 @@ public static CompletableFuture drawSplineWithMasks(LocalSession localSess throw new IllegalArgumentException("BlockState[] to is empty"); // If no mask is provided, add an empty mask - if(masks.size() == 0) { + if (masks.isEmpty()) { masks = new ArrayList<>(); masks.add(""); } List finalMasks = masks; CompletableFuture future = new CompletableFuture<>(); - Thread thread = new Thread(() -> { + Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { @@ -1004,7 +1128,7 @@ public static CompletableFuture drawSplineWithMasks(LocalSession localSess editSession.drawSpline(pattern, blockVector3s, tension, bias, continuity, quality, radius, filled); if (connectLineEnds && blockVector3s.size() > 1) - editSession.drawLine(pattern, blockVector3s.get(0), blockVector3s.get(blockVector3s.size() - 1), radius, true); + editSession.drawLine(pattern, blockVector3s.getFirst(), blockVector3s.getLast(), radius, true); saveEditSession(editSession, localSession, actor); } @@ -1015,7 +1139,6 @@ public static CompletableFuture drawSplineWithMasks(LocalSession localSess future.complete(null); }); - thread.start(); return future; } @@ -1048,14 +1171,14 @@ public static CompletableFuture drawLineWithMasks(LocalSession localSessio throw new IllegalArgumentException("BlockState[] to is empty"); // If no mask is provided, add an empty mask - if(masks.size() == 0) { + if (masks.isEmpty()) { masks = new ArrayList<>(); masks.add(""); } CompletableFuture future = new CompletableFuture<>(); List finalMasks = masks; - Thread thread = new Thread(() -> { + Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { ParserContext parserContext = new ParserContext(); @@ -1112,7 +1235,6 @@ public static CompletableFuture drawLineWithMasks(LocalSession localSessio future.complete(null); }); - thread.start(); return future; } @@ -1132,7 +1254,7 @@ public static CompletableFuture pasteSchematicWithMasks(LocalSession local int offsetY = 1; // If no mask is provided, add an empty mask - if (masks.size() == 0) { + if (masks.isEmpty()) { masks = new ArrayList<>(); masks.add(""); } @@ -1147,7 +1269,7 @@ public static CompletableFuture pasteSchematicWithMasks(LocalSession local CompletableFuture future = new CompletableFuture<>(); int finalMaxHeight = maxHeight; final List finalMasks = masks; - Thread thread = new Thread(() -> { + Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { File schematicFile = new File(getWorldEditSchematicsFolderPath() + schematicPath); @@ -1179,7 +1301,7 @@ public static CompletableFuture pasteSchematicWithMasks(LocalSession local if(!maskString.isEmpty()) mask = new MaskFactory(WorldEdit.getInstance()).parseFromInput(maskString, parserContext); - com.sk89q.worldedit.function.operation.Operation op = holder + Operation op = holder .createPaste(editSession) .to(BlockVector3.at(loc.getBlockX(), finalMaxHeight + offsetY, loc.getBlockZ())) .ignoreAirBlocks(true) @@ -1199,7 +1321,6 @@ public static CompletableFuture pasteSchematicWithMasks(LocalSession local future.complete(null); }); - thread.start(); return future; } @@ -1387,7 +1508,7 @@ public static List populatePoints(List points, int distance){ } } - result.add(points.get(points.size()-1)); + result.add(points.getLast()); points = result; result = new ArrayList<>(); } @@ -1442,7 +1563,7 @@ public static List extendPolyLine(List vectors){ // Get the last two points Vector p3 = vectors.get(vectors.size()-2); - Vector p4 = vectors.get(vectors.size()-1); + Vector p4 = vectors.getLast(); // Get the vectors between the points Vector v1 = p1.clone().subtract(p2); @@ -1472,7 +1593,7 @@ public static List shortenPolyLine(List vectors, int distance){ // Get the last two points Vector p3 = vectors.get(vectors.size()-2); - Vector p4 = vectors.get(vectors.size()-1); + Vector p4 = vectors.getLast(); // Get the vectors between the points Vector v1 = p2.clone().subtract(p1); @@ -1483,8 +1604,8 @@ public static List shortenPolyLine(List vectors, int distance){ v2 = v2.clone().normalize().multiply(distance); // Remove the first and last points - vectors.remove(0); - vectors.remove(vectors.size() - 1); + vectors.removeFirst(); + vectors.removeLast(); // Add the shortened vectors result.add(p1.clone().add(v1)); @@ -1571,7 +1692,7 @@ private static List> convertPathsToVectorList(Paths64 pathsD, Vecto for(Point64 point : new ArrayList<>(path)) vectorList.add(new Vector(point.x + reference.getX(), minHeight, point.y + reference.getZ())); - Vector vector = vectorList.get(vectorList.size() - 1).setY(maxHeight); + Vector vector = vectorList.getLast().setY(maxHeight); vectorList.set(vectorList.size() - 1, vector); vectors.add(vectorList); @@ -1632,7 +1753,7 @@ public static List shiftPoints(List vectors, double shift, boole * @return The shifted polyline */ public static List> shiftPointsAll(List vectors, double shift) { - Vector reference = vectors.get(0); + Vector reference = vectors.getFirst(); int minHeight = getMinHeight(vectors); int maxHeight = getMaxHeight(vectors); Paths64 paths = new Paths64(); From 6172b0fae61dc52d6fc5ea75e7f91263d42dbfac Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sun, 11 Jan 2026 17:40:06 +0100 Subject: [PATCH 14/37] =?UTF-8?q?refactor(item):=20=E2=9C=A8=20simplify=20?= =?UTF-8?q?and=20clean=20up=20item=20metadata=20handling=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/buildtheearth/utils/Item.java | 103 +----------------- 1 file changed, 1 insertion(+), 102 deletions(-) diff --git a/src/main/java/net/buildtheearth/utils/Item.java b/src/main/java/net/buildtheearth/utils/Item.java index 71ab40d4..fe234123 100644 --- a/src/main/java/net/buildtheearth/utils/Item.java +++ b/src/main/java/net/buildtheearth/utils/Item.java @@ -3,12 +3,9 @@ import com.cryptomorin.xseries.XMaterial; import com.cryptomorin.xseries.profiles.builder.XSkull; import com.cryptomorin.xseries.profiles.objects.Profileable; -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.properties.Property; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import net.buildtheearth.modules.common.CommonModule; -import org.bukkit.Bukkit; import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -21,15 +18,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Base64; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; public class Item { public static final Map nonPlayerSkulls = new HashMap<>(); @@ -484,94 +473,4 @@ public static ItemStack createCustomHeadTextureURL(String url, String name, List return head; } - - private static void mutateItemMeta(SkullMeta meta, String b64) { - GameProfile profile = makeProfile(b64); - - // Try Paper API (Minecraft Version 1.21+) - try { - Method setPlayerProfile = SkullMeta.class.getMethod("setPlayerProfile", com.destroystokyo.paper.profile.PlayerProfile.class); - com.destroystokyo.paper.profile.PlayerProfile paperProfile = Bukkit.createProfile(profile.id(), profile.name()); - paperProfile.setProperty(new com.destroystokyo.paper.profile.ProfileProperty("textures", b64)); - setPlayerProfile.invoke(meta, paperProfile); - return; - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {} - - // Try Paper API (Minecraft Version 1.20+) - try { - Method setPlayerProfile = SkullMeta.class.getMethod( - "setPlayerProfile", - com.destroystokyo.paper.profile.PlayerProfile.class - ); - - // Reflective access to profile.getId() and profile.getName() - Method getIdMethod = profile.getClass().getMethod("getId"); - Method getNameMethod = profile.getClass().getMethod("getName"); - - UUID id = (UUID) getIdMethod.invoke(profile); - String name = (String) getNameMethod.invoke(profile); - - com.destroystokyo.paper.profile.PlayerProfile paperProfile = - Bukkit.createProfile(id, name); - - paperProfile.getProperties().add( - new com.destroystokyo.paper.profile.ProfileProperty("textures", b64) - ); - - setPlayerProfile.invoke(meta, paperProfile); - return; - - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) { - } - - - // Try setProfile(GameProfile) (Minecraft Version 1.15 – 1.19.4) - try { - Method metaSetProfileMethod = meta.getClass().getDeclaredMethod("setProfile", GameProfile.class); - metaSetProfileMethod.setAccessible(true); - metaSetProfileMethod.invoke(meta, profile); - return; - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {} - - // Try direct profile field (Minecraft Version 1.12 – 1.14) - try { - Field metaProfileField = meta.getClass().getDeclaredField("profile"); - metaProfileField.setAccessible(true); - metaProfileField.set(meta, profile); - } catch (NoSuchFieldException | IllegalAccessException ignored) { - System.err.println("Failed to set custom skull texture: unsupported server version or method change."); - } - } - - - private static @NotNull GameProfile makeProfile(@NotNull String b64) { - UUID id = new UUID( - b64.substring(b64.length() - 20).hashCode(), - b64.substring(b64.length() - 10).hashCode() - ); - GameProfile profile = new GameProfile(id, "bte"); - - // Try Paper API (Minecraft Version 1.21+) - boolean firstVersionWorked = false; - try { - profile.properties().put("textures", new Property("textures", b64)); - firstVersionWorked = true; - } catch (Exception ignored) { - } - - // Try api for older versions - if (!firstVersionWorked) { - try { - Method getPropertiesMethod = profile.getClass().getMethod("getProperties"); - Object properties = getPropertiesMethod.invoke(profile); - - ((com.mojang.authlib.properties.PropertyMap) properties) - .put("textures", new Property("textures", b64)); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - throw new RuntimeException(e); - } - } - - return profile; - } } From b7c57c11f110d20b9deb284d2248df70eb23eb60 Mon Sep 17 00:00:00 2001 From: MineFact Date: Fri, 18 Jul 2025 13:06:01 +0200 Subject: [PATCH 15/37] feat(util): Update Item Utils to 1.3.2 --- .../java/net/buildtheearth/utils/Item.java | 414 +++++++++--------- 1 file changed, 200 insertions(+), 214 deletions(-) diff --git a/src/main/java/net/buildtheearth/utils/Item.java b/src/main/java/net/buildtheearth/utils/Item.java index fe234123..71fda7fc 100644 --- a/src/main/java/net/buildtheearth/utils/Item.java +++ b/src/main/java/net/buildtheearth/utils/Item.java @@ -6,6 +6,7 @@ import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import net.buildtheearth.modules.common.CommonModule; +import org.bukkit.Bukkit; import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -17,37 +18,96 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; - -import java.util.*; - +import org.jspecify.annotations.NonNull; + +import java.util.Base64; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * This class provides static utility methods and a fluent builder API for creating and modifying {@link ItemStack} objects in Bukkit.
+ * It supports the customization of items with names, lore, enchantments, attributes, and skull textures. + *

+ * The following dependencies are required: + *
    + *
  1. Bukkit API
  2. + *
  3. HeadDatabaseAPI
  4. (removed for BuildTeamTools) + *
+ * + *
+ * The functions are categorized into the following sections: + * + *

Builder Pattern Methods: + *
These methods allow chaining item properties using a fluent API: + *
• {@link #setDisplayName(String)} + *
• {@link #setAmount(int)} + *
• {@link #setLore(List)} + *
• {@link #addEnchantment(Enchantment, int)} + *
• {@link #hideAttributes(boolean)} + *
• {@link #hideEnchantments(boolean)} + *
• {@link #build()} + * + *

Item Creation Methods: + *
Static methods to quickly create customized {@link ItemStack} instances: + *
• {@link #create(Material)} + *
• {@link #create(Material, int)} + *
• {@link #create(Material, String)} + *
• {@link #create(Material, String, int)} + *
• {@link #create(Material, String, List)} + *
• {@link #create(Material, String, short, List)} + *
• {@link #create(Material, String, int, List)} + *
• {@link #create(Material, String, List, Enchantment, Integer)} + *
• {@link #create(Material, String, List, Enchantment, Integer, Enchantment, Integer)} + *
• {@link #create(Material, String, List, Enchantment, Integer, Enchantment, Integer, Enchantment, Integer)} + * + *

Leather Armor Creation Methods: + *
Special methods for creating and coloring leather armor: + *
• {@link #createLeatherArmor(Material, Color)} + *
• {@link #createLeatherArmor(Material, String, Color, List)} + *
• {@link #createLeatherArmor(Material, String, Color, List, Enchantment, Integer)} + *
• {@link #createLeatherArmor(Material, String, Color, List, Enchantment, Integer, Enchantment, Integer)} + *
• {@link #createLeatherArmor(Material, String, Color, List, Enchantment, Integer, Enchantment, Integer, Enchantment, Integer)} + * + *

Skull Creation Methods: + *
Utility methods to create player and custom skulls: + *
• {@link #createPlayerHead(String, String)} + *
• {@link #createPlayerHead(String, String, List)} + *
• {@link #createPlayerHead(String, String, int, List)} + * + *

Item Editing Methods: + *
Modify existing {@link ItemStack} objects: + *
• {@link #edit(ItemStack, Material)} + *
• {@link #edit(ItemStack, int)} + *
• {@link #edit(ItemStack, String)} + *
• {@link #edit(ItemStack, int, String)} + *
• {@link #edit(ItemStack, List)} + *
• {@link #edit(ItemStack, int, String, List)} + * + * @author MineFact + * @version 1.3.2 + */ +@SuppressWarnings({"deprecation", "unused"}) public class Item { - public static final Map nonPlayerSkulls = new HashMap<>(); + public static final Map nonPlayerSkulls = new ConcurrentHashMap<>(); + + private final Material material; - private ItemStack item; - private Material material; private String displayName; - private int amount = -1; - private List lore; - private boolean hideAttributes; - private boolean hideEnchantments; - private final List canDestroyItems = new ArrayList<>(); - private final List canPlaceItems = new ArrayList<>(); - private final HashMap enchantments = new HashMap<>(); + private int amount = 1; - public Item() {} + private List lore; - public Item(Material material) { - this.material = material; - } + private boolean hideAttributes; - public Item(ItemStack item) { - this.item = item; - } + private boolean hideEnchantments; + + private final Map enchantments = new HashMap<>(); - public Item setType(Material material) { + public Item(Material material) { this.material = material; - return this; } public Item setDisplayName(String name) { @@ -80,247 +140,173 @@ public Item hideEnchantments(boolean enchants) { return this; } - public Item addCanDestroyItem(String itemName){ - this.canDestroyItems.add(itemName); - return this; - } - - public Item addCanPlaceItem(String itemName){ - this.canPlaceItems.add(itemName); - return this; - } - public ItemStack build() { - ItemStack item = XMaterial.BARRIER.parseItem(); - - if(this.material != null) - item.setType(material); - - if(this.item != null) - item = this.item.clone(); - - if(this.amount != -1) - item.setAmount(this.amount); - else - item.setAmount(1); - - if (item.getEnchantments().isEmpty()) - for (Map.Entry en : this.enchantments.entrySet()) - item.addUnsafeEnchantment(en.getKey(), en.getValue()); - + ItemStack item = new ItemStack(this.material); + item.setAmount(this.amount); + for (Enchantment en : this.enchantments.keySet()) + item.addUnsafeEnchantment(en, this.enchantments.get(en)); ItemMeta itemmeta = item.getItemMeta(); + itemmeta.setDisplayName(this.displayName); + itemmeta.setLore(this.lore); + if (this.hideAttributes) itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); + if (this.hideEnchantments) itemmeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); + item.setItemMeta(itemmeta); + return item; + } - if(this.displayName != null) - itemmeta.setDisplayName(this.displayName); - - if(this.lore != null) - itemmeta.setLore(this.lore); - - if (this.hideAttributes) - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - if (this.hideEnchantments) - itemmeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); - - /*if(!canDestroyItems.isEmpty()){ - // TODO Marked for removal in 1.20.6, not fixed yet. - //Set nameSpacedKeySet = new HashSet<>(); - //for(String itemName : canDestroyItems) - // nameSpacedKeySet.add(NamespacedKey.minecraft(itemName)); - //itemmeta.setDestroyableKeys(nameSpacedKeySet); - } - - if(!canPlaceItems.isEmpty()){ - // TODO Marked for removal in 1.20.6, not fixed yet. - //Set nameSpacedKeySet = new HashSet<>(); - //for(String itemName : canPlaceItems) - // nameSpacedKeySet.add(NamespacedKey.minecraft(itemName)); - //itemmeta.setPlaceableKeys(nameSpacedKeySet); - }*/ + private static ItemStack createItem(Material material, String name, int amount, List lore, + Map enchantments) { + ItemStack item = new ItemStack(material, amount); + if (enchantments != null) + for (Map.Entry e : enchantments.entrySet()) + item.addUnsafeEnchantment(e.getKey(), e.getValue()); + + ItemMeta meta = item.getItemMeta(); + if (name != null) + meta.setDisplayName(name); + if (lore != null) + meta.setLore(lore); + meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); + item.setItemMeta(meta); + return item; + } - item.setItemMeta(itemmeta); + private static ItemStack createLeatherArmorItem(Material material, String name, Color color, + List lore, Map enchantments) { + ItemStack item = new ItemStack(material); + if (enchantments != null) + for (Map.Entry e : enchantments.entrySet()) + item.addUnsafeEnchantment(e.getKey(), e.getValue()); + + + LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta(); + if (name != null) + meta.setDisplayName(name); + if (lore != null) + meta.setLore(lore); + meta.setColor(color); + meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); + item.setItemMeta(meta); return item; } - public static ItemStack create(Material material) { + @Contract("_ -> new") + public static @NonNull ItemStack create(Material material) { return new ItemStack(material); } - public static ItemStack create(Material material, int amount) { + @Contract("_, _ -> new") + public static @NonNull ItemStack create(Material material, int amount) { return new ItemStack(material, amount); } - public static ItemStack create(Material material, String name) { - ItemStack item = new ItemStack(material, 1); - return edit(item, name); + public static @NonNull ItemStack create(Material material, String name) { + return createItem(material, name, 1, null, null); } - public static ItemStack create(Material material, String name, int amount) { - ItemStack item = new ItemStack(material, amount); - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack create(Material material, String name, int amount) { + return createItem(material, name, amount, null, null); } - public static @NotNull ItemStack create(Material material, String name, List lore) { - ItemStack item = new ItemStack(material, 1, (short)0); - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack create(Material material, String name, List lore) { + return createItem(material, name, 1, lore, null); } - public static @NotNull ItemStack create(Material material, String name, short durability, List lore) { - ItemStack item = new ItemStack(material, 1, durability); - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); + public static @NonNull ItemStack create(Material material, String name, short durability, List lore) { + ItemStack item = createItem(material, name, 1, lore, null); + item.setDurability(durability); return item; } - public static @NotNull ItemStack create(Material material, String name, int amount, List lore) { - ItemStack item = new ItemStack(material, amount); - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack create(Material material, String name, int amount, List lore) { + return createItem(material, name, amount, lore, null); } - public static @NotNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore) { - ItemStack item = new ItemStack(material); - LeatherArmorMeta itemmeta = (LeatherArmorMeta)item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.setColor(color); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore) { + return createLeatherArmorItem(material, name, color, lore, null); } - public static @NotNull ItemStack create(Material material, String name, List lore, Enchantment enchnt1, Integer level1) { - ItemStack item = new ItemStack(material); - item.addUnsafeEnchantment(enchnt1, level1); - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack create(Material material, String name, List lore, Enchantment enchantment1, Integer level1) { + Map enchantments = new HashMap<>(); + enchantments.put(enchantment1, level1); + return createItem(material, name, 1, lore, enchantments); } - public static @NotNull ItemStack create(Material material, String name, List lore, Enchantment enchnt1, Integer level1, Enchantment enchnt2, Integer level2) { - ItemStack item = new ItemStack(material); - item.addUnsafeEnchantment(enchnt1, level1); - item.addUnsafeEnchantment(enchnt2, level2); - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack create(Material material, String name, List lore, Enchantment enchantment, Integer level1, Enchantment enchantment2, Integer level2) { + Map enchantments = new HashMap<>(); + enchantments.put(enchantment, level1); + enchantments.put(enchantment2, level2); + return createItem(material, name, 1, lore, enchantments); } - public static @NotNull ItemStack create(Material material, String name, List lore, Enchantment enchnt1, Integer level1, Enchantment enchnt2, Integer level2, Enchantment enchnt3, Integer level3) { - ItemStack item = new ItemStack(material); - item.addUnsafeEnchantment(enchnt1, level1); - item.addUnsafeEnchantment(enchnt2, level2); - item.addUnsafeEnchantment(enchnt3, level3); - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack create(Material material, String name, List lore, Enchantment enchantment, Integer level1, Enchantment enchantment2, Integer level2, Enchantment enchantment3, Integer level3) { + Map enchantments = new HashMap<>(); + enchantments.put(enchantment, level1); + enchantments.put(enchantment2, level2); + enchantments.put(enchantment3, level3); + return createItem(material, name, 1, lore, enchantments); } - public static @NotNull ItemStack createLeatherArmor(Material material, Color color) { + public static @NonNull ItemStack createLeatherArmor(Material material, Color color) { + LeatherArmorMeta itemMeta = (LeatherArmorMeta) new ItemStack(material).getItemMeta(); + itemMeta.setColor(color); + itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); ItemStack item = new ItemStack(material); - LeatherArmorMeta itemmeta = (LeatherArmorMeta)item.getItemMeta(); - itemmeta.setColor(color); - item.setItemMeta(itemmeta); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); + item.setItemMeta(itemMeta); return item; } - public static @NotNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore, Enchantment enchnt1, Integer level1) { - ItemStack item = new ItemStack(material); - item.addUnsafeEnchantment(enchnt1, level1); - LeatherArmorMeta itemmeta = (LeatherArmorMeta)item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.setColor(color); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore, Enchantment enchantment, Integer level1) { + Map enchantments = new HashMap<>(); + enchantments.put(enchantment, level1); + return createLeatherArmorItem(material, name, color, lore, enchantments); } - public static @NotNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore, Enchantment enchnt1, Integer level1, Enchantment enchnt2, Integer level2) { - ItemStack item = new ItemStack(material); - item.addUnsafeEnchantment(enchnt1, level1); - item.addUnsafeEnchantment(enchnt2, level2); - LeatherArmorMeta itemmeta = (LeatherArmorMeta)item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.setColor(color); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore, Enchantment enchantment, Integer level1, Enchantment enchantment2, Integer level2) { + Map enchantments = new HashMap<>(); + enchantments.put(enchantment, level1); + enchantments.put(enchantment2, level2); + return createLeatherArmorItem(material, name, color, lore, enchantments); } - public static @NotNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore, Enchantment enchnt1, Integer level1, Enchantment enchnt2, Integer level2, Enchantment enchnt3, Integer level3) { - ItemStack item = new ItemStack(material); - item.addUnsafeEnchantment(enchnt1, level1); - item.addUnsafeEnchantment(enchnt2, level2); - item.addUnsafeEnchantment(enchnt3, level3); - LeatherArmorMeta itemmeta = (LeatherArmorMeta)item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setLore(lore); - itemmeta.setColor(color); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; + public static @NonNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore, Enchantment enchantment, Integer level1, Enchantment enchantment2, Integer level2, Enchantment enchantment3, Integer level3) { + Map enchantments = new HashMap<>(); + enchantments.put(enchantment, level1); + enchantments.put(enchantment2, level2); + enchantments.put(enchantment3, level3); + return createLeatherArmorItem(material, name, color, lore, enchantments); } - public static @Nullable ItemStack createPlayerHead(String name, String owner) { - ItemStack item = XMaterial.PLAYER_HEAD.parseItem(); - - if(item == null) - return null; - - SkullMeta itemmeta = (SkullMeta)item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setOwner(owner); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); + public static @NonNull ItemStack createPlayerHead(String name, String owner) { + ItemStack item = new ItemStack(Material.PLAYER_HEAD); + SkullMeta itemMeta = (SkullMeta) item.getItemMeta(); + itemMeta.setDisplayName(name); + itemMeta.setOwningPlayer(Bukkit.getOfflinePlayer(owner)); + itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); + item.setItemMeta(itemMeta); return item; } - public static @Nullable ItemStack createPlayerHead(String name, String owner, List lore) { - ItemStack item = XMaterial.PLAYER_HEAD.parseItem(); - - if(item == null) - return null; - - SkullMeta itemmeta = (SkullMeta)item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.setOwner(owner); - itemmeta.setLore(lore); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); + public static @NonNull ItemStack createPlayerHead(String name, String owner, List lore) { + ItemStack item = new ItemStack(Material.PLAYER_HEAD); + SkullMeta itemMeta = (SkullMeta) item.getItemMeta(); + itemMeta.setDisplayName(name); + itemMeta.setOwningPlayer(Bukkit.getOfflinePlayer(owner)); + itemMeta.setLore(lore); + itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); + item.setItemMeta(itemMeta); return item; } + public static @NonNull ItemStack createPlayerHead(String name, String owner, int amount, List lore) { + var item = createPlayerHead(name, owner, lore); + return edit(item, amount); + } + @Contract("_, _ -> param1") - public static @NotNull ItemStack edit(@NotNull ItemStack item, Material material) { + public static @NotNull ItemStack edit(@NotNull ItemStack item, Material material) { item.setType(material); return item; } @@ -409,12 +395,12 @@ public static String getUniqueMaterialString(XMaterial[] materials) { public static @Nullable XMaterial convertStringToXMaterial(String materialString) { XMaterial material; - if(XMaterial.matchXMaterial(materialString).isPresent()) + if (XMaterial.matchXMaterial(materialString).isPresent()) material = XMaterial.matchXMaterial(materialString).get(); else { Material mat = Material.matchMaterial(materialString); - if(mat != null) + if (mat != null) material = XMaterial.matchXMaterial(mat); else return null; From fd51154c867f8340eabe8b7a50ef8e6a2d3e8f69 Mon Sep 17 00:00:00 2001 From: MineFact Date: Fri, 18 Jul 2025 13:25:37 +0200 Subject: [PATCH 16/37] feat(util): Update Item Utils to 1.3.3 --- .../java/net/buildtheearth/utils/Item.java | 57 ++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/src/main/java/net/buildtheearth/utils/Item.java b/src/main/java/net/buildtheearth/utils/Item.java index 71fda7fc..ce7d2976 100644 --- a/src/main/java/net/buildtheearth/utils/Item.java +++ b/src/main/java/net/buildtheearth/utils/Item.java @@ -5,7 +5,6 @@ import com.cryptomorin.xseries.profiles.objects.Profileable; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; -import net.buildtheearth.modules.common.CommonModule; import org.bukkit.Bukkit; import org.bukkit.Color; import org.bukkit.Material; @@ -34,6 +33,7 @@ *
    *
  1. Bukkit API
  2. *
  3. HeadDatabaseAPI
  4. (removed for BuildTeamTools) + *
  5. XMaterial from XSeries
  6. *
* *
@@ -85,8 +85,16 @@ *
• {@link #edit(ItemStack, List)} *
• {@link #edit(ItemStack, int, String, List)} * - * @author MineFact - * @version 1.3.2 + *

Material Conversion Utilities: + *
Utility methods to convert between {@link Material}, {@link XMaterial}, and {@link ItemStack} representations: + *
• {@link #fromUniqueMaterialString(String)} – Converts a namespaced string to an {@link ItemStack}. + *
• {@link #getUniqueMaterialString(ItemStack)} – Gets the namespaced key of an {@link ItemStack}'s material. + *
• {@link #getUniqueMaterialString(XMaterial)} – Gets the namespaced key of an {@link XMaterial}. + *
• {@link #getUniqueMaterialString(XMaterial[])} – Gets a comma-separated list of namespaced keys from multiple {@link XMaterial}s. + *
• {@link #convertStringToXMaterial(String)} – Converts a string to an {@link XMaterial}, fallback to Bukkit {@link Material} if needed. + * + * @version 1.3.3 + * @author MineFact, Zoriot */ @SuppressWarnings({"deprecation", "unused"}) public class Item { @@ -156,6 +164,13 @@ public ItemStack build() { return item; } + + // ============================== + // SECTION: Item Creation Methods + // ============================== + + + private static ItemStack createItem(Material material, String name, int amount, List lore, Map enchantments) { ItemStack item = new ItemStack(material, amount); @@ -279,6 +294,10 @@ private static ItemStack createLeatherArmorItem(Material material, String name, return createLeatherArmorItem(material, name, color, lore, enchantments); } + // ============================== + // SECTION: Skull Creation Methods + // ============================== + public static @NonNull ItemStack createPlayerHead(String name, String owner) { ItemStack item = new ItemStack(Material.PLAYER_HEAD); SkullMeta itemMeta = (SkullMeta) item.getItemMeta(); @@ -305,6 +324,10 @@ private static ItemStack createLeatherArmorItem(Material material, String name, return edit(item, amount); } + // ============================== + // SECTION: Item Editing Methods + // ============================== + @Contract("_, _ -> param1") public static @NotNull ItemStack edit(@NotNull ItemStack item, Material material) { item.setType(material); @@ -356,6 +379,10 @@ private static ItemStack createLeatherArmorItem(Material material, String name, return item; } + // ====================================== + // SECTION: Material Conversion Utilities + // ====================================== + public static @Nullable ItemStack fromUniqueMaterialString(String materialString) { Material material = Material.matchMaterial(materialString); if(material != null) @@ -368,20 +395,24 @@ private static ItemStack createLeatherArmorItem(Material material, String name, return null; } - public static @NotNull String getUniqueMaterialString(ItemStack item) { - if(CommonModule.getInstance().getVersionComponent().is_1_12()) - return XMaterial.matchXMaterial(item).getId() + ":" + XMaterial.matchXMaterial(item).getData(); - else - return item.getType().getKey().asString(); - + public static String getUniqueMaterialString(ItemStack item) { + return item.getType().getKey().asString(); } - public static @NotNull String getUniqueMaterialString(@NotNull XMaterial material) { - return getUniqueMaterialString(material.parseItem()); + + public static String getUniqueMaterialString(XMaterial material) { + if (material == null) + return null; + + ItemStack item = material.parseItem(); + if (item == null) + return null; + + return getUniqueMaterialString(item); } public static String getUniqueMaterialString(XMaterial[] materials) { - if(materials == null || materials.length == 0) + if (materials == null || materials.length == 0) return null; StringBuilder s = new StringBuilder(getUniqueMaterialString(materials[0])); @@ -392,7 +423,7 @@ public static String getUniqueMaterialString(XMaterial[] materials) { return s.toString(); } - public static @Nullable XMaterial convertStringToXMaterial(String materialString) { + public static XMaterial convertStringToXMaterial(String materialString) { XMaterial material; if (XMaterial.matchXMaterial(materialString).isPresent()) From 8a6e95bbc61268e14fa117bb61037ea29bc8f54d Mon Sep 17 00:00:00 2001 From: MineFact Date: Fri, 18 Jul 2025 13:45:50 +0200 Subject: [PATCH 17/37] feat(util): Update Item Utils to 1.3.4 --- .../components/field/menu/FenceTypeMenu.java | 2 +- .../components/house/HouseScripts.java | 8 +- .../components/house/menu/BaseColorMenu.java | 4 +- .../components/house/menu/RoofColorMenu.java | 6 +- .../components/house/menu/WallColorMenu.java | 6 +- .../road/menu/AdvancedColorMenu.java | 4 +- .../components/road/menu/RoadColorMenu.java | 6 +- .../road/menu/SidewalkColorMenu.java | 4 +- .../java/net/buildtheearth/utils/Item.java | 80 ++++++++++++------- 9 files changed, 69 insertions(+), 51 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java index 07350dff..d467b02e 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java @@ -33,7 +33,7 @@ protected void setItemClickEventsAsync() { return; FieldSettings fieldSettings = (FieldSettings) settings; - fieldSettings.setValue(FieldFlag.FENCE, Item.createStringFromItemList(selectedMaterials)); + fieldSettings.setValue(FieldFlag.FENCE, Item.createStringFromItemStringList(selectedMaterials)); clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java index f2fb1eab..22589392 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java @@ -506,7 +506,7 @@ public void buildscript_v_1_2(){ BlockState[] doubleSlabs = new BlockState[roofColor.length]; for(int i = 0; i < roofColor.length; i++){ - BlockType bt = Item.convertXMaterialToBlockType(roofColor[i]); + BlockType bt = Item.convertXMaterialToWEBlockType(roofColor[i]); if(bt == null) continue; @@ -729,7 +729,7 @@ else if(property.getName().equalsIgnoreCase("shape")) // Convert all stair blocks to the correct orientation BlockState[] stairsWithOrientation = new BlockState[roofColor.length]; for(int i = 0; i < roofColor.length; i++){ - BlockType bt = Item.convertXMaterialToBlockType(roofColor[i]); + BlockType bt = Item.convertXMaterialToWEBlockType(roofColor[i]); if(bt == null) continue; @@ -760,7 +760,7 @@ else if(property.getName().equalsIgnoreCase("shape")) BlockState[] doubleSlabs = new BlockState[roofColor.length]; for(int i = 0; i < roofColor.length; i++){ - BlockType bt = Item.convertXMaterialToBlockType(roofColor[i]); + BlockType bt = Item.convertXMaterialToWEBlockType(roofColor[i]); if(bt == null) continue; @@ -768,7 +768,7 @@ else if(property.getName().equalsIgnoreCase("shape")) doubleSlabs[i] = getSlab(bt, "double"); } - replaceBlocks(Item.convertXMaterialToBlockType(XMaterial.DISPENSER).getDefaultState(), doubleSlabs); + replaceBlocks(Item.convertXMaterialToWEBlockType(XMaterial.DISPENSER).getDefaultState(), doubleSlabs); // Finish the script finish(blocks, selectionPoints); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java index b8e8468a..b5397c67 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java @@ -1,9 +1,9 @@ package net.buildtheearth.modules.generator.components.house.menu; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.modules.generator.components.house.HouseFlag; import net.buildtheearth.modules.generator.components.house.HouseSettings; +import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; @@ -31,7 +31,7 @@ protected void setItemClickEventsAsync() { return; HouseSettings houseSettings = (HouseSettings) settings; - houseSettings.setValue(HouseFlag.BASE_COLOR, Item.createStringFromItemList(selectedMaterials)); + houseSettings.setValue(HouseFlag.BASE_COLOR, Item.createStringFromItemStringList(selectedMaterials)); clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java index 390c16d6..a4062e35 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java @@ -1,20 +1,18 @@ package net.buildtheearth.modules.generator.components.house.menu; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.modules.generator.components.house.HouseFlag; import net.buildtheearth.modules.generator.components.house.HouseSettings; import net.buildtheearth.modules.generator.components.house.RoofType; +import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; -import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; public class RoofColorMenu extends BlockListMenu { @@ -38,7 +36,7 @@ protected void setItemClickEventsAsync() { return; HouseSettings houseSettings = (HouseSettings) settings; - houseSettings.setValue(HouseFlag.ROOF_COLOR, Item.createStringFromItemList(selectedMaterials)); + houseSettings.setValue(HouseFlag.ROOF_COLOR, Item.createStringFromItemStringList(selectedMaterials)); clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java index 408ef2a5..04f47b08 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.generator.components.house.menu; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.menu.GeneratorMenu; -import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.modules.generator.components.house.HouseFlag; import net.buildtheearth.modules.generator.components.house.HouseSettings; +import net.buildtheearth.modules.generator.menu.GeneratorMenu; +import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; @@ -32,7 +32,7 @@ protected void setItemClickEventsAsync() { return; HouseSettings houseSettings = (HouseSettings) settings; - houseSettings.setValue(HouseFlag.WALL_COLOR, Item.createStringFromItemList(selectedMaterials)); + houseSettings.setValue(HouseFlag.WALL_COLOR, Item.createStringFromItemStringList(selectedMaterials)); clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java index 4cda5a9d..17cbf25e 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java @@ -1,9 +1,9 @@ package net.buildtheearth.modules.generator.components.road.menu; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.modules.generator.components.road.RoadFlag; import net.buildtheearth.modules.generator.components.road.RoadSettings; +import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.utils.Item; import net.buildtheearth.utils.menus.BlockListMenu; import org.bukkit.Sound; @@ -35,7 +35,7 @@ protected void setItemClickEventsAsync() { return; RoadSettings roadSettings = (RoadSettings) settings; - roadSettings.setValue(roadFlag, Item.createStringFromItemList(selectedMaterials)); + roadSettings.setValue(roadFlag, Item.createStringFromItemStringList(selectedMaterials)); clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java index 6de0d1a6..c29ad8d3 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.generator.components.road.menu; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.menu.GeneratorMenu; -import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.modules.generator.components.road.RoadFlag; import net.buildtheearth.modules.generator.components.road.RoadSettings; +import net.buildtheearth.modules.generator.menu.GeneratorMenu; +import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; @@ -32,7 +32,7 @@ protected void setItemClickEventsAsync() { return; RoadSettings roadSettings = (RoadSettings) settings; - roadSettings.setValue(RoadFlag.ROAD_MATERIAL, Item.createStringFromItemList(selectedMaterials)); + roadSettings.setValue(RoadFlag.ROAD_MATERIAL, Item.createStringFromItemStringList(selectedMaterials)); clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java index 058797e2..7dbdde83 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java @@ -1,9 +1,9 @@ package net.buildtheearth.modules.generator.components.road.menu; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.modules.generator.components.road.RoadFlag; import net.buildtheearth.modules.generator.components.road.RoadSettings; +import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; @@ -32,7 +32,7 @@ protected void setItemClickEventsAsync() { return; RoadSettings roadSettings = (RoadSettings) settings; - roadSettings.setValue(RoadFlag.SIDEWALK_MATERIAL, Item.createStringFromItemList(selectedMaterials)); + roadSettings.setValue(RoadFlag.SIDEWALK_MATERIAL, Item.createStringFromItemStringList(selectedMaterials)); clickPlayer.closeInventory(); clickPlayer.playSound(clickPlayer.getLocation(), Sound.UI_BUTTON_CLICK, 1.0F, 1.0F); diff --git a/src/main/java/net/buildtheearth/utils/Item.java b/src/main/java/net/buildtheearth/utils/Item.java index ce7d2976..0b37f465 100644 --- a/src/main/java/net/buildtheearth/utils/Item.java +++ b/src/main/java/net/buildtheearth/utils/Item.java @@ -19,10 +19,7 @@ import org.jetbrains.annotations.Nullable; import org.jspecify.annotations.NonNull; -import java.util.Base64; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; /** @@ -70,12 +67,6 @@ *
• {@link #createLeatherArmor(Material, String, Color, List, Enchantment, Integer, Enchantment, Integer)} *
• {@link #createLeatherArmor(Material, String, Color, List, Enchantment, Integer, Enchantment, Integer, Enchantment, Integer)} * - *

Skull Creation Methods: - *
Utility methods to create player and custom skulls: - *
• {@link #createPlayerHead(String, String)} - *
• {@link #createPlayerHead(String, String, List)} - *
• {@link #createPlayerHead(String, String, int, List)} - * *

Item Editing Methods: *
Modify existing {@link ItemStack} objects: *
• {@link #edit(ItemStack, Material)} @@ -92,15 +83,26 @@ *
• {@link #getUniqueMaterialString(XMaterial)} – Gets the namespaced key of an {@link XMaterial}. *
• {@link #getUniqueMaterialString(XMaterial[])} – Gets a comma-separated list of namespaced keys from multiple {@link XMaterial}s. *
• {@link #convertStringToXMaterial(String)} – Converts a string to an {@link XMaterial}, fallback to Bukkit {@link Material} if needed. + *
• {@link #convertXMaterialToWEBlockType(XMaterial)} – Converts an {@link XMaterial} to a WorldEdit {@link BlockType}. + *
• {@link #createStringFromItemStringList(ArrayList)} – Converts a list of material strings to a comma-separated namespaced material string. + *
• {@link #createStringFromItemStringList(String...)} – Converts an array of material strings to a comma-separated namespaced material string. + * + *

Skull Creation Methods: + *
Utility methods to create player and custom skulls: + *
• {@link #createPlayerHead(String, String)} + *
• {@link #createPlayerHead(String, String, List)} + *
• {@link #createPlayerHead(String, String, int, List)} * - * @version 1.3.3 + * @version 1.3.4 * @author MineFact, Zoriot */ @SuppressWarnings({"deprecation", "unused"}) public class Item { public static final Map nonPlayerSkulls = new ConcurrentHashMap<>(); - private final Material material; + private ItemStack item; + + private Material material; private String displayName; @@ -118,6 +120,10 @@ public Item(Material material) { this.material = material; } + public Item(ItemStack item) { + this.item = item; + } + public Item setDisplayName(String name) { this.displayName = name; return this; @@ -149,7 +155,12 @@ public Item hideEnchantments(boolean enchants) { } public ItemStack build() { - ItemStack item = new ItemStack(this.material); + ItemStack item; + if (this.item != null) + item = this.item.clone(); + else + item = new ItemStack(this.material); + item.setAmount(this.amount); for (Enchantment en : this.enchantments.keySet()) @@ -170,9 +181,8 @@ public ItemStack build() { // ============================== - - private static ItemStack createItem(Material material, String name, int amount, List lore, - Map enchantments) { + private static @NonNull ItemStack createItem(Material material, String name, int amount, List lore, + Map enchantments) { ItemStack item = new ItemStack(material, amount); if (enchantments != null) for (Map.Entry e : enchantments.entrySet()) @@ -188,8 +198,8 @@ private static ItemStack createItem(Material material, String name, int amount, return item; } - private static ItemStack createLeatherArmorItem(Material material, String name, Color color, - List lore, Map enchantments) { + private static @NonNull ItemStack createLeatherArmorItem(Material material, String name, Color color, + List lore, Map enchantments) { ItemStack item = new ItemStack(material); if (enchantments != null) for (Map.Entry e : enchantments.entrySet()) @@ -395,8 +405,8 @@ private static ItemStack createLeatherArmorItem(Material material, String name, return null; } - public static String getUniqueMaterialString(ItemStack item) { - return item.getType().getKey().asString(); + public static @NonNull String getUniqueMaterialString(@NonNull ItemStack item) { + return item.getType().name(); } @@ -423,7 +433,7 @@ public static String getUniqueMaterialString(XMaterial[] materials) { return s.toString(); } - public static XMaterial convertStringToXMaterial(String materialString) { + public static @org.jspecify.annotations.Nullable XMaterial convertStringToXMaterial(String materialString) { XMaterial material; if (XMaterial.matchXMaterial(materialString).isPresent()) @@ -440,11 +450,11 @@ public static XMaterial convertStringToXMaterial(String materialString) { return material; } - public static BlockType convertXMaterialToBlockType(XMaterial material) { + public static BlockType convertXMaterialToWEBlockType(XMaterial material) { String mat = getUniqueMaterialString(material); BlockType bt; - if(mat.contains("minecraft:")) + if (mat.contains("minecraft:")) bt = BlockTypes.parse(mat); else bt = BlockTypes.get(mat); @@ -452,19 +462,29 @@ public static BlockType convertXMaterialToBlockType(XMaterial material) { return bt; } - public static @NotNull String createStringFromItemList(@NotNull List items) throws IllegalArgumentException { - StringBuilder s = new StringBuilder(items.getFirst()); + public static @NonNull String createStringFromItemStringList(@NonNull List items) throws IllegalArgumentException { + StringBuilder s = new StringBuilder(); - for (int i = 1; i < items.size(); i++) - if(XMaterial.matchXMaterial(items.get(i)).isPresent()) { - XMaterial xMaterial = XMaterial.matchXMaterial(items.get(i)).get(); + for (int i = 0; i < items.size(); i++) + if (XMaterial.matchXMaterial(items.get(i)).isPresent()) { + var curItem = items.get(i); + var material = XMaterial.matchXMaterial(curItem); + XMaterial xMaterial = material.get(); + ItemStack item = xMaterial.parseItem(); - s.append(",").append(getUniqueMaterialString(xMaterial.parseItem())); - } + if (item == null) + continue; + if (i > 0) s.append(","); + s.append(getUniqueMaterialString(item)); + } return s.toString(); } + public static @NonNull String createStringFromItemStringList(String... items) throws IllegalArgumentException { + return createStringFromItemStringList(new ArrayList<>(Arrays.asList(items))); + } + public static ItemStack createCustomHeadTextureURL(String url, String name, List lore) { byte[] encodedByteData = Base64.getEncoder().encode(String.format("{textures:{SKIN:{url:\"%s\"}}}", url).getBytes()); String encodedData = new String(encodedByteData); From 90d8b41e5ea6bc648d9fcf9db243351b07054f7c Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sun, 11 Jan 2026 20:34:01 +0100 Subject: [PATCH 18/37] =?UTF-8?q?refactor(build):=20=E2=9C=A8=20remove=20u?= =?UTF-8?q?nused=20authlib=20dependency=20from=20build=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index c9a1b3a3..b5fb1595 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -80,7 +80,6 @@ dependencies { } implementation(libs.com.googlecode.json.simple) compileOnly(libs.io.papermc.paper.paper.api) - compileOnly(libs.com.mojang.authlib) compileOnly(libs.com.fastasyncworldedit.fastasyncworldedit.core) compileOnly(libs.com.fastasyncworldedit.fastasyncworldedit.bukkit) } From 8f238c86dd322785c71dab759d97da9dfea24804 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sun, 11 Jan 2026 22:07:57 +0100 Subject: [PATCH 19/37] =?UTF-8?q?refactor(all):=20=E2=9C=A8=20extract=20ut?= =?UTF-8?q?ilities=20into=20alps-lib?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle/libs.versions.toml | 2 +- .../net/buildtheearth/modules/Module.java | 3 +- .../buildtheearth/modules/ModuleHandler.java | 2 +- .../buildtheearth/modules/WikiDocumented.java | 22 - .../modules/common/CommonModule.java | 2 + .../commands/BuildTeamToolsCommand.java | 8 +- .../PluginMessagingComponent.java | 2 +- .../common/listeners/CommandListener.java | 2 +- .../modules/generator/GeneratorModule.java | 4 + .../generator/commands/GeneratorCommand.java | 2 +- .../generator/components/field/Field.java | 2 +- .../components/field/FieldScripts.java | 2 +- .../components/field/FieldSettings.java | 1 - .../components/field/menu/CropStageMenu.java | 2 +- .../components/field/menu/CropTypeMenu.java | 2 +- .../components/field/menu/FenceTypeMenu.java | 2 +- .../generator/components/house/House.java | 2 +- .../components/house/HouseScripts.java | 4 +- .../components/house/menu/BaseColorMenu.java | 2 +- .../components/house/menu/RoofColorMenu.java | 2 +- .../components/house/menu/RoofTypeMenu.java | 5 +- .../components/house/menu/WallColorMenu.java | 2 +- .../generator/components/kml/KmlCommand.java | 38 +- .../generator/components/rail/Rail.java | 2 +- .../components/rail/RailScripts.java | 2 +- .../generator/components/road/Road.java | 2 +- .../components/road/RoadScripts.java | 4 +- .../components/road/RoadSettings.java | 5 +- .../road/menu/AdvancedColorMenu.java | 2 +- .../road/menu/AdvancedSettingsMenu.java | 4 +- .../components/road/menu/RoadColorMenu.java | 2 +- .../road/menu/SidewalkColorMenu.java | 2 +- .../generator/components/tree/Tree.java | 2 +- .../components/tree/TreeScripts.java | 2 +- .../components/tree/menu/TreeHeightMenu.java | 2 +- .../components/tree/menu/TreeTypeMenu.java | 2 +- .../components/tree/menu/TreeWidthMenu.java | 2 +- .../listeners/GeneratorListener.java | 2 +- .../modules/generator/menu/GeneratorMenu.java | 2 +- .../modules/generator/model/Command.java | 4 +- .../modules/generator/model/FlagType.java | 4 +- .../generator/model/GeneratorCollections.java | 2 +- .../generator/model/GeneratorComponent.java | 4 +- .../modules/generator/model/History.java | 5 +- .../modules/generator/model/Script.java | 2 +- .../modules/generator/model/Settings.java | 3 +- .../generator/utils/GeneratorUtils.java | 1885 ----------------- .../ChoosePaletteBlocksMenu.java | 4 +- .../blockpalettegui/ChoosePaletteMenu.java | 2 +- .../blockpalettegui/CreatePaletteMenu.java | 2 +- .../blockpalettegui/EditPaletteMenu.java | 2 +- .../blockpalettegui/PaletteBlockListMenu.java | 2 +- .../modules/navigation/NavUtils.java | 2 +- .../navigator/NavigatorComponent.java | 4 +- .../navigator/commands/BuildteamCommand.java | 2 +- .../navigator/commands/NavigatorCommand.java | 4 +- .../components/tpll/TpllComponent.java | 2 +- .../tpll/listeners/TpllJoinListener.java | 2 +- .../tpll/listeners/TpllListener.java | 2 +- .../components/warps/WarpsComponent.java | 2 +- .../warps/commands/WarpCommand.java | 2 +- .../warps/listeners/WarpJoinListener.java | 2 +- .../warps/menu/AddressTypeSelectionMenu.java | 2 +- .../warps/menu/MaterialSelectionMenu.java | 10 +- .../components/warps/menu/WarpEditMenu.java | 8 +- .../warps/menu/WarpGroupEditMenu.java | 8 +- .../components/warps/menu/WarpGroupMenu.java | 4 +- .../components/warps/menu/WarpMenu.java | 2 +- .../components/warps/model/Warp.java | 5 +- .../components/warps/model/WarpGroup.java | 2 +- .../navigation/menu/CountrySelectorMenu.java | 4 +- .../modules/navigation/menu/ExploreMenu.java | 4 +- .../modules/navigation/menu/MainMenu.java | 11 +- .../navigation/menu/StateSelectorMenu.java | 4 +- .../modules/network/api/NetworkAPI.java | 2 +- .../modules/network/api/OpenStreetMapAPI.java | 2 +- .../modules/network/model/BuildTeam.java | 2 +- .../modules/stats/menu/StatsMenu.java | 2 +- .../net/buildtheearth/utils/ChatHelper.java | 165 -- .../net/buildtheearth/utils/CustomHeads.java | 1 + .../java/net/buildtheearth/utils/Item.java | 513 ----- .../net/buildtheearth/utils/MenuItems.java | 1 + .../utils/menus/AbstractMenu.java | 3 +- .../utils/menus/BlockListMenu.java | 2 +- .../buildtheearth/utils/menus/BookMenu.java | 3 +- .../utils/menus/NameListMenu.java | 2 +- 86 files changed, 135 insertions(+), 2726 deletions(-) delete mode 100644 src/main/java/net/buildtheearth/modules/WikiDocumented.java delete mode 100644 src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java delete mode 100644 src/main/java/net/buildtheearth/utils/ChatHelper.java delete mode 100644 src/main/java/net/buildtheearth/utils/Item.java diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1004ecaa..3a764c30 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -21,7 +21,7 @@ com-googlecode-json-simple = "1.1.1" # https://mvnrepository.com/artifact/com.go com-palantir-git-version = "4.0.0" com-gradleup-shadow = "9.3.0" alpslib-io = "1.2.0" -alpslib-utils = "1.3.8" +alpslib-utils = "1.4.0" [libraries] com-alpsbte-alpslib-alpslib-libpsterra = { module = "com.alpsbte.alpslib:alpslib-libpsterra", version.ref = "com-alpsbte-alpslib-alpslib-libpsterra" } diff --git a/src/main/java/net/buildtheearth/modules/Module.java b/src/main/java/net/buildtheearth/modules/Module.java index a056a14c..f6ab58aa 100644 --- a/src/main/java/net/buildtheearth/modules/Module.java +++ b/src/main/java/net/buildtheearth/modules/Module.java @@ -1,9 +1,10 @@ package net.buildtheearth.modules; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.WikiDocumented; import lombok.Getter; import lombok.NonNull; import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.Bukkit; import org.bukkit.command.CommandExecutor; import org.bukkit.command.PluginCommand; diff --git a/src/main/java/net/buildtheearth/modules/ModuleHandler.java b/src/main/java/net/buildtheearth/modules/ModuleHandler.java index 3877ec9b..dc07f7e0 100644 --- a/src/main/java/net/buildtheearth/modules/ModuleHandler.java +++ b/src/main/java/net/buildtheearth/modules/ModuleHandler.java @@ -1,8 +1,8 @@ package net.buildtheearth.modules; +import com.alpsbte.alpslib.utils.ChatHelper; import lombok.Getter; import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.io.ConfigPaths; import org.bukkit.Bukkit; import org.bukkit.ChatColor; diff --git a/src/main/java/net/buildtheearth/modules/WikiDocumented.java b/src/main/java/net/buildtheearth/modules/WikiDocumented.java deleted file mode 100644 index 3f8e8d01..00000000 --- a/src/main/java/net/buildtheearth/modules/WikiDocumented.java +++ /dev/null @@ -1,22 +0,0 @@ -package net.buildtheearth.modules; - -import org.bukkit.entity.Player; -import org.jspecify.annotations.NonNull; - -public interface WikiDocumented { - - /** - * @return the wiki page URL for this object - */ - String getWikiPage(); - - /** - * Sends more information about this object to a player. - */ - default void sendWikiLink(@NonNull Player p) { - p.sendMessage(" "); - p.sendMessage("§cFor more information take a look here:"); - p.sendMessage("§c" + getWikiPage()); - } -} - diff --git a/src/main/java/net/buildtheearth/modules/common/CommonModule.java b/src/main/java/net/buildtheearth/modules/common/CommonModule.java index ac31e512..8204d35d 100644 --- a/src/main/java/net/buildtheearth/modules/common/CommonModule.java +++ b/src/main/java/net/buildtheearth/modules/common/CommonModule.java @@ -2,6 +2,7 @@ import com.alpsbte.alpslib.io.YamlFileFactory; import com.alpsbte.alpslib.io.config.ConfigNotImplementedException; +import com.alpsbte.alpslib.utils.ChatHelper; import lombok.Getter; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.Module; @@ -58,6 +59,7 @@ public void enable() { try { YamlFileFactory.registerPlugin(BuildTeamTools.getInstance()); ConfigUtil.init(); + ChatHelper.init(BuildTeamTools.getInstance(), BuildTeamTools.getInstance().isDebug(), BuildTeamTools.PREFIX, BuildTeamTools.CONSOLE_PREFIX); } catch (ConfigNotImplementedException ex) { // Fine? } diff --git a/src/main/java/net/buildtheearth/modules/common/commands/BuildTeamToolsCommand.java b/src/main/java/net/buildtheearth/modules/common/commands/BuildTeamToolsCommand.java index a4cbd3bf..d0581547 100644 --- a/src/main/java/net/buildtheearth/modules/common/commands/BuildTeamToolsCommand.java +++ b/src/main/java/net/buildtheearth/modules/common/commands/BuildTeamToolsCommand.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.common.commands; +import com.alpsbte.alpslib.utils.ChatHelper; import com.google.gson.Gson; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.Module; @@ -9,7 +10,6 @@ import net.buildtheearth.modules.network.model.Permissions; import net.buildtheearth.modules.network.model.Region; import net.buildtheearth.modules.stats.StatsModule; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.Utils; import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.HoverEvent; @@ -20,11 +20,7 @@ import org.bukkit.command.TabCompleter; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.UUID; +import java.util.*; public class BuildTeamToolsCommand implements CommandExecutor, TabCompleter { diff --git a/src/main/java/net/buildtheearth/modules/common/components/pluginmessaging/PluginMessagingComponent.java b/src/main/java/net/buildtheearth/modules/common/components/pluginmessaging/PluginMessagingComponent.java index 2f0beeaf..fa93b403 100644 --- a/src/main/java/net/buildtheearth/modules/common/components/pluginmessaging/PluginMessagingComponent.java +++ b/src/main/java/net/buildtheearth/modules/common/components/pluginmessaging/PluginMessagingComponent.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.common.components.pluginmessaging; +import com.alpsbte.alpslib.utils.ChatHelper; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteStreams; import net.buildtheearth.BuildTeamTools; @@ -7,7 +8,6 @@ import net.buildtheearth.modules.navigation.NavigationModule; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.stats.StatsModule; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.entity.Player; import org.bukkit.plugin.messaging.PluginMessageListener; diff --git a/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java b/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java index 3eee3f7f..4ce65cf8 100644 --- a/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java +++ b/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java @@ -1,8 +1,8 @@ package net.buildtheearth.modules.common.listeners; +import com.alpsbte.alpslib.utils.ChatHelper; import net.buildtheearth.modules.Module; import net.buildtheearth.modules.ModuleHandler; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.command.PluginCommand; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java b/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java index ec1887de..ff001828 100644 --- a/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java +++ b/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java @@ -1,7 +1,9 @@ package net.buildtheearth.modules.generator; +import com.alpsbte.alpslib.utils.GeneratorUtils; import com.sk89q.worldedit.LocalSession; import lombok.Getter; +import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.Module; import net.buildtheearth.modules.common.CommonModule; import net.buildtheearth.modules.generator.commands.GeneratorCommand; @@ -54,6 +56,8 @@ public static GeneratorModule getInstance() { @Override public void enable() { + GeneratorUtils.plugin = BuildTeamTools.getInstance(); + // Check if WorldEdit is enabled if (!CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled() && !CommonModule.getInstance().getDependencyComponent().isFastAsyncWorldEditEnabled()) { diff --git a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java b/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java index 98d966ac..e13ddd85 100644 --- a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java +++ b/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.generator.commands; +import com.alpsbte.alpslib.utils.ChatHelper; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.menu.GeneratorMenu; import net.buildtheearth.modules.generator.model.History; import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.Utils; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java b/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java index 66a47dc3..f11d8e2a 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java @@ -1,8 +1,8 @@ package net.buildtheearth.modules.generator.components.field; +import com.alpsbte.alpslib.utils.GeneratorUtils; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; import org.bukkit.entity.Player; public class Field extends GeneratorComponent { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java index eb4696c4..aebe8665 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java @@ -1,9 +1,9 @@ package net.buildtheearth.modules.generator.components.field; +import com.alpsbte.alpslib.utils.GeneratorUtils; import net.buildtheearth.modules.generator.model.Flag; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.Script; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldSettings.java b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldSettings.java index 05e343f9..35dede83 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldSettings.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/FieldSettings.java @@ -2,7 +2,6 @@ import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.Utils; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java index a0e4a1db..32444cd4 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.generator.components.field.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.field.*; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.WikiLinks; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java index c9aabbcf..b66528de 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.generator.components.field.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.field.CropType; @@ -7,7 +8,6 @@ import net.buildtheearth.modules.generator.components.field.FieldSettings; import net.buildtheearth.modules.generator.menu.GeneratorMenu; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java index d467b02e..dd9e3ce3 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java @@ -1,11 +1,11 @@ package net.buildtheearth.modules.generator.components.field.menu; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.field.FieldFlag; import net.buildtheearth.modules.generator.components.field.FieldSettings; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/House.java b/src/main/java/net/buildtheearth/modules/generator/components/house/House.java index ab9a84d2..5d618fe7 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/House.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/House.java @@ -1,8 +1,8 @@ package net.buildtheearth.modules.generator.components.house; +import com.alpsbte.alpslib.utils.GeneratorUtils; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java index 22589392..0e1af58b 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java @@ -1,5 +1,7 @@ package net.buildtheearth.modules.generator.components.house; +import com.alpsbte.alpslib.utils.GeneratorUtils; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.world.block.BlockState; @@ -9,8 +11,6 @@ import net.buildtheearth.modules.generator.model.Flag; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.Script; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import org.bukkit.Bukkit; import org.bukkit.block.Block; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java index b5397c67..455e412c 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.generator.components.house.menu; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.house.HouseFlag; import net.buildtheearth.modules.generator.components.house.HouseSettings; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java index a4062e35..4acab2f3 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java @@ -1,11 +1,11 @@ package net.buildtheearth.modules.generator.components.house.menu; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.house.HouseFlag; import net.buildtheearth.modules.generator.components.house.HouseSettings; import net.buildtheearth.modules.generator.components.house.RoofType; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofTypeMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofTypeMenu.java index dcc858d2..5cc30dbc 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofTypeMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofTypeMenu.java @@ -1,16 +1,15 @@ package net.buildtheearth.modules.generator.components.house.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.modules.generator.components.house.HouseFlag; import net.buildtheearth.modules.generator.components.house.HouseSettings; import net.buildtheearth.modules.generator.components.house.RoofType; -import net.buildtheearth.utils.Item; +import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; -import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java index 04f47b08..41d1ac45 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java @@ -1,11 +1,11 @@ package net.buildtheearth.modules.generator.components.house.menu; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.house.HouseFlag; import net.buildtheearth.modules.generator.components.house.HouseSettings; import net.buildtheearth.modules.generator.menu.GeneratorMenu; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java b/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java index f0e4dd42..b452c9dd 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java @@ -1,45 +1,33 @@ package net.buildtheearth.modules.generator.components.kml; +import com.alpsbte.alpslib.utils.ChatHelper; import com.cryptomorin.xseries.XMaterial; +import de.micromata.opengis.kml.v_2_2_0.Coordinate; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.utils.BlockLocation; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.GeometricUtils; import net.buildtheearth.utils.LineRasterization; import net.buildtheearth.utils.PolygonTools; - -import java.util.List; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Set; -import java.util.Stack; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.stream.Collectors; -import java.util.HashSet; - import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.command.BlockCommandSender; - -import org.bukkit.entity.Player; - -import de.micromata.opengis.kml.v_2_2_0.Coordinate; - import org.bukkit.World; - import org.bukkit.block.Block; import org.bukkit.block.BlockState; import org.bukkit.block.CommandBlock; - +import org.bukkit.command.BlockCommandSender; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import org.bukkit.metadata.FixedMetadataValue; +import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.stream.Collectors; + /** Class to handle kml command and its aliases * diff --git a/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java b/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java index a484ec5d..4d06e3cc 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java @@ -1,9 +1,9 @@ package net.buildtheearth.modules.generator.components.rail; +import com.alpsbte.alpslib.utils.GeneratorUtils; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; import org.bukkit.entity.Player; public class Rail extends GeneratorComponent { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java index 8c6bdf5f..1593df6b 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java @@ -1,8 +1,8 @@ package net.buildtheearth.modules.generator.components.rail; +import com.alpsbte.alpslib.utils.GeneratorUtils; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.Script; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java b/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java index 7f73dd01..c22f1831 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java @@ -1,9 +1,9 @@ package net.buildtheearth.modules.generator.components.road; +import com.alpsbte.alpslib.utils.GeneratorUtils; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; import org.bukkit.entity.Player; public class Road extends GeneratorComponent { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/road/RoadScripts.java index 0b722385..d3090857 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/RoadScripts.java @@ -1,13 +1,13 @@ package net.buildtheearth.modules.generator.components.road; +import com.alpsbte.alpslib.utils.GeneratorUtils; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.common.CommonModule; import net.buildtheearth.modules.generator.model.Flag; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.Script; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; -import net.buildtheearth.utils.Item; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadSettings.java b/src/main/java/net/buildtheearth/modules/generator/components/road/RoadSettings.java index 430a5c36..8312b288 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadSettings.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/RoadSettings.java @@ -1,11 +1,8 @@ package net.buildtheearth.modules.generator.components.road; +import com.alpsbte.alpslib.utils.GeneratorUtils; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.generator.model.Flag; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; -import net.buildtheearth.utils.Item; import org.bukkit.entity.Player; import java.io.File; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java index 17cbf25e..bd647800 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.generator.components.road.menu; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.road.RoadFlag; import net.buildtheearth.modules.generator.components.road.RoadSettings; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.menus.BlockListMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedSettingsMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedSettingsMenu.java index a5a9f222..9aa71755 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedSettingsMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedSettingsMenu.java @@ -1,13 +1,13 @@ package net.buildtheearth.modules.generator.components.road.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.modules.generator.components.road.Road; import net.buildtheearth.modules.generator.components.road.RoadFlag; import net.buildtheearth.modules.generator.components.road.RoadSettings; +import net.buildtheearth.modules.generator.model.Settings; import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java index c29ad8d3..c46e2e30 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java @@ -1,11 +1,11 @@ package net.buildtheearth.modules.generator.components.road.menu; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.road.RoadFlag; import net.buildtheearth.modules.generator.components.road.RoadSettings; import net.buildtheearth.modules.generator.menu.GeneratorMenu; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java index 7dbdde83..2e6a7f84 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.generator.components.road.menu; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.road.RoadFlag; import net.buildtheearth.modules.generator.components.road.RoadSettings; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.BlockListMenu; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java index d353739d..a8189235 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java @@ -1,11 +1,11 @@ package net.buildtheearth.modules.generator.components.tree; +import com.alpsbte.alpslib.utils.GeneratorUtils; import lombok.Getter; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.generator.model.GeneratorCollections; import net.buildtheearth.modules.generator.model.GeneratorComponent; import net.buildtheearth.modules.generator.model.GeneratorType; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; import org.bukkit.Bukkit; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java index 889d7b77..02307a5d 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java @@ -1,8 +1,8 @@ package net.buildtheearth.modules.generator.components.tree; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import org.bukkit.Material; import org.bukkit.entity.Player; import org.jspecify.annotations.NonNull; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java index 5e5d79f9..993a7b4a 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java @@ -1,11 +1,11 @@ package net.buildtheearth.modules.generator.components.tree.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.tree.TreeFlag; import net.buildtheearth.modules.generator.components.tree.TreeSettings; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.menus.NameListMenu; import net.daporkchop.lib.common.misc.Tuple; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java index 2add790e..bab6c688 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.generator.components.tree.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.tree.TreeFlag; @@ -7,7 +8,6 @@ import net.buildtheearth.modules.generator.components.tree.TreeType; import net.buildtheearth.modules.generator.menu.GeneratorMenu; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.menus.NameListMenu; import net.daporkchop.lib.common.misc.Tuple; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java index a1d2f605..84a4f7bd 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java @@ -1,12 +1,12 @@ package net.buildtheearth.modules.generator.components.tree.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.generator.GeneratorModule; import net.buildtheearth.modules.generator.components.tree.TreeFlag; import net.buildtheearth.modules.generator.components.tree.TreeSettings; import net.buildtheearth.modules.generator.components.tree.TreeWidth; import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.menus.NameListMenu; import net.daporkchop.lib.common.misc.Tuple; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/net/buildtheearth/modules/generator/listeners/GeneratorListener.java b/src/main/java/net/buildtheearth/modules/generator/listeners/GeneratorListener.java index 02068ab3..8ac94cf4 100644 --- a/src/main/java/net/buildtheearth/modules/generator/listeners/GeneratorListener.java +++ b/src/main/java/net/buildtheearth/modules/generator/listeners/GeneratorListener.java @@ -1,7 +1,7 @@ package net.buildtheearth.modules.generator.listeners; +import com.alpsbte.alpslib.utils.ChatHelper; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java index c325d8fd..b3fc563d 100644 --- a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java +++ b/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.generator.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.common.CommonModule; import net.buildtheearth.modules.generator.GeneratorModule; @@ -15,7 +16,6 @@ import net.buildtheearth.modules.generator.components.tree.menu.TreeTypeMenu; import net.buildtheearth.modules.generator.model.GeneratorCollections; import net.buildtheearth.modules.generator.model.GeneratorType; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Command.java b/src/main/java/net/buildtheearth/modules/generator/model/Command.java index c543e3ad..24136664 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Command.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/Command.java @@ -1,5 +1,7 @@ package net.buildtheearth.modules.generator.model; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.GeneratorUtils; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.regions.Region; @@ -10,8 +12,6 @@ import com.sk89q.worldedit.world.block.BlockTypes; import lombok.Getter; import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.MenuItems; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java b/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java index 681d2a0a..500aaeb2 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java @@ -1,5 +1,7 @@ package net.buildtheearth.modules.generator.model; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import lombok.Getter; import net.buildtheearth.modules.generator.components.field.CropStage; @@ -7,8 +9,6 @@ import net.buildtheearth.modules.generator.components.house.RoofType; import net.buildtheearth.modules.generator.components.tree.TreeType; import net.buildtheearth.modules.generator.components.tree.TreeWidth; -import net.buildtheearth.utils.ChatHelper; -import net.buildtheearth.utils.Item; public enum FlagType { diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java index f50b304a..4b183d15 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.generator.model; +import com.alpsbte.alpslib.utils.ChatHelper; import com.fastasyncworldedit.core.FaweAPI; import com.sk89q.worldedit.bukkit.BukkitWorld; import com.sk89q.worldedit.extent.clipboard.Clipboard; @@ -9,7 +10,6 @@ import lombok.experimental.UtilityClass; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.Bukkit; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java index 7c66078d..00e8a622 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java @@ -1,15 +1,15 @@ package net.buildtheearth.modules.generator.model; +import com.alpsbte.alpslib.utils.GeneratorUtils; +import com.alpsbte.alpslib.utils.WikiDocumented; import lombok.Getter; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.ModuleComponent; -import net.buildtheearth.modules.WikiDocumented; import net.buildtheearth.modules.generator.components.field.FieldSettings; import net.buildtheearth.modules.generator.components.house.HouseSettings; import net.buildtheearth.modules.generator.components.rail.RailSettings; import net.buildtheearth.modules.generator.components.road.RoadSettings; import net.buildtheearth.modules.generator.components.tree.TreeSettings; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.event.ClickEvent; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/History.java b/src/main/java/net/buildtheearth/modules/generator/model/History.java index c88f9101..94d66932 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/History.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/History.java @@ -1,17 +1,16 @@ package net.buildtheearth.modules.generator.model; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.GeneratorUtils; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; import lombok.Getter; import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; -import net.buildtheearth.utils.ChatHelper; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.Bukkit; -import org.bukkit.NamespacedKey; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Script.java b/src/main/java/net/buildtheearth/modules/generator/model/Script.java index 786b4998..8639c5d9 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Script.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/Script.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.generator.model; +import com.alpsbte.alpslib.utils.GeneratorUtils; import com.cryptomorin.xseries.XMaterial; import com.fastasyncworldedit.core.registry.state.PropertyKey; import com.sk89q.worldedit.LocalSession; @@ -13,7 +14,6 @@ import com.sk89q.worldedit.world.block.BlockType; import lombok.Getter; import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.utils.GeneratorUtils; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Settings.java b/src/main/java/net/buildtheearth/modules/generator/model/Settings.java index 1fb58aaa..4c0c8ff4 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Settings.java +++ b/src/main/java/net/buildtheearth/modules/generator/model/Settings.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.generator.model; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import lombok.Getter; import lombok.Setter; @@ -7,8 +8,6 @@ import net.buildtheearth.modules.generator.components.field.CropType; import net.buildtheearth.modules.generator.components.house.RoofType; import net.buildtheearth.modules.generator.components.tree.TreeWidth; -import net.buildtheearth.utils.Item; -import org.bukkit.TreeType; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java b/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java deleted file mode 100644 index ce83bcf3..00000000 --- a/src/main/java/net/buildtheearth/modules/generator/utils/GeneratorUtils.java +++ /dev/null @@ -1,1885 +0,0 @@ -package net.buildtheearth.modules.generator.utils; - -import clipper2.Clipper; -import clipper2.core.Path64; -import clipper2.core.Paths64; -import clipper2.core.Point64; -import clipper2.offset.EndType; -import clipper2.offset.JoinType; -import com.cryptomorin.xseries.XMaterial; -import com.fastasyncworldedit.core.limit.FaweLimit; -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldedit.extension.factory.MaskFactory; -import com.sk89q.worldedit.extension.input.InputParseException; -import com.sk89q.worldedit.extension.input.ParserContext; -import com.sk89q.worldedit.extension.platform.Actor; -import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; -import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; -import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; -import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; -import com.sk89q.worldedit.extent.inventory.BlockBag; -import com.sk89q.worldedit.function.mask.BlockMask; -import com.sk89q.worldedit.function.mask.Mask; -import com.sk89q.worldedit.function.operation.ForwardExtentCopy; -import com.sk89q.worldedit.function.operation.Operation; -import com.sk89q.worldedit.function.operation.Operations; -import com.sk89q.worldedit.function.pattern.ClipboardPattern; -import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.function.pattern.RandomPattern; -import com.sk89q.worldedit.math.BlockVector2; -import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.math.transform.AffineTransform; -import com.sk89q.worldedit.regions.*; -import com.sk89q.worldedit.regions.selector.CuboidRegionSelector; -import com.sk89q.worldedit.regions.selector.Polygonal2DRegionSelector; -import com.sk89q.worldedit.session.ClipboardHolder; -import com.sk89q.worldedit.session.SessionManager; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.WikiDocumented; -import net.buildtheearth.utils.ChatHelper; -import org.apache.commons.lang3.StringUtils; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.PluginDescriptionFile; -import org.bukkit.plugin.PluginManager; -import org.bukkit.util.Vector; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.CompletableFuture; - - -/** This class contains static utility methods for the generator module.
- * The following dependencies are needed for this class to work: - *
    - *
  1. WorldEdit
  2. - *
  3. FastAsyncWorldEdit
  4. - *
  5. XSeries
  6. - *
  7. Clipper
  8. - *
  9. ChatHelper (internal)
  10. - *
- *
- * The functions are categorized into the following sections: - * - *

Setup Functions: - * These functions are plugin specific functions that need to be changed when copying the class to another plugin. - * - *

Script Helper Functions: - *
• {@link #convertArgsToFlags(String[])} - *
• {@link #convertToFlagAndValue(String, Player)} - *
• {@link #getBlockState(XMaterial)} - * - *

WorldEdit Helper Functions: - *
• {@link #getWorldEditSchematicsFolderPath()} - * - *

WorldEdit Region Functions: - *
• {@link #getSelectionPointsFromRegion(Region)} - *
• {@link #getMinMaxPoints(Region)} - *
• {@link #getMaxHeight(Block[][][], Material...)} - *
• {@link #getMaxHeight(Block[][][], int, int, Material...)} - *
• {@link #containsBlock(Block[][][], XMaterial)} - *
• {@link #containsBlock(Block[][][], XMaterial, int)} - *
• {@link #getWorldEditSelection(Player)} - *
• {@link #restoreSelection(Player, RegionSelector)} - *
• {@link #createCuboidSelection(Player, Vector, Vector)} - *
• {@link #createPolySelection(Player, List, Block[][][])} - *
• {@link #createPolySelection(Player, List, int, int)} - *
• {@link #changeRegionWorld(Region, com.sk89q.worldedit.world.World)} - * - *

WorldEdit Operation Functions: - *
• {@link #prepareScriptSession(LocalSession, Actor, Player, com.sk89q.worldedit.world.World, int, boolean, boolean, boolean)} - *
• {@link #analyzeRegion(Player, World)} - *
• {@link #copyRegion(LocalSession, Actor, Region, World, World)} - *
• {@link #replaceBlocksWithMasks(LocalSession, Actor, com.sk89q.worldedit.world.World, List, BlockState, BlockState[], int)} - *
• {@link #replaceBlocksWithSchematic(LocalSession, Actor, com.sk89q.worldedit.world.World, BlockState[], String)} - *
• {@link #replaceBlocks(LocalSession, Actor, com.sk89q.worldedit.world.World, BlockState[], BlockState[])} - *
• {@link #drawSplineWithMasks(LocalSession, Actor, com.sk89q.worldedit.world.World, Block[][][], List, List, BlockState[], boolean, double, double, double, double, double, boolean, boolean)} - *
• {@link #drawCurveWithMasks(LocalSession, Actor, com.sk89q.worldedit.world.World, Block[][][], List, List, BlockState[], boolean)} - *
• {@link #drawPolyLineWithMasks(LocalSession, Actor, com.sk89q.worldedit.world.World, Block[][][], List, List, BlockState[], boolean, boolean)} - *
• {@link #drawLineWithMasks(LocalSession, Actor, com.sk89q.worldedit.world.World, Block[][][], List, Vector, Vector, BlockState[], boolean)} - *
• {@link #pasteSchematicWithMasks(LocalSession, Actor, com.sk89q.worldedit.world.World, Block[][][], List, String, Location, double)} - *
• {@link #pasteSchematic(LocalSession, Actor, com.sk89q.worldedit.world.World, Block[][][], String, Location, double)} - *
• {@link #expandSelection(LocalSession, Vector)} - *
• {@link #clearHistory(LocalSession)} - *
• {@link #undo(LocalSession, Player, Actor, int)} - *
• {@link #redo(LocalSession, Player, Actor, int)} - *
• {@link #setGmask(LocalSession, String)} - *
• {@link #saveEditSession(EditSession, LocalSession, Actor)} - * - *

Vector Helper Functions: - *
• {@link #adjustHeight(List, Block[][][])} - *
• {@link #populatePoints(List, int)} - *
• {@link #reducePoints(List, int, int)} - *
• {@link #extendPolyLine(List)} - *
• {@link #shortenPolyLine(List, int)} - *
• {@link #getClosestVector(List, Vector)} - *
• {@link #getXYZ(Vector, Block[][][])} - *
• {@link #getXYZWithVerticalOffset(Vector, Block[][][], int)} - *
• {@link #convertVectorListToPath64(List, Vector)} - *
• {@link #convertPathsToVectorList(Paths64, Vector, int, int)} - *
• {@link #shiftPoints(List, double, boolean)} - *
• {@link #shiftPointsAll(List, double)} - *
• {@link #getMinHeight(List)} - *
• {@link #getMaxHeight(List)} - * - *

Preparation Check Functions: - *
• {@link #checkIfSchematicBrushIsInstalled(Player)} - *
• {@link #checkForNoWorldEditSelection(Player)} - *
• {@link #checkForBrickOutline(Block[][][], Player, WikiDocumented)} - *
• {@link #checkForWoolBlock(Block[][][], Player, WikiDocumented)} - * - * @version 1.7.3 - * @author MineFact - */ -@SuppressWarnings("unused") -public class GeneratorUtils { - - - /*=============================================** - - SETUP FUNCTIONS - - **=============================================*/ - - /** Get the plugin instance. */ - private static Plugin getPlugin(){ - return BuildTeamTools.getInstance(); - } - - /** Checks if the plugin "FastAsyncWorldEdit" is enabled. */ - private static boolean isFastAsyncWorldEditEnabled(){ - return getPlugin().getServer().getPluginManager().isPluginEnabled("FastAsyncWorldEdit"); - } - - private static boolean isLegacyWorldEditEnabled() { - if (isFastAsyncWorldEditEnabled()) - return false; - - PluginManager pluginManager = getPlugin().getServer().getPluginManager(); - if (!pluginManager.isPluginEnabled("WorldEdit")) - return false; - - Plugin plugin = pluginManager.getPlugin("WorldEdit"); - if (plugin == null) - return false; - - @SuppressWarnings("deprecation") - PluginDescriptionFile description = plugin.getDescription(); - String version = description.getVersion(); - int major; - try { - major = Integer.parseInt(version.split("\\.")[0]); - } catch (NumberFormatException e) { - // Fallback or assume not legacy if version can't be parsed - return false; - } - - return major < 7; - } - - - /** Checks if the plugin "SchematicBrush" is enabled. */ - private static boolean isSchematicBrushEnabled(){ - return getPlugin().getServer().getPluginManager().isPluginEnabled("SchematicBrush"); - } // e.g., "1.21.4" - - - /** Checks if the server version is 1.12. */ - private static boolean isServerVersion1_12(){ - String rawVersion = Bukkit.getBukkitVersion().split("-")[0]; - return rawVersion.equals("1.12.2") || rawVersion.equals("1.12.1") || rawVersion.equals("1.12"); - } - - /** Get the ignored materials. */ - private static Material[] getIgnoredMaterials(){ - return new Material[]{}; - } - - private static void sendWikiLink(Player p) { - p.sendMessage("§cFor more information, see the Wiki."); - } - - - - - - /*=============================================** - - SCRIPT HELPER FUNCTIONS - - **=============================================*/ - - /** - * Converts a String[] of arguments to a String[] of flags. - * - * @param args The arguments to be converted. - * @return The converted flags. - */ - public static String[] convertArgsToFlags(String[] args) { - String argsString = " " + StringUtils.join(Arrays.copyOfRange(args, 1, args.length), " "); - String[] argsArray = argsString.split(" -"); - - return Arrays.copyOfRange(argsArray, 1, argsArray.length); - } - - /** Converts a string with all flags and values to a string array with the flag name and the flag value. - * - * @param flagAndValue The string with all flags and values. Example is a command like /gen house -w 10 -h 10 - * @param p The player who should receive an error message if the flag value is invalid. - * @return The string array with the flag name and the flag value. - */ - public static String[] convertToFlagAndValue(String flagAndValue, Player p){ - String[] values = flagAndValue.split(" "); - String flagName = values[0]; - String flagValue; - - try { - flagValue = StringUtils.join(Arrays.copyOfRange(values, 1, values.length), " "); - } catch (ArrayIndexOutOfBoundsException e) { - p.sendMessage("§cInvalid flag value: -" + flagName + "§n§c ???"); - return null; - } - - return new String[]{flagName, flagValue}; - } - - /** - * Returns the blockState of a given XMaterial. - * - * @param xMaterial The XMaterial to get the blockState from - * @return The blockState of the XMaterial - */ - public static BlockState getBlockState(XMaterial xMaterial){ - if(xMaterial == null) - return null; - - BlockType blockType = BlockTypes.get(xMaterial.getId() + ""); - ItemStack item = xMaterial.parseItem(); - if (blockType == null && item != null) - blockType = BlockTypes.get(item.getType().getKey().asString()); - - if (blockType == null && item != null) - throw new IllegalArgumentException("Invalid block type: " + item.getType().name()); - else if (blockType == null) - throw new IllegalArgumentException("Invalid block type: " + xMaterial.name()); - - return blockType.getDefaultState(); - } - public static BlockState[] getBlockState(XMaterial[] xMaterial){ - if(xMaterial == null) - return null; - - BlockState[] blockStates = new BlockState[xMaterial.length]; - - for(int i = 0; i < xMaterial.length; i++) - blockStates[i] = getBlockState(xMaterial[i]); - - return blockStates; - } - - - - /*=============================================** - - WORLDEDIT HELPER FUNCTIONS - - **=============================================*/ - - - /** - * Returns the path to the WorldEdit schematics folder. - * - * @return The path to the WorldEdit schematics folder - */ - public static String getWorldEditSchematicsFolderPath(){ - String worldEditFolder = "WorldEdit"; - - if(isFastAsyncWorldEditEnabled()) - worldEditFolder = "FastAsyncWorldEdit"; - - return getPlugin().getDataFolder().getAbsolutePath() + "/../" + worldEditFolder + "/schematics"; - } - - - - - - /*=============================================** - - WORLDEDIT REGION FUNCTIONS - - **=============================================*/ - - - - /** - * Returns the WorldEdit selection Vector from a player no matter which type of selection the player made. - * - * @param region The WorldEdit region to get the selection from - * @return A list of vectors representing the selection - */ - public static List getSelectionPointsFromRegion(Region region) { - List points = new ArrayList<>(); - - switch (region) { - case Polygonal2DRegion polyRegion -> { - ChatHelper.logDebug("Polygonal2DRegion found"); - // In latest FAWE, the points are stored as BlockVector2 - // In 1.12 WorldEdit, the points are stored as BlockVector2D - // Both classes have the same methods, so we can use reflection to get the methods - for (Object blockVectorObj : polyRegion.getPoints()) { - ChatHelper.logDebug("BlockVector2:" + blockVectorObj); - try { - Class blockVectorClass = blockVectorObj.getClass(); - Method getXMethod = blockVectorClass.getMethod("getBlockX"); - Method getZMethod = blockVectorClass.getMethod("getBlockZ"); - - int x = (Integer) getXMethod.invoke(blockVectorObj); - int z = (Integer) getZMethod.invoke(blockVectorObj); - - points.add(new Vector(x, 0, z)); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - ChatHelper.logDebug("Exception while processing region: " + e.getMessage()); - } - } - } - case ConvexPolyhedralRegion convexRegion -> { - // In latest FAWE, the points are stored as BlockVector2 - // In 1.12 WorldEdit, the points are stored as BlockVector2D - // Both classes have the same methods, so we can use reflection to get the methods - for (Object blockVectorObj : convexRegion.getVertices()) { - try { - Class blockVectorClass = blockVectorObj.getClass(); - Method getXMethod = blockVectorClass.getMethod("getBlockX"); - Method getYMethod = blockVectorClass.getMethod("getBlockY"); - Method getZMethod = blockVectorClass.getMethod("getBlockZ"); - - int x = (Integer) getXMethod.invoke(blockVectorObj); - int y = (Integer) getYMethod.invoke(blockVectorObj); - int z = (Integer) getZMethod.invoke(blockVectorObj); - - points.add(new Vector(x, y, z)); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - ChatHelper.logDebug("Exception while processing region: " + e.getMessage()); - } - } - } - case CuboidRegion cuboidRegion -> { - try { - Class regionClass = cuboidRegion.getClass(); - Method getPos1Method = regionClass.getMethod("getPos1"); - Method getPos2Method = regionClass.getMethod("getPos2"); - - Class vectorClass = getPos1Method.getReturnType(); - - Method getXMethod = vectorClass.getMethod("getBlockX"); - Method getYMethod = vectorClass.getMethod("getBlockY"); - Method getZMethod = vectorClass.getMethod("getBlockZ"); - - Object pos1 = getPos1Method.invoke(region); - Object pos2 = getPos2Method.invoke(region); - - int x1 = (Integer) getXMethod.invoke(pos1); - int y1 = (Integer) getYMethod.invoke(pos1); - int z1 = (Integer) getZMethod.invoke(pos1); - - int x2 = (Integer) getXMethod.invoke(pos2); - int y2 = (Integer) getYMethod.invoke(pos2); - int z2 = (Integer) getZMethod.invoke(pos2); - - points.add(new Vector(x1, y1, z1)); - points.add(new Vector(x2, y2, z2)); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - ChatHelper.logDebug("Exception while processing region: " + e.getMessage()); - } - } - case null, default -> { - return null; - } - } - - return points; - } - - /** - * Returns the minimum and maximum points of a region as a Vector array. - * - * @param region The region to get the minimum and maximum points from - * @return A Vector array with the minimum vector at index 0 and the maximum vector at index 1 - */ - public static Vector[] getMinMaxPoints(Region region){ - Vector[] minMax = new Vector[2]; - - try{ - Class regionClass = region.getClass(); - Method getMinimumPointMethod = regionClass.getMethod("getMinimumPoint"); - Method getMaximumPointMethod = regionClass.getMethod("getMaximumPoint"); - - Class vectorClass = getMinimumPointMethod.getReturnType(); - - Method getXMethod = vectorClass.getMethod("getBlockX"); - Method getYMethod = vectorClass.getMethod("getBlockY"); - Method getZMethod = vectorClass.getMethod("getBlockZ"); - - Object minPoint = getMinimumPointMethod.invoke(region); - Object maxPoint = getMaximumPointMethod.invoke(region); - - int minX = (Integer) getXMethod.invoke(minPoint); - int minY = (Integer) getYMethod.invoke(minPoint); - int minZ = (Integer) getZMethod.invoke(minPoint); - - int maxX = (Integer) getXMethod.invoke(maxPoint); - int maxY = (Integer) getYMethod.invoke(maxPoint); - int maxZ = (Integer) getZMethod.invoke(maxPoint); - - minMax[0] = new Vector(minX, minY, minZ); - minMax[1] = new Vector(maxX, maxY, maxZ); - - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { - ChatHelper.logDebug("Exception while processing MinMax Points: " + e.getMessage()); - } - - return minMax; - } - - /** - * Checks the maximum height of a polygon region - * - * @param blocks List of blocks in polygon region - * @return Maximum height of polygon region - */ - public static int getMaxHeight(Block[][][] blocks, Material... ignoreMaterials){ - int maxHeight = 0; - List ignoreMaterialsList = Arrays.asList(ignoreMaterials); - - for (Block[][] block2D : blocks) - for (Block[] block1D : block2D) - for (Block block : block1D) - if (block != null && !ignoreMaterialsList.contains(block.getType()) && block.getType().isSolid() && !block.isLiquid() && block.getY() > maxHeight) - maxHeight = block.getY(); - - return maxHeight; - } - - /** - * Checks the max height of a polygon region given a certain x and z coordinate - * - * @param blocks List of blocks in polygon region - * @return Maximum height of polygon region - */ - public static int getMaxHeight(Block[][][] blocks, int x, int z, Material... ignoreMaterials){ - int maxHeight = 0; - List ignoreMaterialsList = Arrays.asList(ignoreMaterials); - - for (Block[][] block2D : blocks) - for (Block[] block1D : block2D) - for (Block block : block1D) - if (block != null && block.getX() == x && block.getZ() == z && block.getY() > maxHeight && !ignoreMaterialsList.contains(block.getType()) && block.getType().isSolid() && !block.isLiquid()) - maxHeight = block.getY(); - - return maxHeight; - } - - /** - * Checks if polygon region contains a block of a certain type - * - * @param blocks List of blocks in polygon region - * @param xMaterial Material to check for (e.g. XMaterial.WALL_SIGN) - * @return true if polygon region contains the block, false otherwise - */ - public static boolean containsBlock(Block[][][] blocks, XMaterial xMaterial){ - return containsBlock(blocks, xMaterial, 1); - } - - /** - * Checks if polygon region contains a minimum amount of blocks of a certain type - * @param blocks List of blocks in polygon region - * @param xMaterial Material to check for (e.g. XMaterial.WALL_SIGN) - * @param requiredAmount The minimum amount required to return true - * @return true if polygon region contains the required amount of the block, false otherwise - */ - public static boolean containsBlock(Block[][][] blocks, XMaterial xMaterial, int requiredAmount){ - int amountFound = 0; - for (Block[][] block2D : blocks) - for (Block[] block1D : block2D) - for (Block block : block1D) { - ItemStack item = xMaterial.parseItem(); - if (block != null && item != null && block.getType() == item.getType()) - amountFound++; - } - - return amountFound >= requiredAmount; - } - - /** - * Returns the current WorldEdit selection of a player. - * - * @param p The player whose selection should be returned. - * @return The current WorldEdit selection of the player. - */ - public static Region getWorldEditSelection(Player p){ - try { - Actor actor = BukkitAdapter.adapt(p); - SessionManager sessionManager = WorldEdit.getInstance().getSessionManager(); - com.sk89q.worldedit.world.World world = sessionManager.get(actor).getSelectionWorld(); - - return sessionManager.get(actor).getSelection(world); - } catch (NullPointerException | IncompleteRegionException ex) { - return null; - } - } - - /** - * Returns the WorldEdit selection of a player. - * - * @param p The player to get the selection from - * @param regionSelector The region selector to get the selection from - */ - public static void restoreSelection(Player p, RegionSelector regionSelector){ - Actor actor = BukkitAdapter.adapt(p); - SessionManager sessionManager = WorldEdit.getInstance().getSessionManager(); - com.sk89q.worldedit.world.World world = sessionManager.get(actor).getSelectionWorld(); - - sessionManager.get(actor).setRegionSelector(world, regionSelector); - - ChatHelper.logDebug("Restored selection"); - } - - /** - * Creates a Cuboid WorldEdit selection from a list of points and execute it right away. - * - * @param p The player to create the selection for - * @param vector1 Position 1 - * @param vector2 Position 2 - */ - public static void createCuboidSelection(Player p, Vector vector1, Vector vector2){ - Actor actor = BukkitAdapter.adapt(p); - SessionManager sessionManager = WorldEdit.getInstance().getSessionManager(); - com.sk89q.worldedit.world.World world = sessionManager.get(actor).getSelectionWorld(); - - sessionManager.get(actor).setRegionSelector(world, - new CuboidRegionSelector(world, - BlockVector3.at(vector1.getBlockX(), vector1.getBlockY(), vector1.getBlockZ()), - BlockVector3.at(vector2.getBlockX(), vector2.getBlockY(), vector2.getBlockZ()) - ) - ); - - ChatHelper.logDebug("Created cuboid selection"); - } - - - /** - * Creates a Polygon WorldEdit selection from a list of points and execute it right away. - * This functions determines the current surface height of each vector directly. - * - * @param p The player to create the selection for - * @param points The list of points to create the selection from - */ - public static void createPolySelection(Player p, List points, Block[][][] blocks){ - int minY = Integer.MAX_VALUE; - int maxY = Integer.MIN_VALUE; - - for(Vector vector : points) { - int y = getMaxHeight(blocks, vector.getBlockX(), vector.getBlockZ(), getIgnoredMaterials()); - - minY = Math.min(minY, y); - maxY = Math.max(maxY, y); - } - - createPolySelection(p, points, minY, maxY); - } - - /** - * Creates a Polygon WorldEdit selection from a list of points and execute it right away. - * This functions determines the current surface height of each vector directly. - * - * @param p The player to create the selection for - * @param points The list of points to create the selection from - * @param minY The minimum Y value of the selection - * @param maxY The maximum Y value of the selection - */ - public static void createPolySelection(Player p, List points, int minY, int maxY) { - Actor actor = BukkitAdapter.adapt(p); - SessionManager sessionManager = WorldEdit.getInstance().getSessionManager(); - com.sk89q.worldedit.world.World world = sessionManager.get(actor).getSelectionWorld(); - - List blockVector2List = new ArrayList<>(); - for (Vector vector : points){ - blockVector2List.add(BlockVector2.at(vector.getBlockX(), vector.getBlockZ())); - ChatHelper.logDebug("Added point: " + vector); - } - - sessionManager.get(actor).setRegionSelector(world, - new Polygonal2DRegionSelector(world, blockVector2List, minY, maxY) - ); - - ChatHelper.logDebug("Created polygonal selection with " + points.size() + " points. minY: " + minY + " maxY: " + maxY); - } - - /** - * Rebuilds a region with a different world while keeping its coordinates. - * Currently, supports {@link Polygonal2DRegion} and {@link CuboidRegion}. - * - * @param region The region to rebuild - * @param world The world that should be used for the new region - * @return A new region with the supplied world or {@code null} if the type is unsupported - */ - public static Region changeRegionWorld(Region region, com.sk89q.worldedit.world.World world) { - if (region instanceof Polygonal2DRegion) { - List points = getSelectionPointsFromRegion(region); - if (points == null) - return null; - - List blockPoints = new ArrayList<>(); - for (Vector v : points) - blockPoints.add(BlockVector2.at(v.getBlockX(), v.getBlockZ())); - - Vector[] minMax = getMinMaxPoints(region); - int minY = minMax[0].getBlockY(); - int maxY = minMax[1].getBlockY(); - - return new Polygonal2DRegion(world, blockPoints, minY, maxY); - } else if (region instanceof CuboidRegion) { - Vector[] minMax = getMinMaxPoints(region); - BlockVector3 min = BlockVector3.at(minMax[0].getBlockX(), minMax[0].getBlockY(), minMax[0].getBlockZ()); - BlockVector3 max = BlockVector3.at(minMax[1].getBlockX(), minMax[1].getBlockY(), minMax[1].getBlockZ()); - return new CuboidRegion(world, min, max); - } - - return null; - } - - - - - - - - /*=============================================** - - WORLDEDIT OPERATION FUNCTIONS - - **=============================================*/ - - - - /** - * Prepares a script session by expanding the selection, removing non-solid blocks and ignored materials. - * The blocks of the region are also analyzed and returned. - * - * @param localSession The local session of the actor - * @param actor The actor who should perform the operation - * @param player The player who should receive an error message if the flag value is invalid - * @param world The world in which the region is located - * @param expandSelection The amount of blocks to expand the selection - * @param readBlocks Whether the blocks of the region should be read and returned - * @param removeNonSolidBlocks Whether non-solid blocks should be removed - * @param removeIgnoredMaterials Whether ignored materials should be removed - * @return A three-dimensional array of all blocks in the region - */ - public static Block[][][] prepareScriptSession(LocalSession localSession, Actor actor, Player player, com.sk89q.worldedit.world.World world, int expandSelection, boolean readBlocks, boolean removeNonSolidBlocks, boolean removeIgnoredMaterials){ - if(expandSelection > 0) { - expandSelection(localSession, new Vector(0, expandSelection, 0)); - expandSelection(localSession, new Vector(0, -expandSelection, 0)); - } - - BlockType air = BlockTypes.AIR; - - if(air == null) - return null; - - if(removeNonSolidBlocks) - replaceBlocksWithMasks(localSession, actor, world, Collections.singletonList("!#solid"), null, new BlockState[]{air.getDefaultState()}, 1) - .join(); - - if(removeIgnoredMaterials) { - Material[] materials = getIgnoredMaterials(); - for (Material material : materials) { - BlockType blockType = BlockTypes.get(material.getKey().asString()); - - if (blockType == null) - continue; - - List blockStates = blockType.getAllStates(); - BlockState[] blockStatesArray = blockStates.toArray(new BlockState[0]); - replaceBlocks(localSession, actor, world, blockStatesArray, new BlockState[]{air.getDefaultState()}) - .join(); - } - } - - Block[][][] regionBlocks = null; - - if(readBlocks) - regionBlocks = analyzeRegion(player, player.getWorld()); - - return regionBlocks; - } - - - - /** Analyzes a region and returns a three-dimensional array of all blocks in the region. - * The size of the array is defined by the width, height and length of the region from WorldEdit of the player. - * By saving the blocks in an array, the generation can be done much faster later once the region blocks need to be inspected. - * - * @param p The player whose selection should be analyzed. - * @param world The world in which the region is located. - * @return A three-dimensional array of all blocks in the region. - */ - public static Block[][][] analyzeRegion(Player p, World world) { - // Get WorldEdit selection of player - Region region = getWorldEditSelection(p); - - if(region == null) - return null; - - Block[][][] blocks = new Block[region.getWidth()][region.getHeight()][region.getLength()]; - - try { - Class regionClass = region.getClass(); - - // Reflectively access the minimum and maximum points - Method getMinimumPoint = regionClass.getMethod("getMinimumPoint"); - Method getMaximumPoint = regionClass.getMethod("getMaximumPoint"); - Method contains; - - if(isLegacyWorldEditEnabled()) - contains = regionClass.getMethod("contains", Class.forName("com.sk89q.worldedit.Vector")); - else - contains = regionClass.getMethod("contains", BlockVector3.class); - - Object minPoint = getMinimumPoint.invoke(region); - Object maxPoint = getMaximumPoint.invoke(region); - - Class vectorClass = minPoint.getClass(); - - // Assume getBlockX/Y/Z methods exist in both Vector and BlockVector3 - Method getBlockX = vectorClass.getMethod("getBlockX"); - Method getBlockY = vectorClass.getMethod("getBlockY"); - Method getBlockZ = vectorClass.getMethod("getBlockZ"); - - int minX = (Integer) getBlockX.invoke(minPoint); - int minY = (Integer) getBlockY.invoke(minPoint); - int minZ = (Integer) getBlockZ.invoke(minPoint); - int maxX = (Integer) getBlockX.invoke(maxPoint); - int maxY = (Integer) getBlockY.invoke(maxPoint); - int maxZ = (Integer) getBlockZ.invoke(maxPoint); - - for (int i = minX; i <= maxX; i++) - for (int j = minY; j <= maxY; j++) - for (int k = minZ; k <= maxZ; k++) { - // Dynamically create vector instance to use in contains method - Object vectorInstance; - - // First, try using BlockVector3.at(int, int, int) - common in FAWE and newer WorldEdit - try { - Class blockVector3Class = Class.forName("com.sk89q.worldedit.math.BlockVector3"); - Method atMethod = blockVector3Class.getMethod("at", int.class, int.class, int.class); - vectorInstance = atMethod.invoke(null, i, j, k); - } catch (ClassNotFoundException | NoSuchMethodException e) { - - // If BlockVector3 or at method is not found, fallback to WorldEdit's Vector - vectorInstance = vectorClass.getConstructor(int.class, int.class, int.class).newInstance(i, j, k); - } - - if(vectorInstance != null) { - boolean regionContains = (Boolean) contains.invoke(region, vectorInstance); - - if (regionContains) { - Block block = world.getBlockAt(i, j, k); - blocks[i - minX][j - minY][k - minZ] = block; - } - } - } - - - return blocks; - } catch (Exception e) { - ChatHelper.logDebug("Exception while analyzing region: " + e.getMessage()); - return null; - } - } - - /** - * Copies all blocks inside a region from one world to another to the same coordinates. - * - * @param region The region to copy. - * @param fromWorld The source world. - * @param toWorld The destination world. - */ - public static CompletableFuture copyRegion(LocalSession localSession, Actor actor, - Region region, World fromWorld, - World toWorld) { - CompletableFuture future = new CompletableFuture<>(); - Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { - com.sk89q.worldedit.world.World weFrom = BukkitAdapter.adapt(fromWorld); - com.sk89q.worldedit.world.World weTo = BukkitAdapter.adapt(toWorld); - Region copyRegion = region; - - try (EditSession sourceEditSession = WorldEdit.getInstance().newEditSession(weFrom); - EditSession targetEditSession = WorldEdit.getInstance().newEditSession(weTo)) { - - if (copyRegion.getWorld() != null && !copyRegion.getWorld().getName().equals(fromWorld.getName())) - copyRegion = changeRegionWorld(region, weFrom); - - if (copyRegion == null) { - ChatHelper.logError("Failed to copy region from " + fromWorld.getName() + " to " + toWorld.getName() + " because region is null."); - return; - } - - BlockArrayClipboard clipboard = new BlockArrayClipboard(copyRegion); - ForwardExtentCopy forwardCopy = new ForwardExtentCopy(sourceEditSession, copyRegion, - clipboard, region.getMinimumPoint()); - forwardCopy.setCopyingEntities(true); - forwardCopy.setCopyingBiomes(true); - Operations.complete(forwardCopy); - - ChatHelper.log("Pasting at: " + region.getMinimumPoint() + " in world " + toWorld.getName()); - ChatHelper.log("Clipboard size: " + clipboard.getRegion().getVolume()); - - Operation paste = new ClipboardHolder(clipboard) - .createPaste(targetEditSession) - .to(region.getMinimumPoint()) - .copyEntities(true) - .copyBiomes(true) - .ignoreAirBlocks(false) - .build(); - Operations.complete(paste); - targetEditSession.flushQueue(); - - saveEditSession(targetEditSession, localSession, actor); - } catch (WorldEditException e) { - ChatHelper.logError("Failed to copy region: " + e.getMessage()); - future.completeExceptionally(e); - return; - } - - future.complete(null); - }); - - return future; - } - - /** - * Replaces all blocks in a region with the given masks and a pattern. - * - * @param localSession The local session of the actor - * @param actor The actor who should perform the operation - * @param weWorld The WorldEdit world in which the region is located - * @param masks The masks to use - * @param from The block to replace - * @param to The blocks to replace with - * @param iterations The number of iterations to perform - * - * @return A CompletableFuture that completes when the operation is finished - */ - public static CompletableFuture replaceBlocksWithMasks(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, List masks, BlockState from, BlockState[] to, int iterations) { - if(to == null || to.length == 0) - throw new IllegalArgumentException("BlockState[] to is empty"); - - CompletableFuture future = new CompletableFuture<>(); - Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { - for (int i = 0; i < iterations; i++) { - try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { - - Region region = localSession.getSelection(); - - ParserContext parserContext = new ParserContext(); - parserContext.setActor(actor); - parserContext.setWorld(weWorld); - parserContext.setSession(localSession); - parserContext.setExtent(editSession); - - for (String maskString : masks) { - ChatHelper.logDebug("Replacing blocks with expression mask: " + maskString.replace("%", "'PCT'") + " from " + from + " to " + Arrays.toString(to) + " for " + iterations + " iterations"); - - Mask mask = new MaskFactory(WorldEdit.getInstance()).parseFromInput(maskString, parserContext); - - if (from != null) { - BlockMask blockMask = new BlockMask(weWorld, from.toBaseBlock()); - editSession.setMask(blockMask); - } - - Pattern pattern; - - if (to.length == 1) - pattern = to[0]; - else { - RandomPattern randomPattern = new RandomPattern(); - double chance = 100.0 / to.length; - - for (BlockState blockState : to) - randomPattern.add(blockState, chance); - - pattern = randomPattern; - } - - - editSession.replaceBlocks(region, mask, pattern); - - saveEditSession(editSession, localSession, actor); - } - } catch (IncompleteRegionException | MaxChangedBlocksException | InputParseException e) { - future.completeExceptionally(new RuntimeException(e)); - } - } - - future.complete(null); - }); - - return future; - } - - - /** - * Replaces all blocks in a region with a schematic pattern. - * - * @param weWorld The WorldEdit world in which the region is located - * @param localSession The local session of the actor - * @param from The block to replace - * @param schematicPath The path of the schematic to replace with - * - * @return A CompletableFuture that completes when the operation is finished - */ - public static CompletableFuture replaceBlocksWithSchematic(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, BlockState[] from, String schematicPath) { - CompletableFuture future = new CompletableFuture<>(); - Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { - ChatHelper.logDebug("Replacing blocks from " + Arrays.toString(from) + " to " + schematicPath); - - try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { - Region region = localSession.getSelection(); - - File schematicFile = new File(GeneratorUtils.getWorldEditSchematicsFolderPath() + schematicPath); - - ClipboardFormat format = ClipboardFormats.findByFile(schematicFile); - ClipboardReader reader; - - if (format == null) - return; - - try { - reader = format.getReader(Files.newInputStream(schematicFile.toPath())); - Clipboard clipboard = reader.read(); - - Pattern pattern = new ClipboardPattern(clipboard); - - if(from != null) { - BlockMask blockMask = new BlockMask(weWorld).add(from); - editSession.replaceBlocks(region, blockMask, pattern); - }else - editSession.setBlocks(region, pattern); - } catch (IOException e) { - ChatHelper.logDebug("Exception while replacing blocks with schematic: " + e.getMessage()); - return; - } - - saveEditSession(editSession, localSession, actor); - } catch (IncompleteRegionException | MaxChangedBlocksException e) { - future.completeExceptionally(new RuntimeException(e)); - } - - future.complete(null); - }); - - return future; - } - - - /** - * Replaces all blocks in a region with a given block. - * - * @param weWorld The WorldEdit world in which the region is located - * @param localSession The local session of the actor - * @param from The block to replace - * @param to The block to replace with - * - * @return A CompletableFuture that completes when the operation is finished - */ - public static CompletableFuture replaceBlocks(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, BlockState[] from, BlockState[] to) { - if(to.length == 0) - throw new IllegalArgumentException("BlockState[] to is empty"); - - CompletableFuture future = new CompletableFuture<>(); - Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { - ChatHelper.logDebug("Replacing blocks from " + Arrays.toString(from) + " to " + Arrays.toString(to)); - - try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { - Region region = localSession.getSelection(); - Pattern pattern; - - if(to.length == 1) - pattern = to[0]; - else{ - RandomPattern randomPattern = new RandomPattern(); - double chance = 100.0 / to.length; - - for(BlockState blockState : to) - randomPattern.add(blockState, chance); - - pattern = randomPattern; - } - - if(from != null) { - BlockMask blockMask = new BlockMask(weWorld).add(from); - editSession.replaceBlocks(region, blockMask, pattern); - }else - editSession.setBlocks(region, pattern); - - - saveEditSession(editSession, localSession, actor); - } catch (IncompleteRegionException | MaxChangedBlocksException e) { - future.completeExceptionally(new RuntimeException(e)); - } - - future.complete(null); - }); - return future; - } - - - /** - * Draws a spline in a region with the given masks and a pattern. - * - * @param localSession The local session of the actor - * @param actor The actor who should perform the operation - * @param weWorld The WorldEdit world in which the region is located - * @param regionBlocks The blocks of the region - * @param masks The masks to use. If no mask should be used, pass an empty list. - * @param points The points of the curve - * @param blocks The blocks to use for the curve - * @param tension The tension of the curve - Kochanek–Bartels Spline - * @param bias The bias of the curve - Kochanek–Bartels Spline - * @param continuity The continuity of the curve - Kochanek–Bartels Spline - * @param quality The quality of the curve. The higher the quality, the more points the curve will have. - * @param radius The radius of the curve. The higher the radius the thicker the curve will be. - * @param filled Whether the curve should be filled or not. - * @param matchElevation Whether the elevation of the points should be matched to the region - */ - public static CompletableFuture drawSplineWithMasks(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, Block[][][] regionBlocks, List masks, List points, BlockState[] blocks, - boolean matchElevation, double tension, double bias, double continuity, double quality, double radius, boolean filled, boolean connectLineEnds) { - if(blocks == null || blocks.length == 0) - throw new IllegalArgumentException("BlockState[] to is empty"); - - // If no mask is provided, add an empty mask - if (masks.isEmpty()) { - masks = new ArrayList<>(); - masks.add(""); - } - - List finalMasks = masks; - CompletableFuture future = new CompletableFuture<>(); - Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { - - try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { - - ParserContext parserContext = new ParserContext(); - parserContext.setActor(actor); - parserContext.setWorld(weWorld); - parserContext.setSession(localSession); - parserContext.setExtent(editSession); - - for (String maskString : finalMasks) { - ChatHelper.logDebug("Drawing spline with expression mask: " + maskString.replace("%", "'PCT'") + " with " + Arrays.toString(blocks)); - - // Set the mask - if (!maskString.isEmpty()) { - Mask mask = new MaskFactory(WorldEdit.getInstance()).parseFromInput(maskString, parserContext); - editSession.setMask(mask); - } - - // Set the pattern - Pattern pattern; - - if (blocks.length == 1) - pattern = blocks[0]; - else { - RandomPattern randomPattern = new RandomPattern(); - double chance = 100.0 / blocks.length; - - for (BlockState blockState : blocks) - randomPattern.add(blockState, chance); - - pattern = randomPattern; - } - - // Set the block vectors - List blockVector3s = new ArrayList<>(); - for (Vector point : points) { - if (matchElevation) - point = getXYZ(point, regionBlocks); - - blockVector3s.add(BlockVector3.at(point.getBlockX(), point.getBlockY(), point.getBlockZ())); - } - - editSession.drawSpline(pattern, blockVector3s, tension, bias, continuity, quality, radius, filled); - - if (connectLineEnds && blockVector3s.size() > 1) - editSession.drawLine(pattern, blockVector3s.getFirst(), blockVector3s.getLast(), radius, true); - - saveEditSession(editSession, localSession, actor); - } - } catch (IncompleteRegionException | MaxChangedBlocksException | InputParseException e) { - throw new RuntimeException(e); - } - - future.complete(null); - }); - - return future; - } - - public static CompletableFuture drawCurveWithMasks(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, Block[][][] regionBlocks, List masks, List points, BlockState[] blocks, boolean matchElevation){ - return drawSplineWithMasks(localSession, actor, weWorld, regionBlocks, masks, points, blocks, matchElevation, 0, 0, 0, 10, 0, true, false); - } - - public static CompletableFuture drawPolyLineWithMasks(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, Block[][][] regionBlocks, List masks, List points, BlockState[] blocks, boolean matchElevation, boolean connectLineEnds){ - return drawSplineWithMasks(localSession, actor, weWorld, regionBlocks, masks, points, blocks, matchElevation, 1, 0, -1, 10, 0, true, connectLineEnds); - } - - - - - /** - * Draws a Line in a region with the given masks and a pattern. - * - * @param localSession The local session of the actor - * @param actor The actor who should perform the operation - * @param weWorld The WorldEdit world in which the region is located - * @param regionBlocks The blocks of the region - * @param masks The masks to use. If no mask should be used, pass an empty list. - * @param point1 The first point of the curve - * @param point2 The second point of the curve - * @param blocks The blocks to use for the curve - * @param matchElevation Whether the elevation of the points should be matched to the region - */ - public static CompletableFuture drawLineWithMasks(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, Block[][][] regionBlocks, List masks, Vector point1, Vector point2, BlockState[] blocks, boolean matchElevation) { - if(blocks == null || blocks.length == 0) - throw new IllegalArgumentException("BlockState[] to is empty"); - - // If no mask is provided, add an empty mask - if (masks.isEmpty()) { - masks = new ArrayList<>(); - masks.add(""); - } - - CompletableFuture future = new CompletableFuture<>(); - List finalMasks = masks; - Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { - try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { - - ParserContext parserContext = new ParserContext(); - parserContext.setActor(actor); - parserContext.setWorld(weWorld); - parserContext.setSession(localSession); - parserContext.setExtent(editSession); - - for (String maskString : finalMasks) { - ChatHelper.logDebug("Drawing line with expression mask: " + maskString.replace("%", "'PCT'") + " with " + Arrays.toString(blocks) + " from " + point1 + " to " + point2); - - // Set the mask - if(!maskString.isEmpty()) { - Mask mask = new MaskFactory(WorldEdit.getInstance()).parseFromInput(maskString, parserContext); - editSession.setMask(mask); - } - - // Set the pattern - Pattern pattern; - - if(blocks.length == 1) - pattern = blocks[0]; - else{ - RandomPattern randomPattern = new RandomPattern(); - double chance = 100.0 / blocks.length; - - for(BlockState blockState : blocks) - randomPattern.add(blockState, chance); - - pattern = randomPattern; - } - - Vector newPoint1 = point1; - Vector newPoint2 = point2; - - // Adjust the points to the elevation of the region if matchElevation is true - if(matchElevation){ - newPoint1 = getXYZ(point1, regionBlocks); - newPoint2 = getXYZ(point2, regionBlocks); - } - - // Set the block vectors - BlockVector3 point1BlockVector3 = BlockVector3.at(newPoint1.getBlockX(), newPoint1.getBlockY(), newPoint1.getBlockZ()); - BlockVector3 point2BlockVector3 = BlockVector3.at(newPoint2.getBlockX(), newPoint2.getBlockY(), newPoint2.getBlockZ()); - - editSession.drawLine(pattern, point1BlockVector3, point2BlockVector3, 0, true); - - saveEditSession(editSession, localSession, actor); - } - } catch(IncompleteRegionException | MaxChangedBlocksException | InputParseException e){ - throw new RuntimeException(e); - } - - future.complete(null); - }); - - return future; - } - - - /** - * Pastes a schematic at a given location. - * - * @param localSession The local session of the actor - * @param weWorld The WorldEdit world in which the region is located - * @param blocks The blocks to paste - * @param masks The masks to use - * @param schematicPath The path to the schematic - * @param loc The location to paste the schematic - * @param rotation The rotation of the schematic - */ - public static CompletableFuture pasteSchematicWithMasks(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, Block[][][] blocks, List masks, String schematicPath, Location loc, double rotation) { - int offsetY = 1; - - // If no mask is provided, add an empty mask - if (masks.isEmpty()) { - masks = new ArrayList<>(); - masks.add(""); - } - - int maxHeight = loc.getBlockY(); - - if(blocks != null) - maxHeight = GeneratorUtils.getMaxHeight(blocks, loc.getBlockX(), loc.getBlockZ(), getIgnoredMaterials()); - if(maxHeight == 0) - maxHeight = loc.getBlockY(); - - CompletableFuture future = new CompletableFuture<>(); - int finalMaxHeight = maxHeight; - final List finalMasks = masks; - Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> { - try (EditSession editSession = WorldEdit.getInstance().newEditSession(weWorld)) { - File schematicFile = new File(getWorldEditSchematicsFolderPath() + schematicPath); - - ClipboardFormat format = ClipboardFormats.findByFile(schematicFile); - ClipboardReader reader; - - if (format == null) - return; - - try { - reader = format.getReader(Files.newInputStream(schematicFile.toPath())); - Clipboard clipboard = reader.read(); - - AffineTransform transform = new AffineTransform(); - transform = transform.rotateY(rotation); - - ClipboardHolder holder = new ClipboardHolder(clipboard); - holder.setTransform(transform); - - ParserContext parserContext = new ParserContext(); - parserContext.setActor(actor); - parserContext.setWorld(weWorld); - parserContext.setSession(localSession); - parserContext.setExtent(editSession); - - for (String maskString : finalMasks) { - // Set the mask - Mask mask = null; - if(!maskString.isEmpty()) - mask = new MaskFactory(WorldEdit.getInstance()).parseFromInput(maskString, parserContext); - - Operation op = holder - .createPaste(editSession) - .to(BlockVector3.at(loc.getBlockX(), finalMaxHeight + offsetY, loc.getBlockZ())) - .ignoreAirBlocks(true) - .maskSource(mask) - .build(); - Operations.complete(op); - } - } catch (IOException | WorldEditException e) { - throw new RuntimeException(e); - } - - saveEditSession(editSession, localSession, actor); - - ChatHelper.logDebug("Pasted schematic: " + schematicPath + " at " + loc + " with rotation " + rotation); - } - - future.complete(null); - }); - - return future; - } - - public static CompletableFuture pasteSchematic(LocalSession localSession, Actor actor, com.sk89q.worldedit.world.World weWorld, Block[][][] blocks, String schematicPath, Location loc, double rotation){ - return pasteSchematicWithMasks(localSession, actor, weWorld, blocks, new ArrayList<>(), schematicPath, loc, rotation); - } - - - /** - * Expands the WorldEdit selection by a given vector. - * - * @param localSession The local session of the actor - * @param vector The vector to expand the selection by - */ - public static void expandSelection(LocalSession localSession, Vector vector){ - BlockVector3 blockVector3 = BlockVector3.at(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ()); - - try { - localSession.getSelection().expand(blockVector3); - } catch (IncompleteRegionException | RegionOperationException e) { - throw new RuntimeException(e); - } - - ChatHelper.logDebug("Expanded selection by: " + vector); - } - - - /** - * Clears the history of a LocalSession. - * @param session The local session to clear the history of - */ - public static void clearHistory(LocalSession session){ - session.clearHistory(); - ChatHelper.logDebug("Cleared history"); - } - - /** - * Undoes the last action of a LocalSession. - * @param session The local session to undo the last action of - * @param player The player who created the structure - * @param amount The amount of actions to undo - */ - public static void undo(LocalSession session, Player player, Actor actor, int amount){ - com.sk89q.worldedit.entity.Player wePlayer = BukkitAdapter.adapt(player); - - for(int i = 0; i < amount; i++) { - BlockBag blockBag = session.getBlockBag(wePlayer); - EditSession undoSession = session.undo(blockBag, wePlayer); - - if (undoSession != null) - WorldEdit.getInstance().flushBlockBag(actor, undoSession); - else - break; - } - } - - /** - * Redoes the last action of a LocalSession. - * @param session The local session to redo the last action of - * @param player The player who created the structure - * @param amount The amount of actions to redo - */ - public static void redo(LocalSession session, Player player, Actor actor, int amount){ - com.sk89q.worldedit.entity.Player wePlayer = BukkitAdapter.adapt(player); - - for(int i = 0; i < amount; i++) { - BlockBag blockBag = session.getBlockBag(wePlayer); - EditSession redoSession = session.redo(blockBag, wePlayer); - - if (redoSession != null) - WorldEdit.getInstance().flushBlockBag(actor, redoSession); - else - break; - } - } - - - - /** - * Sets the gmask of a LocalSession. - * - * @param session The local session to set the gmask of - * @param mask The mask to set. If the mask is null or empty, the gmask will be disabled. - */ - public static void setGmask(LocalSession session, String mask){ - if(mask == null || mask.isEmpty()) { - session.setMask(null); - ChatHelper.logDebug("Disabled gmask"); - return; - } - - try { - ParserContext parserContext = new ParserContext(); - parserContext.setExtent(session.getSelectionWorld()); - - Mask newMask = WorldEdit.getInstance().getMaskFactory().parseFromInput(mask,parserContext); - session.setMask(newMask); - } catch (InputParseException e) { - throw new RuntimeException(e); - } - - ChatHelper.logDebug("Set gmask to: " + mask); - } - - - - - /** - * Commits and saves an edit session. - * - * @param editSession The edit session to commit - * @param localSession The local session to save the edit session to - */ - public static void saveEditSession(EditSession editSession, LocalSession localSession, Actor actor){ - editSession.commit(); - editSession.flushQueue(); - - if(isFastAsyncWorldEditEnabled()) - localSession.remember(actor, localSession.getSelectionWorld(), editSession.getChangeSet(), FaweLimit.MAX); - - editSession.close(); - } - - - - - - - - /*=============================================** - - VECTOR HELPER FUNCTIONS - - **=============================================*/ - - - - /** - * Adjusts the height of a list of vectors so that they are on the surface of the terrain. - * - * @param points List of vectors to adjust - * @param blocks List of blocks in polygon region - */ - public static void adjustHeight(List points, Block[][][] blocks){ - for (Vector point : points) - point.setY(getMaxHeight(blocks, point.getBlockX(), point.getBlockZ(), getIgnoredMaterials())); - } - - /** As long as two neighboring vectors are further than a given distance of blocks apart, add a new vector in between them - * - * @param points The points to populate - * @param distance The distance between the points - * @return The populated points - */ - public static List populatePoints(List points, int distance){ - List result = new ArrayList<>(); - - // Go through all points - boolean found = true; - while(found){ - found = false; - - // Go through all vectors - for (int i = 0; i < points.size() - 1; i++) { - - // Get the two neighboring vectors - Vector p1 = points.get(i).clone(); - Vector p2 = points.get(i+1).clone(); - - //ChatHelper.logDebug("p1: " + p1 + " p2: " + p2 + " distance: " + distance); - - // Add the first point - result.add(p1); - - // If the distance between the two points is greater than the given distance, add a new point in between them - if(p1.distance(p2) > distance){ - Vector v1 = p2.clone().subtract(p1); - Vector v2 = v1.clone().multiply(0.5); - Vector v3 = p1.clone().add(v2); - - // Add the new point - result.add(v3); - found = true; - //ChatHelper.logDebug("Adding new point in between: " + v3); - } - } - - result.add(points.getLast()); - points = result; - result = new ArrayList<>(); - } - - return points; - } - - /** As long as two neighboring vectors are closer than a given distance of blocks apart, remove the second point. The distances switch between distance1 and distance2 - * - * @param points The points to reduce - * @return The reduced points - */ - public static List reducePoints(List points, int distance1, int distance2){ - points = new ArrayList<>(points); - - // Go through all points - boolean found = true; - while(found){ - found = false; - for(int i = 0; i < points.size()-1; i++){ - Vector p1 = points.get(i); - Vector p2 = points.get(i+1); - - int distance = distance1; - // Switch between distance1 and distance2 - if(i%2 == 0) - distance = distance2; - - // If the distance between the two points is less than the given distance, remove the second point - if(p1.distance(p2) < distance){ - points.remove(p2); - found = true; - break; - } - } - } - - return points; - } - - /** Extends a polyline by taking the first two points and the last two points of the polyline and extending them - * - * @param vectors The polyline to extend - * @return The extended polyline - */ - public static List extendPolyLine(List vectors){ - List result = new ArrayList<>(); - - // Get the first two points - Vector p1 = vectors.get(0); - Vector p2 = vectors.get(1); - - // Get the last two points - Vector p3 = vectors.get(vectors.size()-2); - Vector p4 = vectors.getLast(); - - // Get the vectors between the points - Vector v1 = p1.clone().subtract(p2); - Vector v2 = p4.clone().subtract(p3); - - result.add(p1.clone().add(v1)); - result.addAll(vectors); - result.add(p4.clone().add(v2)); - - return result; - } - - /** Shortens a polyline by taking the first two points and the last two points of the polyline and shortening them - * - * @param vectors The polyline to shorten - * @return The shortened polyline - */ - public static List shortenPolyLine(List vectors, int distance){ - List result = new ArrayList<>(); - - if(vectors.size() < 4) - return vectors; - - // Get the first two points - Vector p1 = vectors.get(0); - Vector p2 = vectors.get(1); - - // Get the last two points - Vector p3 = vectors.get(vectors.size()-2); - Vector p4 = vectors.getLast(); - - // Get the vectors between the points - Vector v1 = p2.clone().subtract(p1); - Vector v2 = p3.clone().subtract(p4); - - // Shorten the vectors - v1 = v1.clone().normalize().multiply(distance); - v2 = v2.clone().normalize().multiply(distance); - - // Remove the first and last points - vectors.removeFirst(); - vectors.removeLast(); - - // Add the shortened vectors - result.add(p1.clone().add(v1)); - result.addAll(vectors); - result.add(p4.clone().add(v2)); - - return result; - } - - /** Returns the closest vector from a list of vectors to a reference vector - * - * @param vectors List of vectors to search through - * @param reference Reference vector to compare to - * @return Closest vector to the reference vector - */ - public static Vector getClosestVector(List vectors, Vector reference){ - Vector closestVector = null; - double closestDistance = Double.MAX_VALUE; - - for(Vector vector : vectors){ - double distance = vector.distance(reference); - if(distance < closestDistance){ - closestVector = vector; - closestDistance = distance; - } - } - - if(closestVector == null) - return null; - - return closestVector.clone(); - } - - /** - * Returns the given vector with the height of the point matching the surface of the terrain. - * - * @param vector The vector to get the height from - * @param blocks The dataset to get the height from - * @return The vector with the height matching the surface of the terrain - */ - private static Vector getXYZ(Vector vector, Block[][][] blocks){ - int maxHeight = vector.getBlockY(); - - if(blocks != null) - maxHeight = getMaxHeight(blocks, vector.getBlockX(), vector.getBlockZ(), getIgnoredMaterials()); - if(maxHeight == 0) - maxHeight = vector.getBlockY(); - - return vector.setY(maxHeight); - } - - /** - * Returns a XYZ String with the height of the point matching the surface of the terrain. - * - * @param vector The vector to get the XYZ String from - * @param blocks The dataset to get the height from - * @return The XYZ String - */ - public static String getXYZWithVerticalOffset(Vector vector, Block[][][] blocks, int offset){ - int maxHeight = vector.getBlockY(); - - if(blocks != null) - maxHeight = getMaxHeight(blocks, vector.getBlockX(), vector.getBlockZ(), getIgnoredMaterials()) + offset; - if(maxHeight == 0) - maxHeight = vector.getBlockY(); - - return vector.getBlockX() + "," + maxHeight + "," + vector.getBlockZ(); - } - - private static Path64 convertVectorListToPath64(List vectors, Vector reference){ - List points = new ArrayList<>(); - for(Vector vector : vectors) - points.add(new Point64(vector.getBlockX() - reference.getBlockX(), vector.getBlockZ() - reference.getBlockZ())); - - return new Path64(points); - } - - private static List> convertPathsToVectorList(Paths64 pathsD, Vector reference, int minHeight, int maxHeight){ - List> vectors = new ArrayList<>(); - - for(Path64 path : new ArrayList<>(pathsD)) { - List vectorList = new ArrayList<>(); - - for(Point64 point : new ArrayList<>(path)) - vectorList.add(new Vector(point.x + reference.getX(), minHeight, point.y + reference.getZ())); - - Vector vector = vectorList.getLast().setY(maxHeight); - vectorList.set(vectorList.size() - 1, vector); - - vectors.add(vectorList); - } - - return vectors; - } - - /** - * Shifts the points in a polyline by a given amount. - * Sometimes during shifting there are multiple paths created. - * For example, if you have a polyline that intersects itself, there is an inner and outer path. - * This method can either return all the paths or just the longest one. - * - * @see #shiftPointsAll(List, double) - * - * @param vectors The polyline to shift - * @param shift The amount to shift the points by - * @param useLongestPathOnly Whether to only return the longest path - * @return The shifted polyline - */ - public static List shiftPoints(List vectors, double shift, boolean useLongestPathOnly) { - List> resultVectors = shiftPointsAll(vectors, shift); - - // If we only want the longest path, find it and return it - if(useLongestPathOnly){ - int longestPathIndex = 0; - int longestPathLength = 0; - for(int i = 0; i < resultVectors.size(); i++){ - if(resultVectors.get(i).size() > longestPathLength){ - longestPathIndex = i; - longestPathLength = resultVectors.get(i).size(); - } - } - - return resultVectors.get(longestPathIndex); - - // Otherwise, return all paths combined into one - }else{ - List result = new ArrayList<>(); - for(List vectorList : resultVectors) - result.addAll(vectorList); - - return result; - } - } - - /** - * Shifts the points in a polyline by a given amount. - * Sometimes during shifting there are multiple paths created. - * For example, if you have a polyline that intersects itself, there is an inner and outer path. - * This method returns a list of all the paths. - * - * @see #shiftPoints(List, double, boolean) - * - * @param vectors The polyline to shift - * @param shift The amount to shift the points by - * @return The shifted polyline - */ - public static List> shiftPointsAll(List vectors, double shift) { - Vector reference = vectors.getFirst(); - int minHeight = getMinHeight(vectors); - int maxHeight = getMaxHeight(vectors); - Paths64 paths = new Paths64(); - paths.add(convertVectorListToPath64(vectors, reference)); - Paths64 inflatedPath = Clipper.InflatePaths(paths, shift, JoinType.Round, EndType.Butt, 2); - - return convertPathsToVectorList(inflatedPath, reference, minHeight, maxHeight); - } - - /** - * Gets the minimum height of a list of vectors - * - * @param vectors The list of vectors to get the minimum height of - * @return The minimum height - */ - public static int getMinHeight(List vectors){ - int minHeight = Integer.MAX_VALUE; - for(Vector vector : vectors) - minHeight = Math.min(minHeight, vector.getBlockY()); - - return minHeight; - } - - /** - * Gets the maximum height of a list of vectors - * - * @param vectors The list of vectors to get the maximum height of - * @return The maximum height - */ - private static int getMaxHeight(List vectors){ - int maxHeight = Integer.MIN_VALUE; - for(Vector vector : vectors) - maxHeight = Math.max(maxHeight, vector.getBlockY()); - - return maxHeight; - } - - - - - - /*=============================================** - - PREPARATION CHECK FUNCTIONS - - **=============================================*/ - - - - /** - * Checks if Schematic Brush is installed and sends the player a message if it isn't. - * - * @param p The player to check for - * @return Whether Schematic Brush is installed - */ - public static boolean checkIfSchematicBrushIsInstalled(Player p){ - // Check if WorldEdit is enabled - if (!isSchematicBrushEnabled()) { - p.sendMessage("§cPlease install Schematic Brush to use this tool. You can ask the server administrator to install it."); - - return false; - } - return true; - } - - - /** - * Checks if the player has a WorldEdit selection and sends them a message if they don't. - * - * @param p The player to check for - * @return Whether the player has a WorldEdit selection - */ - public static boolean checkForNoWorldEditSelection(Player p){ - // Get WorldEdit selection of player - Region polyRegion = getWorldEditSelection(p); - - if(polyRegion != null) - return false; - - p.sendMessage("§cPlease make a WorldEdit Selection first."); - p.closeInventory(); - p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F); - return true; - } - - - /** - * Checks if the player has a brick block in their selection and sends them a message if they don't. - * - * @param p The player to check for - * @return Whether the player has a brick block in their selection - */ - public static boolean checkForBrickOutline(Block[][][] blocks, Player p, WikiDocumented w){ - if(!containsBlock(blocks, XMaterial.BRICKS)){ - p.sendMessage("§cPlease make a selection around an outline."); - p.closeInventory(); - p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F); - w.sendWikiLink(p); - - return false; - } - - return true; - } - - /** - * Checks if the player has a yellow wool block in their selection and sends them a message if they don't. - * - * @param p The player to check for - * @return Whether the player has a yellow wool block in their selection - */ - public static boolean checkForWoolBlock(Block[][][] blocks, Player p, WikiDocumented w){ - if(!containsBlock(blocks, XMaterial.YELLOW_WOOL)){ - p.sendMessage("§cPlease place a yellow wool block inside the outline."); - p.closeInventory(); - p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0F, 1.0F); - w.sendWikiLink(p); - - ItemStack yellowWool = XMaterial.YELLOW_WOOL.parseItem(); - if(!p.getInventory().contains(yellowWool)) { - p.getInventory().setItem(4, yellowWool); - p.playSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.0F, 1.0F); - } - - return false; - } - return true; - } -} \ No newline at end of file diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java index 4d5e92ec..f5751b53 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java +++ b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java @@ -1,7 +1,7 @@ package net.buildtheearth.modules.miscellaneous.blockpalettegui; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.menus.AbstractPaginatedMenu; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -11,10 +11,10 @@ import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.plugin.java.JavaPlugin; import org.ipvp.canvas.Menu; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; -import org.bukkit.plugin.java.JavaPlugin; import java.util.*; import java.util.function.Consumer; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java index b1448091..8176f581 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java +++ b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java @@ -1,7 +1,7 @@ package net.buildtheearth.modules.miscellaneous.blockpalettegui; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.menus.AbstractMenu; import org.bukkit.Material; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java index f27ef7d7..a26c6369 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java +++ b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java @@ -1,7 +1,7 @@ package net.buildtheearth.modules.miscellaneous.blockpalettegui; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.menus.AbstractMenu; import org.bukkit.Bukkit; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java index d43dfc80..eb7f8404 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java +++ b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java @@ -1,7 +1,7 @@ package net.buildtheearth.modules.miscellaneous.blockpalettegui; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.menus.AbstractMenu; import org.bukkit.Bukkit; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java index c03e3067..da0475ac 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java +++ b/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java @@ -1,7 +1,7 @@ package net.buildtheearth.modules.miscellaneous.blockpalettegui; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractPaginatedMenu; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java b/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java index 03864890..a22be73b 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java +++ b/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.navigation; +import com.alpsbte.alpslib.utils.ChatHelper; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import lombok.experimental.UtilityClass; @@ -7,7 +8,6 @@ import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.utils.ChatHelper; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.HoverEvent; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/NavigatorComponent.java b/src/main/java/net/buildtheearth/modules/navigation/components/navigator/NavigatorComponent.java index bc21d043..272f65ab 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/NavigatorComponent.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/navigator/NavigatorComponent.java @@ -1,12 +1,12 @@ package net.buildtheearth.modules.navigation.components.navigator; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import com.sk89q.worldedit.WorldEdit; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.ModuleComponent; import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.utils.ChatHelper; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.io.ConfigPaths; import net.buildtheearth.utils.io.ConfigUtil; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/BuildteamCommand.java b/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/BuildteamCommand.java index 3a4c1c46..7716901f 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/BuildteamCommand.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/BuildteamCommand.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.navigation.components.navigator.commands; +import com.alpsbte.alpslib.utils.ChatHelper; import net.buildtheearth.modules.navigation.NavUtils; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.model.BuildTeam; import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/NavigatorCommand.java b/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/NavigatorCommand.java index b368777c..03063c43 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/NavigatorCommand.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/NavigatorCommand.java @@ -1,9 +1,9 @@ package net.buildtheearth.modules.navigation.components.navigator.commands; -import net.buildtheearth.modules.navigation.menu.MainMenu; +import com.alpsbte.alpslib.utils.ChatHelper; import net.buildtheearth.modules.navigation.NavigationModule; +import net.buildtheearth.modules.navigation.menu.MainMenu; import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java b/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java index c49435c5..2ddbc302 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.navigation.components.tpll; +import com.alpsbte.alpslib.utils.ChatHelper; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; @@ -7,7 +8,6 @@ import net.buildtheearth.modules.ModuleComponent; import net.buildtheearth.modules.navigation.NavUtils; import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.GeometricUtils; import org.bukkit.Bukkit; import org.bukkit.Location; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllJoinListener.java b/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllJoinListener.java index af8b28d5..9483e89f 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllJoinListener.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllJoinListener.java @@ -1,8 +1,8 @@ package net.buildtheearth.modules.navigation.components.tpll.listeners; +import com.alpsbte.alpslib.utils.ChatHelper; import net.buildtheearth.modules.navigation.NavigationModule; import net.buildtheearth.modules.navigation.components.tpll.TpllComponent; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllListener.java b/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllListener.java index 0f4d0934..837ada94 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllListener.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllListener.java @@ -1,13 +1,13 @@ package net.buildtheearth.modules.navigation.components.tpll.listeners; import com.alpsbte.alpslib.utils.AlpsUtils; +import com.alpsbte.alpslib.utils.ChatHelper; import net.buildtheearth.modules.navigation.NavUtils; import net.buildtheearth.modules.navigation.NavigationModule; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.api.OpenStreetMapAPI; import net.buildtheearth.modules.network.model.BuildTeam; import net.buildtheearth.modules.network.model.Region; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerCommandPreprocessEvent; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java index 0064ace7..6e4e1482 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.navigation.components.warps; +import com.alpsbte.alpslib.utils.ChatHelper; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; @@ -15,7 +16,6 @@ import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.api.OpenStreetMapAPI; import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.GeometricUtils; import net.buildtheearth.utils.geo.CoordinateConversion; import net.buildtheearth.utils.menus.AbstractMenu; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpCommand.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpCommand.java index c7363d17..1da940c4 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpCommand.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpCommand.java @@ -1,11 +1,11 @@ package net.buildtheearth.modules.navigation.components.warps.commands; +import com.alpsbte.alpslib.utils.ChatHelper; import net.buildtheearth.modules.navigation.NavigationModule; import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; import net.buildtheearth.modules.navigation.components.warps.model.Warp; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/listeners/WarpJoinListener.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/listeners/WarpJoinListener.java index 6771a91c..b140de92 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/listeners/WarpJoinListener.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/listeners/WarpJoinListener.java @@ -1,8 +1,8 @@ package net.buildtheearth.modules.navigation.components.warps.listeners; +import com.alpsbte.alpslib.utils.ChatHelper; import net.buildtheearth.modules.navigation.NavigationModule; import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java index 10321e68..d17b9a5e 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java @@ -1,9 +1,9 @@ package net.buildtheearth.modules.navigation.components.warps.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.Utils; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/MaterialSelectionMenu.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/MaterialSelectionMenu.java index 91352685..bfed7047 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/MaterialSelectionMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/MaterialSelectionMenu.java @@ -1,11 +1,15 @@ package net.buildtheearth.modules.navigation.components.warps.menu; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.BuildTeamTools; +import net.buildtheearth.modules.navigation.components.warps.model.Warp; import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; -import net.buildtheearth.utils.*; +import net.buildtheearth.utils.CustomHeads; +import net.buildtheearth.utils.ListUtil; +import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; import net.buildtheearth.utils.menus.BookMenu; import net.wesjd.anvilgui.AnvilGUI; import org.bukkit.Sound; @@ -43,7 +47,7 @@ public MaterialSelectionMenu(Player menuPlayer, Object object, boolean alreadyEx @Override protected void setMenuItemsAsync() { - getMenu().getSlot(MATERIAL_SLOT).setItem(Item.create(XMaterial.STONE.parseMaterial(), "§6§lItem", ListUtil.createList("", "Change the material of the warp", "to a minecraft item.", "", "§eExample:", "Stone"))); + getMenu().getSlot(MATERIAL_SLOT).setItem(Item.create(XMaterial.STONE.get(), "§6§lItem", ListUtil.createList("", "Change the material of the warp", "to a minecraft item.", "", "§eExample:", "Stone"))); getMenu().getSlot(CUSTOM_HEAD_SLOT).setItem(CustomHeads.getLetterHead("?", CustomHeads.LetterType.WOODEN, "§6§lCustom Head", ListUtil.createList("", "Change the material of the warp", "to a custom head texture URL.", "", "§eExample:", "https://textures.minecraft.net/texture/..."))); if(object instanceof Warp) diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpEditMenu.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpEditMenu.java index 1a65bb87..4e52875f 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpEditMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpEditMenu.java @@ -1,14 +1,18 @@ package net.buildtheearth.modules.navigation.components.warps.menu; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.BuildTeamTools; +import net.buildtheearth.modules.navigation.components.warps.model.Warp; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.api.OpenStreetMapAPI; import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.*; +import net.buildtheearth.utils.CustomHeads; +import net.buildtheearth.utils.ListUtil; +import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.geo.CoordinateConversion; import net.buildtheearth.utils.menus.AbstractMenu; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; import net.wesjd.anvilgui.AnvilGUI; import org.bukkit.Location; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupEditMenu.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupEditMenu.java index 2abc56e2..fc2707f5 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupEditMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupEditMenu.java @@ -1,14 +1,18 @@ package net.buildtheearth.modules.navigation.components.warps.menu; import com.alpsbte.alpslib.utils.AlpsUtils; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.BuildTeamTools; +import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.*; +import net.buildtheearth.utils.CustomHeads; +import net.buildtheearth.utils.ListUtil; +import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; import net.buildtheearth.utils.menus.BookMenu; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; import net.wesjd.anvilgui.AnvilGUI; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupMenu.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupMenu.java index 235e32c4..b4f44a8b 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupMenu.java @@ -1,5 +1,7 @@ package net.buildtheearth.modules.navigation.components.warps.menu; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import com.google.gson.Gson; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.navigation.NavigationModule; @@ -7,9 +9,7 @@ import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.model.BuildTeam; import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.io.ConfigPaths; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpMenu.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpMenu.java index d80c4438..b35247ef 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpMenu.java @@ -1,12 +1,12 @@ package net.buildtheearth.modules.navigation.components.warps.menu; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.modules.navigation.NavigationModule; import net.buildtheearth.modules.navigation.components.warps.model.Warp; import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.model.Permissions; import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractPaginatedMenu; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/Warp.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/Warp.java index ac5d7039..3eb5bd0b 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/Warp.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/Warp.java @@ -1,9 +1,12 @@ package net.buildtheearth.modules.navigation.components.warps.model; +import com.alpsbte.alpslib.utils.item.Item; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; -import net.buildtheearth.utils.*; +import net.buildtheearth.utils.CustomHeads; +import net.buildtheearth.utils.ListUtil; +import net.buildtheearth.utils.Utils; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.json.JSONObject; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/WarpGroup.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/WarpGroup.java index e51282e8..6499973e 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/WarpGroup.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/WarpGroup.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.navigation.components.warps.model; +import com.alpsbte.alpslib.utils.item.Item; import lombok.Getter; import lombok.Setter; import net.buildtheearth.modules.network.model.BuildTeam; import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/modules/navigation/menu/CountrySelectorMenu.java b/src/main/java/net/buildtheearth/modules/navigation/menu/CountrySelectorMenu.java index aafb89d1..868abbaa 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/menu/CountrySelectorMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/menu/CountrySelectorMenu.java @@ -1,5 +1,7 @@ package net.buildtheearth.modules.navigation.menu; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import lombok.NonNull; import net.buildtheearth.modules.navigation.NavUtils; import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; @@ -8,8 +10,6 @@ import net.buildtheearth.modules.network.model.Continent; import net.buildtheearth.modules.network.model.Permissions; import net.buildtheearth.modules.network.model.Region; -import net.buildtheearth.utils.ChatHelper; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractPaginatedMenu; diff --git a/src/main/java/net/buildtheearth/modules/navigation/menu/ExploreMenu.java b/src/main/java/net/buildtheearth/modules/navigation/menu/ExploreMenu.java index ba3a6a97..c29be7fc 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/menu/ExploreMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/menu/ExploreMenu.java @@ -1,10 +1,10 @@ package net.buildtheearth.modules.navigation.menu; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.network.model.Continent; -import net.buildtheearth.utils.ChatHelper; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/navigation/menu/MainMenu.java b/src/main/java/net/buildtheearth/modules/navigation/menu/MainMenu.java index 1d9b7dbc..db12d2eb 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/menu/MainMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/menu/MainMenu.java @@ -1,12 +1,12 @@ package net.buildtheearth.modules.navigation.menu; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.navigation.NavUtils; import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.utils.ChatHelper; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.io.ConfigPaths; import net.buildtheearth.utils.io.ConfigUtil; @@ -19,12 +19,7 @@ import org.ipvp.canvas.mask.Mask; import org.jetbrains.annotations.NotNull; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Deque; -import java.util.List; -import java.util.Objects; +import java.util.*; /** * The main menu for the BTE universal navigator.
diff --git a/src/main/java/net/buildtheearth/modules/navigation/menu/StateSelectorMenu.java b/src/main/java/net/buildtheearth/modules/navigation/menu/StateSelectorMenu.java index a239bc8f..6f4bf270 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/menu/StateSelectorMenu.java +++ b/src/main/java/net/buildtheearth/modules/navigation/menu/StateSelectorMenu.java @@ -1,12 +1,12 @@ package net.buildtheearth.modules.navigation.menu; +import com.alpsbte.alpslib.utils.ChatHelper; +import com.alpsbte.alpslib.utils.item.Item; import lombok.NonNull; import net.buildtheearth.modules.navigation.NavUtils; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.model.Region; import net.buildtheearth.modules.network.model.RegionType; -import net.buildtheearth.utils.ChatHelper; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractPaginatedMenu; diff --git a/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java b/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java index f63fcfa4..d15061d8 100644 --- a/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java +++ b/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java @@ -1,5 +1,6 @@ package net.buildtheearth.modules.network.api; +import com.alpsbte.alpslib.utils.ChatHelper; import lombok.experimental.UtilityClass; import net.buildtheearth.BuildTeamTools; import net.buildtheearth.modules.navigation.NavUtils; @@ -10,7 +11,6 @@ import net.buildtheearth.modules.network.model.Continent; import net.buildtheearth.modules.network.model.Region; import net.buildtheearth.modules.network.model.RegionType; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.io.ConfigPaths; import okhttp3.MediaType; import okhttp3.RequestBody; diff --git a/src/main/java/net/buildtheearth/modules/network/api/OpenStreetMapAPI.java b/src/main/java/net/buildtheearth/modules/network/api/OpenStreetMapAPI.java index 41cd903e..b9406963 100644 --- a/src/main/java/net/buildtheearth/modules/network/api/OpenStreetMapAPI.java +++ b/src/main/java/net/buildtheearth/modules/network/api/OpenStreetMapAPI.java @@ -1,6 +1,6 @@ package net.buildtheearth.modules.network.api; -import net.buildtheearth.utils.ChatHelper; +import com.alpsbte.alpslib.utils.ChatHelper; import org.jetbrains.annotations.NotNull; import org.json.simple.JSONArray; import org.json.simple.JSONObject; diff --git a/src/main/java/net/buildtheearth/modules/network/model/BuildTeam.java b/src/main/java/net/buildtheearth/modules/network/model/BuildTeam.java index 3472a30c..825b6f8e 100644 --- a/src/main/java/net/buildtheearth/modules/network/model/BuildTeam.java +++ b/src/main/java/net/buildtheearth/modules/network/model/BuildTeam.java @@ -1,12 +1,12 @@ package net.buildtheearth.modules.network.model; +import com.alpsbte.alpslib.utils.ChatHelper; import lombok.Getter; import net.buildtheearth.modules.navigation.components.warps.model.Warp; import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; import net.buildtheearth.modules.network.NetworkModule; import net.buildtheearth.modules.network.api.API; import net.buildtheearth.modules.network.api.NetworkAPI; -import net.buildtheearth.utils.ChatHelper; import org.bukkit.entity.Player; import java.io.IOException; diff --git a/src/main/java/net/buildtheearth/modules/stats/menu/StatsMenu.java b/src/main/java/net/buildtheearth/modules/stats/menu/StatsMenu.java index 0745c4d1..7e18e47f 100644 --- a/src/main/java/net/buildtheearth/modules/stats/menu/StatsMenu.java +++ b/src/main/java/net/buildtheearth/modules/stats/menu/StatsMenu.java @@ -1,11 +1,11 @@ package net.buildtheearth.modules.stats.menu; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.modules.stats.StatsModule; import net.buildtheearth.modules.stats.model.StatsPlayer; import net.buildtheearth.modules.stats.model.StatsServer; import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.ListUtil; import net.buildtheearth.utils.MenuItems; import net.buildtheearth.utils.menus.AbstractMenu; diff --git a/src/main/java/net/buildtheearth/utils/ChatHelper.java b/src/main/java/net/buildtheearth/utils/ChatHelper.java deleted file mode 100644 index 43020a0b..00000000 --- a/src/main/java/net/buildtheearth/utils/ChatHelper.java +++ /dev/null @@ -1,165 +0,0 @@ -package net.buildtheearth.utils; - -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.io.ConfigPaths; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.TextComponent; -import net.kyori.adventure.text.format.NamedTextColor; -import net.kyori.adventure.text.format.TextDecoration; -import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.jetbrains.annotations.Nullable; - -import java.util.Arrays; -import java.util.logging.Level; - -public class ChatHelper { - - public static TextComponent PREFIX_COMPONENT = LegacyComponentSerializer.legacyAmpersand().deserialize(BuildTeamTools.PREFIX); - - public static boolean DEBUG; - - static { - BuildTeamTools.getInstance().getConfig(); - DEBUG = BuildTeamTools.getInstance().getConfig().getBoolean(ConfigPaths.DEBUG, false); - } - - - // ------------------ LOGGING ------------------ - - public static void logError(String errorMessage, Object... objects) { - Bukkit.getLogger().log(Level.INFO, ChatHelper.getErrorString(errorMessage, objects)); - } - - public static void logError(String errorMessage, Exception e, Object... objects) { - BuildTeamTools.getInstance().getComponentLogger().error(ChatHelper.getErrorComponent(errorMessage, objects), e); - } - - public static void log(String string, Object... objects) { - Bukkit.getConsoleSender().sendMessage( getConsoleString(string, objects)); - } - - public static void logDebug(String string, Object... objects) { - if(DEBUG || BuildTeamTools.getInstance().isDebug()) - Bukkit.getLogger().log(Level.INFO, getConsoleString(string, objects)); - } - - public static String getConsoleString(String string, Object... objects) { - return BuildTeamTools.CONSOLE_PREFIX + String.format(string, objects); - } - - - - // ------------------ STANDARD TEXT (Gray & Yellow) ------------------ - - public static Component getStandardComponent(boolean containsPrefix, String string, Object... objects) { - Component component = LegacyComponentSerializer.legacyAmpersand().deserialize( - String.format(string.replaceAll("%s", "&e%s&7"), objects) - ).color(NamedTextColor.GRAY); - - return containsPrefix ? PREFIX_COMPONENT.append(component) : component; - } - - public static String getStandardString(boolean containsPrefix, String string, Object... objects) { - return convertComponentToLegacyString(getStandardComponent(containsPrefix, string, objects)); - } - - public static String getStandardString(String string, Object... objects) { - return getStandardString(true, string, objects); - } - - public static void sendStandardMessage(Player player, String string, Object... objects) { - player.sendMessage(getStandardComponent(true, string, objects)); - } - - public static void sendStandardMessage(Player player, boolean containsPrefix, String string, Object... objects) { - player.sendMessage(getStandardComponent(containsPrefix, string, objects)); - } - - - // ------------------ SUCCESS TEXT (Gray & Green Text) ------------------ - - public static Component getSuccessComponent(String string, Object... objects) { - return PREFIX_COMPONENT.append( - LegacyComponentSerializer.legacyAmpersand().deserialize( - String.format(string.replaceAll("%s", "&a%s&7"), objects) - ).color(NamedTextColor.GRAY) - ); - } - - public static void sendSuccessfulMessage(Player player, String string, Object... objects) { - player.sendMessage(getSuccessComponent(string, objects)); - } - - - - // ------------------ ERROR TEXT (Red & Yellow Text) ------------------ - - public static Component getErrorComponent(String string, Object... objects) { - return LegacyComponentSerializer.legacyAmpersand().deserialize( - String.format(string.replaceAll("%s", "&e%s&c"), objects) - ).color(NamedTextColor.RED); - } - - public static String getErrorString(String string, Object... objects) { - return convertComponentToLegacyString(getErrorComponent(string, objects)); - } - - public static void sendErrorMessage(Player player, String string, Object... objects) { - player.sendMessage(getErrorString(string, objects)); - } - - - // ------------------ COLORIZED TEXT ------------------ - - public static Component getColorizedComponent(NamedTextColor color, String string, boolean bold) { - return Component.text(string).color(color).decoration(TextDecoration.BOLD, bold); - } - - public static String getColorizedString(NamedTextColor color, String string, boolean bold) { - return convertComponentToLegacyString(getColorizedComponent(color, string, bold)); - } - - - - /** Sends the given message to the given player and the console - * - * @param p player to send the message to. If null, the message will only be sent to the console - * @param message message to send - * @param logLevel log level to use for the console - */ - public static void logPlayerAndConsole(@Nullable Player p, String message, Level logLevel){ - if(p != null) - p.sendMessage(message); - - BuildTeamTools.getInstance().getLogger().log(logLevel, message); - } - - public static void sendMessageBox(CommandSender sender, String title, Runnable runnable) { - sender.sendMessage(""); - sender.sendMessage("§7§m==============§e§l " + title + " §7§m=============="); - sender.sendMessage(""); - - runnable.run(); - - int length = org.bukkit.ChatColor.stripColor(title).length(); - char[] array = new char[length]; - Arrays.fill(array, '='); - String bottom = "==============================" + new String(array); - sender.sendMessage(""); - sender.sendMessage("§7§m" + bottom); - } - - public static void sendMessageToPlayersNearLocation(Location location, String message, double maxDistance) { - for (Player player : location.getWorld().getNearbyEntitiesByType(Player.class, location, maxDistance)) { - player.sendMessage(message); - } - } - - private static String convertComponentToLegacyString(Component component) { - return LegacyComponentSerializer.legacyAmpersand().serialize(component).replace("&", "§"); - } -} diff --git a/src/main/java/net/buildtheearth/utils/CustomHeads.java b/src/main/java/net/buildtheearth/utils/CustomHeads.java index a9866201..f29317d1 100644 --- a/src/main/java/net/buildtheearth/utils/CustomHeads.java +++ b/src/main/java/net/buildtheearth/utils/CustomHeads.java @@ -1,5 +1,6 @@ package net.buildtheearth.utils; +import com.alpsbte.alpslib.utils.item.Item; import org.bukkit.inventory.ItemStack; import java.util.ArrayList; diff --git a/src/main/java/net/buildtheearth/utils/Item.java b/src/main/java/net/buildtheearth/utils/Item.java deleted file mode 100644 index 0b37f465..00000000 --- a/src/main/java/net/buildtheearth/utils/Item.java +++ /dev/null @@ -1,513 +0,0 @@ -package net.buildtheearth.utils; - -import com.cryptomorin.xseries.XMaterial; -import com.cryptomorin.xseries.profiles.builder.XSkull; -import com.cryptomorin.xseries.profiles.objects.Profileable; -import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.world.block.BlockTypes; -import org.bukkit.Bukkit; -import org.bukkit.Color; -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.inventory.ItemFlag; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.inventory.meta.LeatherArmorMeta; -import org.bukkit.inventory.meta.SkullMeta; -import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jspecify.annotations.NonNull; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -/** - * This class provides static utility methods and a fluent builder API for creating and modifying {@link ItemStack} objects in Bukkit.
- * It supports the customization of items with names, lore, enchantments, attributes, and skull textures. - *

- * The following dependencies are required: - *
    - *
  1. Bukkit API
  2. - *
  3. HeadDatabaseAPI
  4. (removed for BuildTeamTools) - *
  5. XMaterial from XSeries
  6. - *
- * - *
- * The functions are categorized into the following sections: - * - *

Builder Pattern Methods: - *
These methods allow chaining item properties using a fluent API: - *
• {@link #setDisplayName(String)} - *
• {@link #setAmount(int)} - *
• {@link #setLore(List)} - *
• {@link #addEnchantment(Enchantment, int)} - *
• {@link #hideAttributes(boolean)} - *
• {@link #hideEnchantments(boolean)} - *
• {@link #build()} - * - *

Item Creation Methods: - *
Static methods to quickly create customized {@link ItemStack} instances: - *
• {@link #create(Material)} - *
• {@link #create(Material, int)} - *
• {@link #create(Material, String)} - *
• {@link #create(Material, String, int)} - *
• {@link #create(Material, String, List)} - *
• {@link #create(Material, String, short, List)} - *
• {@link #create(Material, String, int, List)} - *
• {@link #create(Material, String, List, Enchantment, Integer)} - *
• {@link #create(Material, String, List, Enchantment, Integer, Enchantment, Integer)} - *
• {@link #create(Material, String, List, Enchantment, Integer, Enchantment, Integer, Enchantment, Integer)} - * - *

Leather Armor Creation Methods: - *
Special methods for creating and coloring leather armor: - *
• {@link #createLeatherArmor(Material, Color)} - *
• {@link #createLeatherArmor(Material, String, Color, List)} - *
• {@link #createLeatherArmor(Material, String, Color, List, Enchantment, Integer)} - *
• {@link #createLeatherArmor(Material, String, Color, List, Enchantment, Integer, Enchantment, Integer)} - *
• {@link #createLeatherArmor(Material, String, Color, List, Enchantment, Integer, Enchantment, Integer, Enchantment, Integer)} - * - *

Item Editing Methods: - *
Modify existing {@link ItemStack} objects: - *
• {@link #edit(ItemStack, Material)} - *
• {@link #edit(ItemStack, int)} - *
• {@link #edit(ItemStack, String)} - *
• {@link #edit(ItemStack, int, String)} - *
• {@link #edit(ItemStack, List)} - *
• {@link #edit(ItemStack, int, String, List)} - * - *

Material Conversion Utilities: - *
Utility methods to convert between {@link Material}, {@link XMaterial}, and {@link ItemStack} representations: - *
• {@link #fromUniqueMaterialString(String)} – Converts a namespaced string to an {@link ItemStack}. - *
• {@link #getUniqueMaterialString(ItemStack)} – Gets the namespaced key of an {@link ItemStack}'s material. - *
• {@link #getUniqueMaterialString(XMaterial)} – Gets the namespaced key of an {@link XMaterial}. - *
• {@link #getUniqueMaterialString(XMaterial[])} – Gets a comma-separated list of namespaced keys from multiple {@link XMaterial}s. - *
• {@link #convertStringToXMaterial(String)} – Converts a string to an {@link XMaterial}, fallback to Bukkit {@link Material} if needed. - *
• {@link #convertXMaterialToWEBlockType(XMaterial)} – Converts an {@link XMaterial} to a WorldEdit {@link BlockType}. - *
• {@link #createStringFromItemStringList(ArrayList)} – Converts a list of material strings to a comma-separated namespaced material string. - *
• {@link #createStringFromItemStringList(String...)} – Converts an array of material strings to a comma-separated namespaced material string. - * - *

Skull Creation Methods: - *
Utility methods to create player and custom skulls: - *
• {@link #createPlayerHead(String, String)} - *
• {@link #createPlayerHead(String, String, List)} - *
• {@link #createPlayerHead(String, String, int, List)} - * - * @version 1.3.4 - * @author MineFact, Zoriot - */ -@SuppressWarnings({"deprecation", "unused"}) -public class Item { - public static final Map nonPlayerSkulls = new ConcurrentHashMap<>(); - - private ItemStack item; - - private Material material; - - private String displayName; - - private int amount = 1; - - private List lore; - - private boolean hideAttributes; - - private boolean hideEnchantments; - - private final Map enchantments = new HashMap<>(); - - public Item(Material material) { - this.material = material; - } - - public Item(ItemStack item) { - this.item = item; - } - - public Item setDisplayName(String name) { - this.displayName = name; - return this; - } - - public Item setAmount(int amount) { - this.amount = amount; - return this; - } - - public Item setLore(List lore) { - this.lore = lore; - return this; - } - - public Item addEnchantment(Enchantment enchantment, int level) { - this.enchantments.put(enchantment, level); - return this; - } - - public Item hideAttributes(boolean hide) { - this.hideAttributes = hide; - return this; - } - - public Item hideEnchantments(boolean enchants) { - this.hideEnchantments = enchants; - return this; - } - - public ItemStack build() { - ItemStack item; - if (this.item != null) - item = this.item.clone(); - else - item = new ItemStack(this.material); - - item.setAmount(this.amount); - - for (Enchantment en : this.enchantments.keySet()) - item.addUnsafeEnchantment(en, this.enchantments.get(en)); - - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(this.displayName); - itemmeta.setLore(this.lore); - if (this.hideAttributes) itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - if (this.hideEnchantments) itemmeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); - item.setItemMeta(itemmeta); - return item; - } - - - // ============================== - // SECTION: Item Creation Methods - // ============================== - - - private static @NonNull ItemStack createItem(Material material, String name, int amount, List lore, - Map enchantments) { - ItemStack item = new ItemStack(material, amount); - if (enchantments != null) - for (Map.Entry e : enchantments.entrySet()) - item.addUnsafeEnchantment(e.getKey(), e.getValue()); - - ItemMeta meta = item.getItemMeta(); - if (name != null) - meta.setDisplayName(name); - if (lore != null) - meta.setLore(lore); - meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(meta); - return item; - } - - private static @NonNull ItemStack createLeatherArmorItem(Material material, String name, Color color, - List lore, Map enchantments) { - ItemStack item = new ItemStack(material); - if (enchantments != null) - for (Map.Entry e : enchantments.entrySet()) - item.addUnsafeEnchantment(e.getKey(), e.getValue()); - - - LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta(); - if (name != null) - meta.setDisplayName(name); - if (lore != null) - meta.setLore(lore); - meta.setColor(color); - meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(meta); - return item; - } - - @Contract("_ -> new") - public static @NonNull ItemStack create(Material material) { - return new ItemStack(material); - } - - @Contract("_, _ -> new") - public static @NonNull ItemStack create(Material material, int amount) { - return new ItemStack(material, amount); - } - - public static @NonNull ItemStack create(Material material, String name) { - return createItem(material, name, 1, null, null); - } - - public static @NonNull ItemStack create(Material material, String name, int amount) { - return createItem(material, name, amount, null, null); - } - - public static @NonNull ItemStack create(Material material, String name, List lore) { - return createItem(material, name, 1, lore, null); - } - - public static @NonNull ItemStack create(Material material, String name, short durability, List lore) { - ItemStack item = createItem(material, name, 1, lore, null); - item.setDurability(durability); - return item; - } - - public static @NonNull ItemStack create(Material material, String name, int amount, List lore) { - return createItem(material, name, amount, lore, null); - } - - public static @NonNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore) { - return createLeatherArmorItem(material, name, color, lore, null); - } - - public static @NonNull ItemStack create(Material material, String name, List lore, Enchantment enchantment1, Integer level1) { - Map enchantments = new HashMap<>(); - enchantments.put(enchantment1, level1); - return createItem(material, name, 1, lore, enchantments); - } - - public static @NonNull ItemStack create(Material material, String name, List lore, Enchantment enchantment, Integer level1, Enchantment enchantment2, Integer level2) { - Map enchantments = new HashMap<>(); - enchantments.put(enchantment, level1); - enchantments.put(enchantment2, level2); - return createItem(material, name, 1, lore, enchantments); - } - - public static @NonNull ItemStack create(Material material, String name, List lore, Enchantment enchantment, Integer level1, Enchantment enchantment2, Integer level2, Enchantment enchantment3, Integer level3) { - Map enchantments = new HashMap<>(); - enchantments.put(enchantment, level1); - enchantments.put(enchantment2, level2); - enchantments.put(enchantment3, level3); - return createItem(material, name, 1, lore, enchantments); - } - - public static @NonNull ItemStack createLeatherArmor(Material material, Color color) { - LeatherArmorMeta itemMeta = (LeatherArmorMeta) new ItemStack(material).getItemMeta(); - itemMeta.setColor(color); - itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - ItemStack item = new ItemStack(material); - item.setItemMeta(itemMeta); - return item; - } - - public static @NonNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore, Enchantment enchantment, Integer level1) { - Map enchantments = new HashMap<>(); - enchantments.put(enchantment, level1); - return createLeatherArmorItem(material, name, color, lore, enchantments); - } - - public static @NonNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore, Enchantment enchantment, Integer level1, Enchantment enchantment2, Integer level2) { - Map enchantments = new HashMap<>(); - enchantments.put(enchantment, level1); - enchantments.put(enchantment2, level2); - return createLeatherArmorItem(material, name, color, lore, enchantments); - } - - public static @NonNull ItemStack createLeatherArmor(Material material, String name, Color color, List lore, Enchantment enchantment, Integer level1, Enchantment enchantment2, Integer level2, Enchantment enchantment3, Integer level3) { - Map enchantments = new HashMap<>(); - enchantments.put(enchantment, level1); - enchantments.put(enchantment2, level2); - enchantments.put(enchantment3, level3); - return createLeatherArmorItem(material, name, color, lore, enchantments); - } - - // ============================== - // SECTION: Skull Creation Methods - // ============================== - - public static @NonNull ItemStack createPlayerHead(String name, String owner) { - ItemStack item = new ItemStack(Material.PLAYER_HEAD); - SkullMeta itemMeta = (SkullMeta) item.getItemMeta(); - itemMeta.setDisplayName(name); - itemMeta.setOwningPlayer(Bukkit.getOfflinePlayer(owner)); - itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemMeta); - return item; - } - - public static @NonNull ItemStack createPlayerHead(String name, String owner, List lore) { - ItemStack item = new ItemStack(Material.PLAYER_HEAD); - SkullMeta itemMeta = (SkullMeta) item.getItemMeta(); - itemMeta.setDisplayName(name); - itemMeta.setOwningPlayer(Bukkit.getOfflinePlayer(owner)); - itemMeta.setLore(lore); - itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemMeta); - return item; - } - - public static @NonNull ItemStack createPlayerHead(String name, String owner, int amount, List lore) { - var item = createPlayerHead(name, owner, lore); - return edit(item, amount); - } - - // ============================== - // SECTION: Item Editing Methods - // ============================== - - @Contract("_, _ -> param1") - public static @NotNull ItemStack edit(@NotNull ItemStack item, Material material) { - item.setType(material); - return item; - } - - @Contract("_, _ -> param1") - public static @NotNull ItemStack edit(@NotNull ItemStack item, int amount) { - item.setAmount(amount); - return item; - } - - @Contract("_, _ -> param1") - public static @NotNull ItemStack edit(@NotNull ItemStack item, String name) { - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; - } - - @Contract("_, _, _ -> param1") - public static @NotNull ItemStack edit(@NotNull ItemStack item, int amount, String name) { - item.setAmount(amount); - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; - } - - @Contract("_, _ -> param1") - public static @NotNull ItemStack edit(@NotNull ItemStack item, List lore) { - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setLore(lore); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - item.setItemMeta(itemmeta); - return item; - } - - @Contract("_, _, _, _ -> param1") - public static @NotNull ItemStack edit(@NotNull ItemStack item, int amount, String name, List lore) { - item.setAmount(amount); - ItemMeta itemmeta = item.getItemMeta(); - itemmeta.setDisplayName(name); - itemmeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - itemmeta.setLore(lore); - item.setItemMeta(itemmeta); - return item; - } - - // ====================================== - // SECTION: Material Conversion Utilities - // ====================================== - - public static @Nullable ItemStack fromUniqueMaterialString(String materialString) { - Material material = Material.matchMaterial(materialString); - if(material != null) - return XMaterial.matchXMaterial(material).parseItem(); - - - if(XMaterial.matchXMaterial(materialString).isPresent()) - return XMaterial.matchXMaterial(materialString).get().parseItem(); - - return null; - } - - public static @NonNull String getUniqueMaterialString(@NonNull ItemStack item) { - return item.getType().name(); - } - - - public static String getUniqueMaterialString(XMaterial material) { - if (material == null) - return null; - - ItemStack item = material.parseItem(); - if (item == null) - return null; - - return getUniqueMaterialString(item); - } - - public static String getUniqueMaterialString(XMaterial[] materials) { - if (materials == null || materials.length == 0) - return null; - - StringBuilder s = new StringBuilder(getUniqueMaterialString(materials[0])); - - for (int i = 1; i < materials.length; i++) - s.append(",").append(getUniqueMaterialString(materials[i])); - - return s.toString(); - } - - public static @org.jspecify.annotations.Nullable XMaterial convertStringToXMaterial(String materialString) { - XMaterial material; - - if (XMaterial.matchXMaterial(materialString).isPresent()) - material = XMaterial.matchXMaterial(materialString).get(); - else { - Material mat = Material.matchMaterial(materialString); - - if (mat != null) - material = XMaterial.matchXMaterial(mat); - else - return null; - } - - return material; - } - - public static BlockType convertXMaterialToWEBlockType(XMaterial material) { - String mat = getUniqueMaterialString(material); - BlockType bt; - - if (mat.contains("minecraft:")) - bt = BlockTypes.parse(mat); - else - bt = BlockTypes.get(mat); - - return bt; - } - - public static @NonNull String createStringFromItemStringList(@NonNull List items) throws IllegalArgumentException { - StringBuilder s = new StringBuilder(); - - for (int i = 0; i < items.size(); i++) - if (XMaterial.matchXMaterial(items.get(i)).isPresent()) { - var curItem = items.get(i); - var material = XMaterial.matchXMaterial(curItem); - XMaterial xMaterial = material.get(); - ItemStack item = xMaterial.parseItem(); - - if (item == null) - continue; - - if (i > 0) s.append(","); - s.append(getUniqueMaterialString(item)); - } - return s.toString(); - } - - public static @NonNull String createStringFromItemStringList(String... items) throws IllegalArgumentException { - return createStringFromItemStringList(new ArrayList<>(Arrays.asList(items))); - } - - public static ItemStack createCustomHeadTextureURL(String url, String name, List lore) { - byte[] encodedByteData = Base64.getEncoder().encode(String.format("{textures:{SKIN:{url:\"%s\"}}}", url).getBytes()); - String encodedData = new String(encodedByteData); - - return createCustomHeadBase64(encodedData, name, lore); - } - - public static @Nullable ItemStack createCustomHeadBase64(String base64, String name, List lore) { - if (nonPlayerSkulls.containsKey(base64 + name + lore)) - return nonPlayerSkulls.get(base64 + name + lore); - - ItemStack head = XMaterial.PLAYER_HEAD.parseItem(); - - if(head == null) - return null; - - ItemMeta meta = XSkull.of(head).profile(Profileable.detect(base64)).apply().getItemMeta(); - meta.setDisplayName(name); - meta.setLore(lore); - head.setItemMeta(meta); - - nonPlayerSkulls.put(base64 + name + lore, head); - - return head; - } -} diff --git a/src/main/java/net/buildtheearth/utils/MenuItems.java b/src/main/java/net/buildtheearth/utils/MenuItems.java index f4e1cc29..8ab36efd 100644 --- a/src/main/java/net/buildtheearth/utils/MenuItems.java +++ b/src/main/java/net/buildtheearth/utils/MenuItems.java @@ -1,5 +1,6 @@ package net.buildtheearth.utils; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/utils/menus/AbstractMenu.java b/src/main/java/net/buildtheearth/utils/menus/AbstractMenu.java index 1b588b8f..8b26a7bf 100644 --- a/src/main/java/net/buildtheearth/utils/menus/AbstractMenu.java +++ b/src/main/java/net/buildtheearth/utils/menus/AbstractMenu.java @@ -1,10 +1,9 @@ package net.buildtheearth.utils.menus; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.ChatHelper; import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.Item; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import org.bukkit.Bukkit; diff --git a/src/main/java/net/buildtheearth/utils/menus/BlockListMenu.java b/src/main/java/net/buildtheearth/utils/menus/BlockListMenu.java index a59b0a20..1f07498c 100644 --- a/src/main/java/net/buildtheearth/utils/menus/BlockListMenu.java +++ b/src/main/java/net/buildtheearth/utils/menus/BlockListMenu.java @@ -1,7 +1,7 @@ package net.buildtheearth.utils.menus; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/utils/menus/BookMenu.java b/src/main/java/net/buildtheearth/utils/menus/BookMenu.java index f04828a3..4595c2eb 100644 --- a/src/main/java/net/buildtheearth/utils/menus/BookMenu.java +++ b/src/main/java/net/buildtheearth/utils/menus/BookMenu.java @@ -1,11 +1,10 @@ package net.buildtheearth.utils.menus; +import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import org.bukkit.Bukkit; -import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/utils/menus/NameListMenu.java b/src/main/java/net/buildtheearth/utils/menus/NameListMenu.java index e63308df..3a1f61c6 100644 --- a/src/main/java/net/buildtheearth/utils/menus/NameListMenu.java +++ b/src/main/java/net/buildtheearth/utils/menus/NameListMenu.java @@ -1,7 +1,7 @@ package net.buildtheearth.utils.menus; +import com.alpsbte.alpslib.utils.item.Item; import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.Item; import net.buildtheearth.utils.MenuItems; import net.daporkchop.lib.common.misc.Tuple; import org.bukkit.enchantments.Enchantment; From 9873d3eec9971a41449a338e82a589b2a51f9236 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 12 Jan 2026 17:33:45 +0100 Subject: [PATCH 20/37] =?UTF-8?q?fix(nav):=20=E2=9C=A8=20fix=20others/defa?= =?UTF-8?q?ult=20warp=20group?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/navigation/NavUtils.java | 4 +- .../components/warps/WarpsComponent.java | 2 +- .../modules/network/api/NetworkAPI.java | 58 +++++++++---------- 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java b/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java index a22be73b..fd1b2f25 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java +++ b/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java @@ -113,8 +113,8 @@ public static void switchToTeam(BuildTeam team, Player clickPlayer) { } } - public static @NotNull WarpGroup createOtherWarpGroup() { + public static @NotNull WarpGroup createOtherWarpGroup(BuildTeam team) { // Create an "other" Warp Group for warps that don't belong to a warp group - return new WarpGroup(NetworkModule.getInstance().getBuildTeam(), "Other", "Other warps", -1, null); + return new WarpGroup(team, "Other", "Other warps", -1, null); } } diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java b/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java index 6e4e1482..b7224a9f 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java @@ -142,7 +142,7 @@ public WarpGroup getOtherWarpGroup() { public void createWarp(Player creator) { WarpGroup group = getOtherWarpGroup(); if (group == null) { - group = NavUtils.createOtherWarpGroup(); + group = NavUtils.createOtherWarpGroup(NetworkModule.getInstance().getBuildTeam()); } createWarp(creator, group); } diff --git a/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java b/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java index d15061d8..14e37dcf 100644 --- a/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java +++ b/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java @@ -29,6 +29,7 @@ public class NetworkAPI { /** * Notifies the network API about the presence of the plugin + * * @param installed if the plugin is installed */ public static void setBuildTeamToolsInstalled(boolean installed) { @@ -105,7 +106,7 @@ public void onResponse(String response) { isConnected, hasBuildTeamToolsInstalled, allowsTransfers, tag); NetworkModule.getInstance().getBuildTeams().add(buildTeam); - WarpGroup otherWarpGroup = NavUtils.createOtherWarpGroup(); + WarpGroup otherWarpGroup = NavUtils.createOtherWarpGroup(buildTeam); // Add all the warp groups of the team to their respective build teams for (Object warpGroupJSON : warpGroups.toArray()) { @@ -122,8 +123,6 @@ public void onResponse(String response) { buildTeam.getWarpGroups().add(warpGroup); } - if (!otherWarpGroup.getWarps().isEmpty()) buildTeam.getWarpGroups().add(otherWarpGroup); - // Add all the warps of the team to their respective warp groups for (Object warpJSON : warps.toArray()) { if (!(warpJSON instanceof JSONObject warpObject)) continue; @@ -162,23 +161,21 @@ public void onResponse(String response) { Warp warp = new Warp(warpID, warpGroup, warpName, countryCode, "cca3", address, addressType, material, warpWorldName, warpLat, warpLon, warpHeight, warpYaw, warpPitch, isHighlight); // If the warp belongs to a warp group, add it to that, otherwise add it to the "other" warp group. - if (warpGroupID == null) { + boolean added = false; + + for (WarpGroup wg : buildTeam.getWarpGroups()) + if (wg.getId().equals(warpGroup.getId())) { + wg.getWarps().add(warp); + added = true; + break; + } + + if (!added) otherWarpGroup.getWarps().add(warp); - } else { - boolean added = false; - - for (WarpGroup wg : buildTeam.getWarpGroups()) - if (wg.getId().equals(warpGroupID)) { - wg.getWarps().add(warp); - added = true; - break; - } - - if (!added) - otherWarpGroup.getWarps().add(warp); - } } + if (!otherWarpGroup.getWarps().isEmpty()) buildTeam.getWarpGroups().add(otherWarpGroup); + // Add all the regions of the team to their respective continents for (Object regionJSON : regions.toArray()) { if (!(regionJSON instanceof JSONObject regionObject)) continue; @@ -205,7 +202,7 @@ public void onResponse(String response) { NetworkModule.getInstance().getRegions().add(region); } } - }catch (Exception e) { + } catch (Exception e) { future.completeExceptionally(e); return; } @@ -214,25 +211,24 @@ public void onResponse(String response) { } - private String getMainServerName(JSONObject teamObject) { String mainServerIP = (String) teamObject.get("MainServerIP"); Object serversObject = teamObject.get("Servers"); if (!(serversObject instanceof JSONArray serversArray)) return null; - for(Object object : serversArray.toArray()) { + for (Object object : serversArray.toArray()) { if (!(object instanceof JSONObject serverObject)) return null; String serverIP = (String) serverObject.get("IP"); - if(serverIP.equals(mainServerIP)) return (String) serverObject.get("Name"); + if (serverIP.equals(mainServerIP)) return (String) serverObject.get("Name"); } return null; } private int getArea(JSONObject regionObject) { - if(regionObject == null) return 0; - if(regionObject.get("area") == null) return 0; + if (regionObject == null) return 0; + if (regionObject.get("area") == null) return 0; if (regionObject.get("area") instanceof Long area) return Math.toIntExact(area); @@ -289,28 +285,28 @@ public static void createWarp(Warp warp, API.ApiResponseCallback callback) { String apiKey = BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.API_KEY); RequestBody requestBody = RequestBody.create(warp.toJSON().toString(), MediaType.parse("application/json")); - API.postAsync("https://nwapi.buildtheearth.net/api/teams/"+apiKey+"/warps", requestBody, callback); + API.postAsync("https://nwapi.buildtheearth.net/api/teams/" + apiKey + "/warps", requestBody, callback); } public static void createWarpGroup(WarpGroup warpGroup, API.ApiResponseCallback callback) { String apiKey = BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.API_KEY); RequestBody requestBody = RequestBody.create(warpGroup.toJSON().toString(), MediaType.parse("application/json")); - API.postAsync("https://nwapi.buildtheearth.net/api/teams/"+apiKey+"/warpgroups", requestBody, callback); + API.postAsync("https://nwapi.buildtheearth.net/api/teams/" + apiKey + "/warpgroups", requestBody, callback); } public static void updateWarp(Warp warp, API.ApiResponseCallback callback) { String apiKey = BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.API_KEY); RequestBody requestBody = RequestBody.create(warp.toJSON().toString(), MediaType.parse("application/json")); - API.putAsync("https://nwapi.buildtheearth.net/api/teams/"+apiKey+"/warps", requestBody, callback); + API.putAsync("https://nwapi.buildtheearth.net/api/teams/" + apiKey + "/warps", requestBody, callback); } public static void updateWarpGroup(WarpGroup warpGroup, API.ApiResponseCallback callback) { String apiKey = BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.API_KEY); RequestBody requestBody = RequestBody.create(warpGroup.toJSON().toString(), MediaType.parse("application/json")); - API.putAsync("https://nwapi.buildtheearth.net/api/teams/"+apiKey+"/warpgroups", requestBody, callback); + API.putAsync("https://nwapi.buildtheearth.net/api/teams/" + apiKey + "/warpgroups", requestBody, callback); } public static void deleteWarp(Warp warp, API.ApiResponseCallback callback) { @@ -322,7 +318,7 @@ public static void deleteWarp(Warp warp, API.ApiResponseCallback callback) { RequestBody requestBody = RequestBody.create(requestBodyString, MediaType.parse("application/json")); - API.deleteAsync("https://nwapi.buildtheearth.net/api/teams/"+apiKey+"/warps", requestBody, callback); + API.deleteAsync("https://nwapi.buildtheearth.net/api/teams/" + apiKey + "/warps", requestBody, callback); } public static void deleteWarpGroup(WarpGroup warpGroup, API.ApiResponseCallback callback) { @@ -333,11 +329,11 @@ public static void deleteWarpGroup(WarpGroup warpGroup, API.ApiResponseCallback String requestBodyString = requestBodyJson.toString(); RequestBody requestBody = RequestBody.create(requestBodyString, MediaType.parse("application/json")); - API.deleteAsync("https://nwapi.buildtheearth.net/api/teams/"+apiKey+"/warpgroups", requestBody, callback); + API.deleteAsync("https://nwapi.buildtheearth.net/api/teams/" + apiKey + "/warpgroups", requestBody, callback); } public static void syncPlayerList() { - if(NetworkModule.getInstance().getBuildTeam().isConnected()) + if (NetworkModule.getInstance().getBuildTeam().isConnected()) return; String apiKey = BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.API_KEY); @@ -348,7 +344,7 @@ public static void syncPlayerList() { RequestBody requestBody = RequestBody.create(requestBodyArray.toString(), MediaType.parse("application/json")); - API.postAsync("https://nwapi.buildtheearth.net/api/teams/"+apiKey+"/playerlist", requestBody, new API.ApiResponseCallback() { + API.postAsync("https://nwapi.buildtheearth.net/api/teams/" + apiKey + "/playerlist", requestBody, new API.ApiResponseCallback() { @Override public void onResponse(String response) { ChatHelper.logDebug("Synced the player list with the network API: %s", response); From c16bcd0bfc0a71e0efb3cd58195b0a8018eb46a3 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 12 Jan 2026 18:43:26 +0100 Subject: [PATCH 21/37] =?UTF-8?q?fix(gen/kml):=20=E2=9C=A8=20fix=20coordin?= =?UTF-8?q?ate=20parsing=20and=20improve=20error=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #61! --- .../generator/components/kml/KmlCommand.java | 683 +++++++++++------- .../components/tpll/TpllComponent.java | 3 +- .../buildtheearth/utils/GeometricUtils.java | 4 +- 3 files changed, 420 insertions(+), 270 deletions(-) diff --git a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java b/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java index b452c9dd..9bb511c4 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java +++ b/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java @@ -21,64 +21,64 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.metadata.FixedMetadataValue; +import org.jspecify.annotations.NonNull; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.stream.Collectors; - - - /** Class to handle kml command and its aliases - * - * Since kml content easily exceeds the normal chat/character limit, - * we use the following workflow: - * - * if sent from a player, generates a CommandBlock and adds some metadata to it - * the player then pastes the kml contents and confirms the command - * - * the CommandBlock then sends a kml command with the contents, which is parsed by the server - * - * note: this command differentiates between aliases to determine wether to - * generate intermediate points between the geo-coordinates from the kml linestrings. - * Players should only use /geopoints or /geopath aliases, - * direct use of the /kml command is restricted to CommandBlockSender - * - */ + + +/** + * Class to handle kml command and its aliases

+ *

+ * Since kml content easily exceeds the normal chat/character limit, + * we use the following workflow:
+ * 1) If sent from a player, generates a CommandBlock and adds some metadata to it + * the player then pastes the kml contents and confirms the command
+ * 2) The CommandBlock then sends a kml command with the contents, which is parsed by the server

+ *

+ * note: this command differentiates between aliases to determine wether to + * generate intermediate points between the geo-coordinates from the kml linestrings. + * Players should only use /geopoints or /geopath aliases, + * direct use of the /kml command is restricted to CommandBlockSender + * + */ public class KmlCommand implements CommandExecutor { - - /** Command handling - * + /** + * Handles the execution of KML-related commands (/geopoints, /geopath, /georing, /kml). + *

+ * This method has two main execution paths: + *

    + *
  • If sender is a CommandBlock: directly processes the KML content
  • + *
  • If sender is a Player: creates a CommandBlock UI for pasting KML content or handles undo
  • + *
+ * + * @param sender The command sender (Player or CommandBlock) + * @param cmd The command object + * @param alias The alias used to invoke this command (geopoints/geopath/georing/kml) + * @param args Command arguments (KML content if from CommandBlock, block type if from Player) + * @return true if the command was handled successfully, false otherwise */ - public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) { - if (sender instanceof BlockCommandSender){ - Block senderBlock = ((BlockCommandSender)sender).getBlock(); + public boolean onCommand(@NonNull CommandSender sender, @NonNull Command cmd, @NonNull String alias, String @NonNull [] args) { + if (sender instanceof BlockCommandSender cmdbSender) { + Block senderBlock = cmdbSender.getBlock(); return processKml(senderBlock, args); } - if(!(sender instanceof Player)){ + if (!(sender instanceof Player p)) { sender.sendMessage("§cOnly players can execute this command."); return false; } - - Player p = (Player) sender; - if (args.length > 0 && args[0].equals("undo")){ + if (args.length > 0 && args[0].equals("undo")) { return undoCommand(p); - } - - // //TESTING location/elevation code - // Block targetedBlock = p.getTargetBlock(null, 10); - // Location targetedLocation = targetedBlock.getLocation(); - // int highY = p.getWorld().getHighestBlockYAt(targetedLocation); - // p.sendMessage(String.format("elevation test: targeted block (%s) location Y %d (%f), highestY %d", - // targetedBlock.getType().toString(), targetedLocation.getBlockY(), targetedLocation.getY(),highY)); - - + } + //check if alias is geopoints or geopath (direct /kml is only allowed for undo) - if (alias.equals("kml")){ + if (alias.equals("kml")) { sender.sendMessage("§cPlease use /geopoints or /geopath to execute this command."); return false; } @@ -86,236 +86,301 @@ public boolean onCommand(CommandSender sender, Command cmd, String alias, String return createPasteUI(p, cmd, alias, args); } - void addSingleLocation(BlockLocation loc, boolean extendToGround, World world, Set container, Set fillPositions) - { + /** + * Adds a single block location to the transaction, optionally extending down to terrain. + *

+ * If extendToGround is enabled, this will also fill all blocks vertically from the terrain + * elevation up to the specified location height. + * + * @param loc The block location to add + * @param extendToGround Whether to fill blocks down to terrain level + * @param world The world containing the blocks + * @param container The set to add the block location to + * @param fillPositions The set to add vertical fill positions to + */ + void addSingleLocation(BlockLocation loc, boolean extendToGround, World world, @NonNull Set container, Set fillPositions) { container.add(loc); - if (extendToGround) - fillVerticalToTerrain(loc, world, fillPositions); + if (extendToGround) fillVerticalToTerrain(loc, world, fillPositions); } - void addLocations(List locs, boolean extendToGround, World world, Set container, Set fillPositions) - { + /** + * Adds multiple block locations to the transaction, optionally extending each down to terrain. + *

+ * This is a convenience method that calls {@link #addSingleLocation(BlockLocation, boolean, World, Set, Set)} + * for each location in the list. + * + * @param locs List of block locations to add + * @param extendToGround Whether to fill blocks down to terrain level for each location + * @param world The world containing the blocks + * @param container The set to add the block locations to + * @param fillPositions The set to add vertical fill positions to + */ + void addLocations(@NonNull List locs, boolean extendToGround, World world, Set container, Set fillPositions) { for (BlockLocation loc : locs) addSingleLocation(loc, extendToGround, world, container, fillPositions); } - void fillVerticalToTerrain(BlockLocation locationOverGround, World world, Set container) - { + /** + * Fills all block positions vertically from terrain level up to the specified location. + *

+ * This is used when the "extend to ground" feature is enabled, creating a vertical + * column of blocks from the highest block at the XZ coordinates up to the target height. + * + * @param locationOverGround The target block location (height to extend to) + * @param world The world to query for terrain height + * @param container The set to add the vertical fill positions to + */ + void fillVerticalToTerrain(BlockLocation locationOverGround, @NonNull World world, Set container) { int terrainElevation = world.getHighestBlockYAt(locationOverGround.x, locationOverGround.z); - for (int y = terrainElevation; y < locationOverGround.y; y++){ + for (int y = terrainElevation; y < locationOverGround.y; y++) { container.add(new BlockLocation(locationOverGround.x, y, locationOverGround.z)); } } - /** - * @param senderBlock - * @param args - * @return boolean - */ - public boolean processKml(Block senderBlock, String[] args){ - long time_start = System.currentTimeMillis(); + /** + * Processes KML content from a CommandBlock and places blocks in the world. + *

+ * This method performs the following steps: + *

    + *
  1. Reads metadata from the command block (player, block type, operation mode)
  2. + *
  3. Parses the KML content to extract geographic coordinates
  4. + *
  5. Converts geographic coordinates to Minecraft coordinates (async)
  6. + *
  7. Rasterizes lines/points based on the operation mode
  8. + *
  9. Filters blocks by distance and chunk loading
  10. + *
  11. Commits block changes to the world (sync)
  12. + *
  13. Cleans up the command block
  14. + *
+ *

+ * The coordinate conversion and processing is done asynchronously to avoid blocking + * the server thread, then syncs back to the main thread for actual block changes. + *

+ * Blocks are only placed if: + *

    + *
  • The chunk is loaded
  • + *
  • The block is within 1000 blocks of the player
  • + *
+ * + * @param senderBlock The CommandBlock that sent this command (contains metadata) + * @param args The KML content as a string array + * @return true if processing started successfully, false if validation failed + */ + public boolean processKml(@NonNull Block senderBlock, String[] args) { //read metadata to get player name/ID BlockState blockState = senderBlock.getState(); - String playerName = blockState.getMetadata("kmlPlayerName").get(0).asString(); - String blocktypeString = blockState.getMetadata("kmlBlocktype").get(0).asString(); - String previousCommandBlockType = blockState.getMetadata("kmlPreviousBlocktype").get(0).asString(); - String blockCreationCommand = blockState.getMetadata("kmlBlockCreationCommand").get(0).asString(); + String playerName = blockState.getMetadata("kmlPlayerName").getFirst().asString(); + String blocktypeString = blockState.getMetadata("kmlBlocktype").getFirst().asString(); + String previousCommandBlockType = blockState.getMetadata("kmlPreviousBlocktype").getFirst().asString(); + String blockCreationCommand = blockState.getMetadata("kmlBlockCreationCommand").getFirst().asString(); BlockCreationMode operationMode = commandToCreationMode(blockCreationCommand); - boolean extendToGround = blockState.getMetadata("kmlExtendToGround").get(0).asBoolean(); - String extendToGroundBlockType = blockState.getMetadata("kmlExtendToGroundBlocktype").get(0).asString(); - + boolean extendToGround = blockState.getMetadata("kmlExtendToGround").getFirst().asBoolean(); + String extendToGroundBlockType = blockState.getMetadata("kmlExtendToGroundBlocktype").getFirst().asString(); + - if (playerName == "" || blocktypeString == ""){ + if (playerName.isEmpty() || blocktypeString.isEmpty()) { //invalid metadata, cancel //send error message to all players within 50m of the command block - ChatHelper.sendMessageToPlayersNearLocation( - senderBlock.getLocation(), - "§cReceived /kml command from CommandBlock without sufficient metadata.\nThis command can only be executed from a CommandBlock created with the /kml command!", - 50); + ChatHelper.sendMessageToPlayersNearLocation(senderBlock.getLocation(), "§cReceived /kml command from CommandBlock without sufficient metadata.\nThis command can only be executed from a CommandBlock created with the /kml command!", 50); return false; } Player player = Bukkit.getServer().getPlayer(playerName); - - if (player == null){ + + if (player == null) { return false; } String kml_content = String.join(" ", args); - // player.sendMessage(String.format("§creceived /kml command with blocktypestring %s and and kml length %d: %s", - // blocktypeString, kml_content.length(), kml_content)); - Material blockMaterial = Material.matchMaterial(blocktypeString); - if (blockMaterial == null){ + Material matchedBlockMaterial = Material.matchMaterial(blocktypeString); + final Material blockMaterial = (matchedBlockMaterial != null && matchedBlockMaterial.isBlock()) ? matchedBlockMaterial : Material.BRICKS; + if (matchedBlockMaterial == null || !matchedBlockMaterial.isBlock()) { player.sendMessage("§cServer received /kml command with invalid blocktype string metadata. Using bricks as fallback."); - blockMaterial = Material.BRICK; } - Material extendMaterial = Material.matchMaterial(extendToGroundBlockType); - if (extendMaterial == null){ + + Material matchedExtendMaterial = Material.matchMaterial(extendToGroundBlockType); + final Material extendMaterial = (matchedExtendMaterial != null && matchedExtendMaterial.isBlock()) ? matchedExtendMaterial : Material.BRICKS; + if (matchedExtendMaterial == null || !matchedExtendMaterial.isBlock()) { player.sendMessage("§cServer received /kml command with invalid blocktype string metadata. Using bricks as fallback."); - extendMaterial = Material.BRICK; } - //parse kml long time_beforeKMLParse = System.currentTimeMillis(); - - KmlParser parser = new KmlParser(player); // we pass the player here to be able to report parsing errors List> geoCoords = parser.extractCoordinates(kml_content); long time_afterKMLParse = System.currentTimeMillis(); - World world = senderBlock.getWorld(); - List> mcLocations = convertToMC(geoCoords, world); - long time_afterProjection = System.currentTimeMillis(); - - - //set up a transaction (collection of block changes) - ChangeTransaction transaction = new ChangeTransaction(player); - - //collect all blocklocations in a set - //if just iterate and create blocks one by one, we create multiple blocks at the same XZ coordinates, - // this also stacks them vertically because we check terrain altitude. - Set blockPositions = new HashSet<>(); - Set fillPositions = new HashSet<>(); - - - - for (List polyline : mcLocations) - { - if (operationMode == BlockCreationMode.FILLED) - blockPositions = triangulateAndFill(polyline); - else{ - //rasterize line and create intermediate blocks - //note: iteration starts at second block, so we always have a previous block to draw the line - //for single point mode, we explicitly add the first block - if (operationMode == BlockCreationMode.POINTS) - { - BlockLocation loc = new BlockLocation(polyline.get(0)); - addSingleLocation(loc, extendToGround, world, blockPositions, fillPositions); - } + // Run the coordinate conversion asynchronously to avoid blocking the server thread + Bukkit.getScheduler().runTaskAsynchronously(BuildTeamTools.getInstance(), () -> { + List> mcLocations = convertToMC(geoCoords, world); + long time_afterProjection = System.currentTimeMillis(); - for (int i = 1; i < polyline.size(); ++i) - { - if (operationMode == BlockCreationMode.POINTS) - { - BlockLocation loc = new BlockLocation(polyline.get(i)); + + //set up a transaction (collection of block changes) + ChangeTransaction transaction = new ChangeTransaction(player); + + //collect all blocklocations in a set + //if just iterate and create blocks one by one, we create multiple blocks at the same XZ coordinates, + // this also stacks them vertically because we check terrain altitude. + Set blockPositions = new HashSet<>(); + Set fillPositions = new HashSet<>(); + + + for (List polyline : mcLocations) { + if (operationMode == BlockCreationMode.FILLED) blockPositions = triangulateAndFill(polyline); + else { + //rasterize line and create intermediate blocks + //note: iteration starts at second block, so we always have a previous block to draw the line + //for single point mode, we explicitly add the first block + if (operationMode == BlockCreationMode.POINTS) { + BlockLocation loc = new BlockLocation(polyline.getFirst()); addSingleLocation(loc, extendToGround, world, blockPositions, fillPositions); } - else //interpolate - { - addLocations(LineRasterization.rasterizeLine(polyline.get(i-1), polyline.get(i)), - extendToGround, world, blockPositions, fillPositions); + + // For PATH/CLOSED_PATH modes, start from the first point + int startIndex = (operationMode == BlockCreationMode.POINTS) ? 1 : 0; + + for (int i = startIndex + 1; i < polyline.size(); ++i) { + if (operationMode == BlockCreationMode.POINTS) { + BlockLocation loc = new BlockLocation(polyline.get(i)); + addSingleLocation(loc, extendToGround, world, blockPositions, fillPositions); + } else //interpolate + { + addLocations(LineRasterization.rasterizeLine(polyline.get(i - 1), polyline.get(i)), extendToGround, world, blockPositions, fillPositions); + } + } + + //for closed-path-mode, add extra line between start and end + if (operationMode == BlockCreationMode.CLOSED_PATH) { + addLocations(LineRasterization.rasterizeLine(polyline.getFirst(), polyline.getLast()), extendToGround, world, blockPositions, fillPositions); } } + } + + //now create the blocks + // restrictions: only if block is loaded, and only within 1000 blocks of the current player location + final boolean[] preventedUnloadedChunkChanges = {false}; + final boolean[] preventedFarChanges = {false}; + + float maxDistanceToPlayer = 1000; //TODO server config - //for closed-path-mode, add extra line between start and end - if (operationMode == BlockCreationMode.CLOSED_PATH) - { - addLocations(LineRasterization.rasterizeLine(polyline.get(0), polyline.get(polyline.size()-1)) - , extendToGround, world, blockPositions, fillPositions); + for (BlockLocation pt : blockPositions) { + Location loc = pt.getLocation(world); + if (!loc.getChunk().isLoaded()) preventedUnloadedChunkChanges[0] = true; + else if (loc.distance(player.getLocation()) > maxDistanceToPlayer) preventedFarChanges[0] = true; + else { + transaction.addBlockChange(pt, world, blockMaterial); } } - - } - //now create the blocks - // restrictions: only if block is loaded, and only within 1000 blocks of the current player location - boolean preventedUnloadedChunkChanges = false; - boolean preventedFarChanges = false; - - float maxDistanceToPlayer = 1000; //TODO server config - - for (BlockLocation pt : blockPositions) - { - Location loc = pt.getLocation(world); - if (!loc.getChunk().isLoaded()) - preventedUnloadedChunkChanges = true; - else if (loc.distance(player.getLocation()) > maxDistanceToPlayer) - preventedFarChanges = true; - else - { - transaction.addBlockChange(pt, world, blockMaterial); + for (BlockLocation pt : fillPositions) { + Location loc = pt.getLocation(world); + if (!loc.getChunk().isLoaded()) preventedUnloadedChunkChanges[0] = true; + else if (loc.distance(player.getLocation()) > maxDistanceToPlayer) preventedFarChanges[0] = true; + else { + transaction.addBlockChange(pt, world, extendMaterial); + } } - } - for (BlockLocation pt : fillPositions) - { - Location loc = pt.getLocation(world); - if (!loc.getChunk().isLoaded()) - preventedUnloadedChunkChanges = true; - else if (loc.distance(player.getLocation()) > maxDistanceToPlayer) - preventedFarChanges = true; - else - { - transaction.addBlockChange(pt, world, extendMaterial); + + if (transaction.size() == 0) { + StringBuilder debugMessage = new StringBuilder("§ckml command did not contain any allowed block changes. "); + debugMessage.append("Total positions calculated: ").append(blockPositions.size() + fillPositions.size()).append(". "); + debugMessage.append("Player at: X=").append(player.getLocation().getBlockX()); + debugMessage.append(" Y=").append(player.getLocation().getBlockY()); + debugMessage.append(" Z=").append(player.getLocation().getBlockZ()).append(". "); + + // Show first calculated block location for debugging + if (!blockPositions.isEmpty()) { + BlockLocation firstBlock = blockPositions.iterator().next(); + debugMessage.append("First block would be at: X=").append(firstBlock.x); + debugMessage.append(" Y=").append(firstBlock.y); + debugMessage.append(" Z=").append(firstBlock.z).append(". "); + } + + if (preventedUnloadedChunkChanges[0]) { + debugMessage.append("Some blocks are in unloaded chunks. "); + } + if (preventedFarChanges[0]) { + debugMessage.append("Some blocks are >1000 blocks from your location (max distance 1000). "); + } + if (!preventedUnloadedChunkChanges[0] && !preventedFarChanges[0]) { + debugMessage.append("No positions were calculated from the KML. Check your coordinates and alias (/geopoints, /geopath, /georing)."); + } + player.sendMessage(debugMessage.toString()); + return; } - } + // Sync back to main thread for block changes and player history management + Bukkit.getScheduler().runTask(BuildTeamTools.getInstance(), () -> { + //create commandHistory if not exits + if (KmlCommand.this.playerHistories == null) KmlCommand.this.playerHistories = new HashMap<>(); - if (transaction.size() == 0){ - player.sendMessage("§ckml command did not contain any allowed block changes.\nThis command can only change blocks near your current location, and cannot load new chunks."); - return false; - } + if (!KmlCommand.this.playerHistories.containsKey(player)) + KmlCommand.this.playerHistories.put(player, new Stack<>()); - //create commandHistory if not exits - if (this.playerHistories == null) - this.playerHistories = new HashMap<>(); + Stack playerHistory = KmlCommand.this.playerHistories.get(player); - if (! playerHistories.containsKey(player)) - playerHistories.put(player, new Stack<>()); + playerHistory.push(transaction); - Stack playerHistory = playerHistories.get(player); - playerHistory.push(transaction); + long time_beforeBlockChange = System.currentTimeMillis(); - long time_beforeBlockChange = System.currentTimeMillis(); + player.sendMessage(String.format("KML parsing: %d ms. BTE Projection: %d ms, Transaction preparation: %d ms. Changing %d blocks, please stand by.", (time_afterKMLParse - time_beforeKMLParse), (time_afterProjection - time_afterKMLParse), (time_beforeBlockChange - time_afterProjection), transaction.size())); + int blocksChanged = transaction.commit(); - player.sendMessage(String.format("KML parsing: %d ms. BTE Projection: %d ms, Transaction preparation: %d ms. Changing %d blocks, please stand by." - , (time_afterKMLParse-time_beforeKMLParse) - , (time_afterProjection - time_afterKMLParse ) - , (time_beforeBlockChange - time_afterProjection), transaction.size())); - - int blocksChanged = transaction.commit(); + long time_afterBlockChanged = System.currentTimeMillis(); + player.sendMessage(String.format("KML command changed %d blocks (%d ms).", blocksChanged, (time_afterBlockChanged - time_beforeBlockChange))); - long time_afterBlockChanged = System.currentTimeMillis(); - player.sendMessage(String.format("KML command changed %d blocks (%d ms).", blocksChanged, (time_afterBlockChanged - time_beforeBlockChange))); - - if (preventedUnloadedChunkChanges){ - player.sendMessage("§cSome block changes target unloaded chunks and were not applied."); - } - if (preventedFarChanges){ - player.sendMessage("§cSome block changes target blocks too far away from the player and were not applied."); - } + if (preventedUnloadedChunkChanges[0]) { + player.sendMessage("§cSome block changes target unloaded chunks and were not applied."); + } + if (preventedFarChanges[0]) { + player.sendMessage("§cSome block changes target blocks too far away from the player and were not applied."); + } - Material material = Material.matchMaterial(previousCommandBlockType); + Material material = Material.matchMaterial(previousCommandBlockType); - if (material == null){ - player.sendMessage("§cServer received /kml command with invalid blocktype string metadata. Using bricks as fallback."); - material = Material.BRICK; - } + if (material == null) { + player.sendMessage("§cServer received /kml command with invalid blocktype string metadata. Using bricks as fallback."); + material = Material.BRICKS; + } - //Delete command block, restore previous type - senderBlock.setType(material); + //Delete command block, restore previous type + senderBlock.setType(material); + }); + }); return true; } - private Set triangulateAndFill(List polyline) { - Setresult = new HashSet<>(); + /** + * Triangulates a polygon defined by a polyline and fills it with blocks. + *

+ * This method: + *

    + *
  1. Triangulates the polygon into triangles using {@link PolygonTools#triangulatePolygon(List)}
  2. + *
  3. Rasterizes each triangle to fill it with blocks
  4. + *
  5. Also adds triangle borders for debugging purposes
  6. + *
+ * + * @param polyline The list of locations defining the polygon boundary + * @return A set of all block locations that should be filled + */ + private @NonNull Set triangulateAndFill(List polyline) { + Set result = new HashSet<>(); //triangulate the polygon List triangles = PolygonTools.triangulatePolygon(polyline); //fill with bresenham. for now, just all border-lines - for (PolygonTools.Triangle tri : triangles){ + for (PolygonTools.Triangle tri : triangles) { result.addAll(PolygonTools.rasterizeTriangle(tri)); - + //dEBUG: ALL triangle borders result.addAll(LineRasterization.rasterizeLine(tri.getVertex1(), tri.getVertex2())); result.addAll(LineRasterization.rasterizeLine(tri.getVertex1(), tri.getVertex3())); @@ -325,39 +390,65 @@ private Set triangulateAndFill(List polyline) { } - - public boolean createPasteUI(Player player, Command cmd, String alias, String[] args){ + /** + * Creates a CommandBlock UI for pasting KML content. + *

+ * This method: + *

    + *
  1. Parses command arguments for block type and extend options
  2. + *
  3. Spawns a CommandBlock 2 blocks in front of the player
  4. + *
  5. Stores metadata on the CommandBlock (player, block types, operation mode)
  6. + *
  7. Configures the CommandBlock to execute /kml when triggered
  8. + *
+ *

+ * Arguments: + *

    + *
  • Optional block type (e.g., "STONE", "GLASS") - defaults to "BRICKS"
  • + *
  • Optional -extend:BLOCKTYPE to fill vertically down to terrain
  • + *
+ *

+ * After creation, the player should: + *

    + *
  1. Right-click the CommandBlock
  2. + *
  3. Paste the KML content after "/kml "
  4. + *
  5. Set the CommandBlock to "Always Active"
  6. + *
  7. Confirm to execute
  8. + *
+ * + * @param player The player creating the CommandBlock UI + * @param cmd The command object (unused) + * @param alias The command alias used (determines operation mode) + * @param args Command arguments (block type and extend options) + * @return true if the CommandBlock was created successfully + */ + public boolean createPasteUI(Player player, Command cmd, String alias, String @NonNull [] args) { //The command either creates a command-block at the player location //arguments are an // optional blocktype // optional -toGround:blockType - String blocktype = "BRICK"; + String blocktype = "BRICKS"; boolean extendToGround = false; String extendToGroundBlockType = "GREEN_WOOL"; String prefix_extendParam = "-extend:"; - for (String arg : args) - { - if (arg.startsWith(prefix_extendParam)){ + for (String arg : args) { + if (arg.startsWith(prefix_extendParam)) { extendToGround = true; extendToGroundBlockType = arg.substring(prefix_extendParam.length()).toUpperCase(); if (Material.matchMaterial(extendToGroundBlockType) == null) { player.sendMessage(String.format("§cInvalid block type for extend parameter '%s'. Using bricks as fallback.", extendToGroundBlockType)); - extendToGroundBlockType = "BRICK"; + extendToGroundBlockType = "BRICKS"; } - }else{ + } else { blocktype = arg.toUpperCase(); if (Material.matchMaterial(blocktype) == null) { player.sendMessage(String.format("§cInvalid block type '%s'. Using bricks as fallback.", blocktype)); - blocktype = "BRICK"; + blocktype = "BRICKS"; } } - - } - //spawn a command block in front of the player Location commandBlockLocation = player.getLocation().add(player.getLocation().getDirection().multiply(2)); commandBlockLocation = commandBlockLocation.add(0, 2, 0); @@ -367,38 +458,49 @@ public boolean createPasteUI(Player player, Command cmd, String alias, String[] Material previousMaterial = block.getType(); //remember old blocktype to replace after command processing - if(XMaterial.COMMAND_BLOCK.parseMaterial() != null) - block.setType(XMaterial.COMMAND_BLOCK.parseMaterial()); - + if (XMaterial.COMMAND_BLOCK.get() != null) block.setType(XMaterial.COMMAND_BLOCK.get()); + //for now, user has to manually set the command to "auto" to get it immediately triggered on confirm CommandBlock cmdBlock = (CommandBlock) block.getState(); - + cmdBlock.setCommand("/kml "); //ready to paste kml content cmdBlock.setMetadata("kmlPlayerName", new FixedMetadataValue(BuildTeamTools.getInstance(), player.getName())); //cmdBlock.setMetadata("kmlPlayerID", new FixedMetadataValue(BuildTeamTools.getInstance(), p.getUniqueId())); cmdBlock.setMetadata("kmlBlocktype", new FixedMetadataValue(BuildTeamTools.getInstance(), blocktype)); cmdBlock.setMetadata("kmlExtendToGround", new FixedMetadataValue(BuildTeamTools.getInstance(), extendToGround)); cmdBlock.setMetadata("kmlExtendToGroundBlocktype", new FixedMetadataValue(BuildTeamTools.getInstance(), extendToGroundBlockType)); - + cmdBlock.setMetadata("kmlPreviousBlocktype", new FixedMetadataValue(BuildTeamTools.getInstance(), previousMaterial.toString())); - + cmdBlock.setMetadata("kmlBlockCreationCommand", new FixedMetadataValue(BuildTeamTools.getInstance(), alias)); - + cmdBlock.update(); player.sendMessage("§6Command block created. Right click the block, paste the KML content, set it to 'always on' and confirm"); return true; - + } - public boolean undoCommand(Player player){ - if (playerHistories==null){ + /** + * Undoes the last KML command executed by the player. + *

+ * This method retrieves the most recent {@link ChangeTransaction} from the player's + * history and reverses all block changes made by that transaction. + *

+ * The undo history is maintained per-player in a stack, so multiple undos can be + * performed in sequence to revert multiple KML commands. + * + * @param player The player requesting the undo + * @return true if undo was successful, false if no history exists + */ + public boolean undoCommand(Player player) { + if (playerHistories == null) { player.sendMessage("kml undo failed - no command history available."); return false; } Stack playerHistory = playerHistories.get(player); - - if (playerHistory == null || playerHistory.empty()){ + + if (playerHistory == null || playerHistory.empty()) { player.sendMessage("kml undo failed - there is no previously executed kml command."); return false; } @@ -409,82 +511,129 @@ public boolean undoCommand(Player player){ return true; } - public static void sendHelp(CommandSender sender){ - //ChatUtil.sendMessageBox(sender, "GML Command", () -> { - // sender.sendMessage("§eHouse Generator:§7 /gml help"); - //}); - } - - private Location getLocationFromCoordinates(double[] coordinates, double altitudeFromKML) - { + /** + * Converts geographic coordinates (latitude/longitude) to a Minecraft Location. + *

+ * This method: + *

    + *
  1. Converts lat/lon to Minecraft X/Z using {@link GeometricUtils#getLocationFromCoordinates(double[])}
  2. + *
  3. Applies the KML altitude offset (Google Earth altitudes are relative to ground)
  4. + *
+ *

+ * Note: GeometricUtils already adds +2 to terrain elevation, so we don't subtract it here anymore. + * + * @param coordinates Array of [latitude, longitude] in degrees + * @param altitudeFromKML Altitude from the KML file (relative to ground level) + * @return A Bukkit Location with X/Z from projection and Y adjusted for altitude + */ + private @NonNull Location getLocationFromCoordinates(double[] coordinates, double altitudeFromKML) { Location mcLocation = GeometricUtils.getLocationFromCoordinates(coordinates); //add altitude from kml (altitude from Google Earth is always relative to ground) //note: the "-2" is only neccesary because // getLocationFromCoordinates returns terrain altitude + 2 // (one from Bukkits getHighestBlockY and one from our geoutils) - mcLocation.add(0, altitudeFromKML - 2, 0); + mcLocation.add(0, altitudeFromKML, 0); return mcLocation; } - private List > convertToMC(List> geocoords_lists, World world){ - - List > mcLines = new ArrayList<>(); + /** + * Converts multiple lists of geographic coordinates to Minecraft Locations. + *

+ * This method parallelizes the coordinate conversion using a thread pool to improve + * performance when processing large KML files with many coordinates. Each coordinate + * conversion is executed asynchronously, and the method waits for all conversions + * to complete before returning. + *

+ * For each list of coordinates (representing a polyline), it: + *

    + *
  1. Creates a thread pool sized to the number of coordinates
  2. + *
  3. Submits each coordinate conversion as a CompletableFuture
  4. + *
  5. Waits for all futures to complete using {@link CompletableFuture#join()}
  6. + *
  7. Collects the results into a list of Locations
  8. + *
+ *

+ * Note: This method is called from an async task, so the .join() call won't block + * the main server thread. + * + * @param geocoords_lists List of polylines, where each polyline is a list of KML Coordinates + * @param world The world context (currently unused but available for future use) + * @return List of polylines converted to Minecraft Locations + */ + private @NonNull List> convertToMC(@NonNull List> geocoords_lists, World world) { + + List> mcLines = new ArrayList<>(); //This lat/long to xyz conversion takes most of the runtime for this command // since the conversions do not influence each other, we can parallelize them. - for (List geocoords : geocoords_lists){ + for (List geocoords : geocoords_lists) { // ExecutorService to manage the threads - ExecutorService executorService = Executors.newFixedThreadPool(geocoords.size()); + try (ExecutorService executorService = Executors.newFixedThreadPool(geocoords.size())) { - // List to store CompletableFuture results - List> completableFutureList = new ArrayList<>(); + // List to store CompletableFuture results + List> completableFutureList = new ArrayList<>(); - // Create a CompletableFuture for each set of coordinates - for (Coordinate geocoord : geocoords) { - double[] coordinates = new double[]{geocoord.getLatitude(), geocoord.getLongitude()}; + // Create a CompletableFuture for each set of coordinates + for (Coordinate geocoord : geocoords) { + double[] coordinates = new double[]{geocoord.getLatitude(), geocoord.getLongitude()}; - CompletableFuture completableFuture = CompletableFuture.supplyAsync(() -> - getLocationFromCoordinates(coordinates, geocoord.getAltitude()), executorService); - completableFutureList.add(completableFuture); - } + CompletableFuture completableFuture = CompletableFuture.supplyAsync(() -> getLocationFromCoordinates(coordinates, geocoord.getAltitude()), executorService); + completableFutureList.add(completableFuture); + } - // Combine all CompletableFutures into a single CompletableFuture representing all of them - CompletableFuture allOf = CompletableFuture.allOf( - completableFutureList.toArray(new CompletableFuture[0]) - ); + // Combine all CompletableFutures into a single CompletableFuture representing all of them + CompletableFuture allOf = CompletableFuture.allOf(completableFutureList.toArray(new CompletableFuture[0])); - // Wait for all CompletableFutures to complete - allOf.join(); + // Wait for all CompletableFutures to complete + allOf.join(); - // Collect the results from the CompletableFutures - List mcLine = completableFutureList.stream() - .map(CompletableFuture::join) - .collect(Collectors.toList()); + // Collect the results from the CompletableFutures + List mcLine = completableFutureList.stream().map(CompletableFuture::join).toList(); - mcLines.add(mcLine); + mcLines.add(mcLine); - // Shutdown the ExecutorService - executorService.shutdown(); + // Shutdown the ExecutorService + executorService.shutdown(); + } } return mcLines; } - private BlockCreationMode commandToCreationMode(String command){ - if (command.equals("geopoints")) - return BlockCreationMode.POINTS; - else if (command.equals("geopath")) - return BlockCreationMode.PATH; - else if (command.equals("georing")) - return BlockCreationMode.CLOSED_PATH; - else if (command.equals("geosurface")) - { - throw new UnsupportedOperationException("Operation mode 'filled surface' is not yet implemented"); + /** + * Maps command aliases to their corresponding block creation modes. + *

+ * This method determines how KML coordinates should be processed: + *

    + *
  • geopoints → {@link BlockCreationMode#POINTS}: Places blocks only at coordinate points
  • + *
  • geopath → {@link BlockCreationMode#PATH}: Draws lines between consecutive points
  • + *
  • georing → {@link BlockCreationMode#CLOSED_PATH}: Draws lines and closes the path (connects last to first)
  • + *
  • geosurface → {@link BlockCreationMode#FILLED}: Triangulates and fills the polygon (not yet implemented)
  • + *
+ * + * @param command The command alias used to invoke the KML command + * @return The BlockCreationMode corresponding to the command + * @throws UnsupportedOperationException if command is "geosurface" (not implemented) + * @throws IllegalArgumentException if command is not recognized + */ + private BlockCreationMode commandToCreationMode(@NonNull String command) { + return switch (command) { + case "geopoints" -> BlockCreationMode.POINTS; + case "geopath" -> BlockCreationMode.PATH; + case "georing" -> BlockCreationMode.CLOSED_PATH; + case "geosurface" -> + throw new UnsupportedOperationException("Operation mode 'filled surface' is not yet implemented"); //return BlockCreationMode.FILLED; - } - else - throw new IllegalArgumentException(command); - + default -> throw new IllegalArgumentException(command); + }; + } + /** + * Per-player history of KML command transactions for undo functionality. + *

+ * Each player has a stack of {@link ChangeTransaction} objects representing their + * executed KML commands. This allows players to undo their changes using /kml undo. + *

+ * The most recent transaction is at the top of the stack and will be undone first. + */ private HashMap> playerHistories; } diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java b/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java index 2ddbc302..24a6b51b 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java +++ b/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java @@ -95,7 +95,8 @@ public void tpllPlayer(@NotNull Player player, double @NotNull [] coordinates, S out.writeUTF("TPLL"); out.writeUTF(targetServerName); out.writeUTF(player.getUniqueId().toString()); - out.writeUTF(String.valueOf(coordinates[0] + coordinates[1])); + out.writeUTF(String.valueOf(coordinates[0])); + out.writeUTF(String.valueOf(coordinates[1])); player.sendPluginMessage(BuildTeamTools.getInstance(), "btt:buildteam", out.toByteArray()); // Switch the player to the target server diff --git a/src/main/java/net/buildtheearth/utils/GeometricUtils.java b/src/main/java/net/buildtheearth/utils/GeometricUtils.java index fd492a50..ae19fd20 100644 --- a/src/main/java/net/buildtheearth/utils/GeometricUtils.java +++ b/src/main/java/net/buildtheearth/utils/GeometricUtils.java @@ -56,10 +56,10 @@ public static Location getLocationFromCoordinatesYawPitch(double[] coordinates, * @return A bukkit location matching the coordinates. Height is terrain elevation +2. */ public static Location getLocationFromCoordinates(double[] coordinates) { - double[] xz = CoordinateConversion.convertToGeo(coordinates[0], coordinates[1]); + double[] xz = CoordinateConversion.convertFromGeo(coordinates[0], coordinates[1]); double x = xz[0]; - double z = -xz[1]; + double z = xz[1]; //Creates the location Location location; From 66b91b0c2e170126013c0ed739a38b6053b96b3c Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 12 Jan 2026 18:58:09 +0100 Subject: [PATCH 22/37] =?UTF-8?q?refactor(build):=20=E2=9C=A8=20rename=20p?= =?UTF-8?q?ackages=20to=20align=20with=20buildteamtools=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => buildteamtools}/BuildTeamTools.java | 20 +++++------ .../{ => buildteamtools}/modules/Module.java | 4 +-- .../modules/ModuleComponent.java | 3 +- .../modules/ModuleHandler.java | 6 ++-- .../modules/common/CommonModule.java | 36 +++++++++---------- .../commands/BuildTeamToolsCommand.java | 20 +++++------ .../dependency/DependencyComponent.java | 6 ++-- .../PluginMessagingComponent.java | 12 +++---- .../components/updater/UpdaterComponent.java | 13 +++---- .../components/version/VersionComponent.java | 4 +-- .../common/listeners/CommandListener.java | 6 ++-- .../common/listeners/ExceptionListener.java | 2 +- .../modules/generator/GeneratorModule.java | 34 +++++++++--------- .../generator/commands/GeneratorCommand.java | 12 +++---- .../generator/components/field/CropStage.java | 2 +- .../generator/components/field/CropType.java | 2 +- .../generator/components/field/Field.java | 6 ++-- .../generator/components/field/FieldFlag.java | 6 ++-- .../components/field/FieldScripts.java | 8 ++--- .../components/field/FieldSettings.java | 8 ++--- .../components/field/menu/CropStageMenu.java | 16 ++++----- .../components/field/menu/CropTypeMenu.java | 20 +++++------ .../components/field/menu/FenceTypeMenu.java | 14 ++++---- .../generator/components/house/House.java | 6 ++-- .../generator/components/house/HouseFlag.java | 6 ++-- .../components/house/HouseScripts.java | 12 +++---- .../components/house/HouseSettings.java | 8 ++--- .../generator/components/house/RoofType.java | 2 +- .../house/menu/AdvancedSettingsMenu.java | 20 +++++------ .../components/house/menu/BaseColorMenu.java | 14 ++++---- .../components/house/menu/RoofColorMenu.java | 16 ++++----- .../components/house/menu/RoofTypeMenu.java | 18 +++++----- .../components/house/menu/WallColorMenu.java | 16 ++++----- .../components/kml/BlockCreationMode.java | 2 +- .../components/kml/ChangeTransaction.java | 14 ++++---- .../generator/components/kml/KmlCommand.java | 12 +++---- .../generator/components/kml/KmlParser.java | 2 +- .../components/kml/KmlTabCompleter.java | 10 +++--- .../generator/components/rail/Rail.java | 8 ++--- .../generator/components/rail/RailFlag.java | 6 ++-- .../components/rail/RailScripts.java | 6 ++-- .../components/rail/RailSettings.java | 4 +-- .../generator/components/road/Road.java | 8 ++--- .../generator/components/road/RoadFlag.java | 6 ++-- .../components/road/RoadScripts.java | 10 +++--- .../components/road/RoadSettings.java | 4 +-- .../road/menu/AdvancedColorMenu.java | 12 +++---- .../road/menu/AdvancedSettingsMenu.java | 20 +++++------ .../components/road/menu/RoadColorMenu.java | 16 ++++----- .../road/menu/SidewalkColorMenu.java | 14 ++++---- .../generator/components/tree/Tree.java | 10 +++--- .../generator/components/tree/TreeFlag.java | 6 ++-- .../components/tree/TreeScripts.java | 4 +-- .../components/tree/TreeSettings.java | 6 ++-- .../generator/components/tree/TreeType.java | 2 +- .../generator/components/tree/TreeWidth.java | 2 +- .../components/tree/menu/TreeHeightMenu.java | 12 +++---- .../components/tree/menu/TreeTypeMenu.java | 16 ++++----- .../components/tree/menu/TreeWidthMenu.java | 14 ++++---- .../listeners/GeneratorListener.java | 4 +-- .../modules/generator/menu/GeneratorMenu.java | 36 +++++++++---------- .../modules/generator/model/Command.java | 6 ++-- .../modules/generator/model/Flag.java | 12 +++---- .../modules/generator/model/FlagType.java | 12 +++---- .../generator/model/GeneratorCollections.java | 6 ++-- .../generator/model/GeneratorComponent.java | 16 ++++----- .../generator/model/GeneratorType.java | 4 +-- .../modules/generator/model/History.java | 4 +-- .../modules/generator/model/Operation.java | 2 +- .../modules/generator/model/Script.java | 4 +-- .../modules/generator/model/Settings.java | 10 +++--- .../modules/miscellaneous/MiscModule.java | 12 +++---- .../blockpalettegui/BlockPaletteCommand.java | 2 +- .../blockpalettegui/BlockPaletteGUI.java | 4 +-- .../blockpalettegui/BlockPaletteManager.java | 10 +++--- .../blockpalettegui/BlockPaletteMenuType.java | 10 ++---- .../ChoosePaletteBlocksMenu.java | 4 +-- .../blockpalettegui/ChoosePaletteMenu.java | 4 +-- .../blockpalettegui/CreatePaletteMenu.java | 4 +-- .../blockpalettegui/EditPaletteMenu.java | 4 +-- .../blockpalettegui/PaletteBlockListMenu.java | 6 ++-- .../signtextgenerator/SignTextGenerator.java | 4 +-- .../modules/navigation/NavUtils.java | 10 +++--- .../modules/navigation/NavigationModule.java | 32 ++++++++--------- .../navigator/NavigatorComponent.java | 12 +++---- .../navigator/commands/BuildteamCommand.java | 10 +++--- .../navigator/commands/NavigatorCommand.java | 8 ++--- .../listeners/NavigatorJoinListener.java | 10 +++--- .../listeners/NavigatorOpenListener.java | 6 ++-- .../components/tpll/TpllComponent.java | 12 +++---- .../tpll/listeners/TpllJoinListener.java | 6 ++-- .../tpll/listeners/TpllListener.java | 14 ++++---- .../components/warps/WarpsComponent.java | 32 ++++++++--------- .../warps/commands/WarpCommand.java | 12 +++---- .../warps/commands/WarpsBtCommand.java | 10 +++--- .../warps/listeners/WarpJoinListener.java | 6 ++-- .../warps/menu/AddressTypeSelectionMenu.java | 14 ++++---- .../warps/menu/MaterialSelectionMenu.java | 18 +++++----- .../components/warps/menu/WarpEditMenu.java | 22 ++++++------ .../warps/menu/WarpGroupEditMenu.java | 22 ++++++------ .../components/warps/menu/WarpGroupMenu.java | 28 +++++++-------- .../warps/menu/WarpGroupSelectionMenu.java | 8 ++--- .../components/warps/menu/WarpMenu.java | 20 +++++------ .../components/warps/model/Warp.java | 8 ++--- .../components/warps/model/WarpGroup.java | 8 ++--- .../navigation/menu/CountrySelectorMenu.java | 22 ++++++------ .../modules/navigation/menu/ExploreMenu.java | 8 ++--- .../modules/navigation/menu/MainMenu.java | 18 +++++----- .../navigation/menu/StateSelectorMenu.java | 16 ++++----- .../navigation/menu/TutorialsMenu.java | 4 +-- .../modules/network/NetworkModule.java | 26 +++++++------- .../modules/network/api/API.java | 13 +++---- .../modules/network/api/NetworkAPI.java | 22 ++++++------ .../modules/network/api/OpenStreetMapAPI.java | 2 +- .../listeners/NetworkJoinListener.java | 8 ++--- .../listeners/NetworkQuitListener.java | 6 ++-- .../modules/network/model/BuildTeam.java | 12 +++---- .../modules/network/model/Continent.java | 2 +- .../modules/network/model/Permissions.java | 2 +- .../modules/network/model/Region.java | 2 +- .../modules/network/model/RegionType.java | 2 +- .../modules/plotsystem/PlotSystemModule.java | 8 ++--- .../commands/PlotSystemTerraCommand.java | 2 +- .../modules/stats/StatsModule.java | 16 ++++----- .../stats/listeners/StatsListener.java | 8 ++--- .../modules/stats/menu/StatsMenu.java | 16 ++++----- .../modules/stats/model/StatsPlayer.java | 4 +-- .../modules/stats/model/StatsPlayerType.java | 2 +- .../modules/stats/model/StatsServer.java | 4 +-- .../modules/stats/model/StatsServerType.java | 2 +- .../utils/BlockLocation.java | 2 +- .../{ => buildteamtools}/utils/Config.java | 4 +-- .../utils/CustomHeads.java | 2 +- .../utils/GeometricUtils.java | 8 ++--- .../{ => buildteamtools}/utils/JsonUtils.java | 8 ++--- .../utils/LineRasterization.java | 4 +-- .../{ => buildteamtools}/utils/ListUtil.java | 2 +- .../{ => buildteamtools}/utils/MathUtils.java | 2 +- .../{ => buildteamtools}/utils/MenuItems.java | 2 +- .../utils/PolygonTools.java | 3 +- .../{ => buildteamtools}/utils/Utils.java | 2 +- .../{ => buildteamtools}/utils/WikiLinks.java | 2 +- .../utils/geo/CoordinateConversion.java | 10 +++--- .../geo/projection/GeographicProjection.java | 8 ++--- .../geo/projection/InvertableVectorField.java | 4 +-- .../projection/OffsetProjectionTransform.java | 2 +- .../OutOfProjectionBoundsException.java | 2 +- .../geo/projection/ProjectionTransform.java | 2 +- .../projection/ScaleProjectionTransform.java | 2 +- ...UprightOrientationProjectionTransform.java | 2 +- .../geo/projection/airocean/Airocean.java | 8 ++--- .../airocean/ConformalEstimate.java | 6 ++-- .../projection/airocean/ModifiedAirocean.java | 6 ++-- .../utils/io/ConfigPaths.java | 2 +- .../utils/io/ConfigUtil.java | 2 +- .../utils/io/Constants.java | 2 +- .../{ => buildteamtools}/utils/io/Errors.java | 2 +- .../utils/io/LangPaths.java | 2 +- .../utils/io/LangUtil.java | 2 +- .../utils/menus/AbstractMenu.java | 6 ++-- .../utils/menus/AbstractPaginatedMenu.java | 6 ++-- .../utils/menus/BlockListMenu.java | 6 ++-- .../utils/menus/BookMenu.java | 6 ++-- .../utils/menus/NameListMenu.java | 6 ++-- .../utils/raycast/Raycast.java | 2 +- .../utils/raycast/RaycastAPIMath.java | 2 +- src/main/resources/plugin.yml | 2 +- 167 files changed, 729 insertions(+), 751 deletions(-) rename src/main/java/net/buildtheearth/{ => buildteamtools}/BuildTeamTools.java (73%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/Module.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/ModuleComponent.java (88%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/ModuleHandler.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/common/CommonModule.java (72%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/common/commands/BuildTeamToolsCommand.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/common/components/dependency/DependencyComponent.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/common/components/pluginmessaging/PluginMessagingComponent.java (86%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/common/components/updater/UpdaterComponent.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/common/components/version/VersionComponent.java (94%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/common/listeners/CommandListener.java (88%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/common/listeners/ExceptionListener.java (88%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/GeneratorModule.java (75%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/commands/GeneratorCommand.java (91%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/field/CropStage.java (89%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/field/CropType.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/field/Field.java (75%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/field/FieldFlag.java (76%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/field/FieldScripts.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/field/FieldSettings.java (86%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/field/menu/CropStageMenu.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/field/menu/CropTypeMenu.java (91%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/field/menu/FenceTypeMenu.java (71%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/House.java (80%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/HouseFlag.java (84%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/HouseScripts.java (99%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/HouseSettings.java (91%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/RoofType.java (87%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/menu/AdvancedSettingsMenu.java (89%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/menu/BaseColorMenu.java (71%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/menu/RoofColorMenu.java (80%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/menu/RoofTypeMenu.java (87%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/house/menu/WallColorMenu.java (68%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/kml/BlockCreationMode.java (63%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/kml/ChangeTransaction.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/kml/KmlCommand.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/kml/KmlParser.java (99%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/kml/KmlTabCompleter.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/rail/Rail.java (62%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/rail/RailFlag.java (74%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/rail/RailScripts.java (95%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/rail/RailSettings.java (65%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/road/Road.java (61%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/road/RoadFlag.java (85%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/road/RoadScripts.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/road/RoadSettings.java (94%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/road/menu/AdvancedColorMenu.java (74%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/road/menu/AdvancedSettingsMenu.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/road/menu/RoadColorMenu.java (68%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/road/menu/SidewalkColorMenu.java (71%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/tree/Tree.java (81%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/tree/TreeFlag.java (74%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/tree/TreeScripts.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/tree/TreeSettings.java (66%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/tree/TreeType.java (94%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/tree/TreeWidth.java (87%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/tree/menu/TreeHeightMenu.java (81%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/tree/menu/TreeTypeMenu.java (76%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/components/tree/menu/TreeWidthMenu.java (78%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/listeners/GeneratorListener.java (90%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/menu/GeneratorMenu.java (87%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/Command.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/Flag.java (54%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/FlagType.java (85%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/GeneratorCollections.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/GeneratorComponent.java (90%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/GeneratorType.java (79%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/History.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/Operation.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/Script.java (99%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/generator/model/Settings.java (88%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/MiscModule.java (85%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/blockpalettegui/BlockPaletteCommand.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/blockpalettegui/BlockPaletteGUI.java (83%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java (99%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/blockpalettegui/BlockPaletteMenuType.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/miscellaneous/signtextgenerator/SignTextGenerator.java (72%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/NavUtils.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/NavigationModule.java (52%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/navigator/NavigatorComponent.java (87%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/navigator/commands/BuildteamCommand.java (87%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/navigator/commands/NavigatorCommand.java (78%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/navigator/listeners/NavigatorJoinListener.java (67%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/navigator/listeners/NavigatorOpenListener.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/tpll/TpllComponent.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/tpll/listeners/TpllJoinListener.java (80%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/tpll/listeners/TpllListener.java (90%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/WarpsComponent.java (88%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/commands/WarpCommand.java (88%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/commands/WarpsBtCommand.java (61%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/listeners/WarpJoinListener.java (81%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/menu/MaterialSelectionMenu.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/menu/WarpEditMenu.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/menu/WarpGroupEditMenu.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/menu/WarpGroupMenu.java (90%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java (82%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/menu/WarpMenu.java (85%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/model/Warp.java (94%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/components/warps/model/WarpGroup.java (91%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/menu/CountrySelectorMenu.java (88%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/menu/ExploreMenu.java (90%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/menu/MainMenu.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/menu/StateSelectorMenu.java (90%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/navigation/menu/TutorialsMenu.java (87%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/NetworkModule.java (87%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/api/API.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/api/NetworkAPI.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/api/OpenStreetMapAPI.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/listeners/NetworkJoinListener.java (71%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/listeners/NetworkQuitListener.java (69%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/model/BuildTeam.java (94%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/model/Continent.java (94%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/model/Permissions.java (95%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/model/Region.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/network/model/RegionType.java (89%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/plotsystem/PlotSystemModule.java (94%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/plotsystem/commands/PlotSystemTerraCommand.java (81%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/stats/StatsModule.java (86%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/stats/listeners/StatsListener.java (89%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/stats/menu/StatsMenu.java (88%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/stats/model/StatsPlayer.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/stats/model/StatsPlayerType.java (70%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/stats/model/StatsServer.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/modules/stats/model/StatsServerType.java (72%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/BlockLocation.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/Config.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/CustomHeads.java (99%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/GeometricUtils.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/JsonUtils.java (95%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/LineRasterization.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/ListUtil.java (87%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/MathUtils.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/MenuItems.java (99%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/PolygonTools.java (95%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/Utils.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/WikiLinks.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/CoordinateConversion.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/GeographicProjection.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/InvertableVectorField.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/OffsetProjectionTransform.java (95%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/OutOfProjectionBoundsException.java (90%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/ProjectionTransform.java (89%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/ScaleProjectionTransform.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/UprightOrientationProjectionTransform.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/airocean/Airocean.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/airocean/ConformalEstimate.java (93%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/geo/projection/airocean/ModifiedAirocean.java (94%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/io/ConfigPaths.java (98%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/io/ConfigUtil.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/io/Constants.java (89%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/io/Errors.java (92%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/io/LangPaths.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/io/LangUtil.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/menus/AbstractMenu.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/menus/AbstractPaginatedMenu.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/menus/BlockListMenu.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/menus/BookMenu.java (97%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/menus/NameListMenu.java (96%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/raycast/Raycast.java (99%) rename src/main/java/net/buildtheearth/{ => buildteamtools}/utils/raycast/RaycastAPIMath.java (97%) diff --git a/src/main/java/net/buildtheearth/BuildTeamTools.java b/src/main/java/net/buildtheearth/buildteamtools/BuildTeamTools.java similarity index 73% rename from src/main/java/net/buildtheearth/BuildTeamTools.java rename to src/main/java/net/buildtheearth/buildteamtools/BuildTeamTools.java index e051cd5a..22d1715a 100644 --- a/src/main/java/net/buildtheearth/BuildTeamTools.java +++ b/src/main/java/net/buildtheearth/buildteamtools/BuildTeamTools.java @@ -1,16 +1,16 @@ -package net.buildtheearth; +package net.buildtheearth.buildteamtools; import lombok.Getter; import lombok.Setter; -import net.buildtheearth.modules.ModuleHandler; -import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.miscellaneous.MiscModule; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.plotsystem.PlotSystemModule; -import net.buildtheearth.modules.stats.StatsModule; -import net.buildtheearth.utils.io.ConfigUtil; +import net.buildtheearth.buildteamtools.modules.ModuleHandler; +import net.buildtheearth.buildteamtools.modules.common.CommonModule; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.miscellaneous.MiscModule; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.plotsystem.PlotSystemModule; +import net.buildtheearth.buildteamtools.modules.stats.StatsModule; +import net.buildtheearth.buildteamtools.utils.io.ConfigUtil; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.plugin.java.JavaPlugin; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/net/buildtheearth/modules/Module.java b/src/main/java/net/buildtheearth/buildteamtools/modules/Module.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/Module.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/Module.java index f6ab58aa..14db9133 100644 --- a/src/main/java/net/buildtheearth/modules/Module.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/Module.java @@ -1,10 +1,10 @@ -package net.buildtheearth.modules; +package net.buildtheearth.buildteamtools.modules; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.WikiDocumented; import lombok.Getter; import lombok.NonNull; -import net.buildtheearth.BuildTeamTools; +import net.buildtheearth.buildteamtools.BuildTeamTools; import org.bukkit.Bukkit; import org.bukkit.command.CommandExecutor; import org.bukkit.command.PluginCommand; diff --git a/src/main/java/net/buildtheearth/modules/ModuleComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/ModuleComponent.java similarity index 88% rename from src/main/java/net/buildtheearth/modules/ModuleComponent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/ModuleComponent.java index 09db3a6f..80473eee 100644 --- a/src/main/java/net/buildtheearth/modules/ModuleComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/ModuleComponent.java @@ -1,7 +1,6 @@ -package net.buildtheearth.modules; +package net.buildtheearth.buildteamtools.modules; import lombok.Getter; -import org.bukkit.entity.Player; /** * An interface for BuildTeamTools components. diff --git a/src/main/java/net/buildtheearth/modules/ModuleHandler.java b/src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java similarity index 97% rename from src/main/java/net/buildtheearth/modules/ModuleHandler.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java index dc07f7e0..3bcffe1f 100644 --- a/src/main/java/net/buildtheearth/modules/ModuleHandler.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules; +package net.buildtheearth.buildteamtools.modules; import com.alpsbte.alpslib.utils.ChatHelper; import lombok.Getter; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.io.ConfigPaths; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/buildtheearth/modules/common/CommonModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/CommonModule.java similarity index 72% rename from src/main/java/net/buildtheearth/modules/common/CommonModule.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/common/CommonModule.java index 8204d35d..0f4811f3 100644 --- a/src/main/java/net/buildtheearth/modules/common/CommonModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/CommonModule.java @@ -1,26 +1,26 @@ -package net.buildtheearth.modules.common; +package net.buildtheearth.buildteamtools.modules.common; import com.alpsbte.alpslib.io.YamlFileFactory; import com.alpsbte.alpslib.io.config.ConfigNotImplementedException; import com.alpsbte.alpslib.utils.ChatHelper; import lombok.Getter; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.common.commands.BuildTeamToolsCommand; -import net.buildtheearth.modules.common.components.dependency.DependencyComponent; -import net.buildtheearth.modules.common.components.pluginmessaging.PluginMessagingComponent; -import net.buildtheearth.modules.common.components.updater.UpdaterComponent; -import net.buildtheearth.modules.common.components.version.VersionComponent; -import net.buildtheearth.modules.common.listeners.CommandListener; -import net.buildtheearth.modules.common.listeners.ExceptionListener; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.stats.StatsModule; -import net.buildtheearth.modules.stats.model.StatsPlayerType; -import net.buildtheearth.modules.stats.model.StatsServerType; -import net.buildtheearth.utils.WikiLinks; -import net.buildtheearth.utils.io.ConfigPaths; -import net.buildtheearth.utils.io.ConfigUtil; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.Module; +import net.buildtheearth.buildteamtools.modules.common.commands.BuildTeamToolsCommand; +import net.buildtheearth.buildteamtools.modules.common.components.dependency.DependencyComponent; +import net.buildtheearth.buildteamtools.modules.common.components.pluginmessaging.PluginMessagingComponent; +import net.buildtheearth.buildteamtools.modules.common.components.updater.UpdaterComponent; +import net.buildtheearth.buildteamtools.modules.common.components.version.VersionComponent; +import net.buildtheearth.buildteamtools.modules.common.listeners.CommandListener; +import net.buildtheearth.buildteamtools.modules.common.listeners.ExceptionListener; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.stats.StatsModule; +import net.buildtheearth.buildteamtools.modules.stats.model.StatsPlayerType; +import net.buildtheearth.buildteamtools.modules.stats.model.StatsServerType; +import net.buildtheearth.buildteamtools.utils.WikiLinks; +import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; +import net.buildtheearth.buildteamtools.utils.io.ConfigUtil; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.ipvp.canvas.MenuFunctionListener; diff --git a/src/main/java/net/buildtheearth/modules/common/commands/BuildTeamToolsCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/commands/BuildTeamToolsCommand.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/common/commands/BuildTeamToolsCommand.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/common/commands/BuildTeamToolsCommand.java index d0581547..8da8037a 100644 --- a/src/main/java/net/buildtheearth/modules/common/commands/BuildTeamToolsCommand.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/commands/BuildTeamToolsCommand.java @@ -1,16 +1,16 @@ -package net.buildtheearth.modules.common.commands; +package net.buildtheearth.buildteamtools.modules.common.commands; import com.alpsbte.alpslib.utils.ChatHelper; import com.google.gson.Gson; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.ModuleHandler; -import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.modules.network.model.Region; -import net.buildtheearth.modules.stats.StatsModule; -import net.buildtheearth.utils.Utils; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.Module; +import net.buildtheearth.buildteamtools.modules.ModuleHandler; +import net.buildtheearth.buildteamtools.modules.common.CommonModule; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.modules.network.model.Region; +import net.buildtheearth.buildteamtools.modules.stats.StatsModule; +import net.buildtheearth.buildteamtools.utils.Utils; import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.HoverEvent; import net.md_5.bungee.api.chat.TextComponent; diff --git a/src/main/java/net/buildtheearth/modules/common/components/dependency/DependencyComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/components/dependency/DependencyComponent.java similarity index 92% rename from src/main/java/net/buildtheearth/modules/common/components/dependency/DependencyComponent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/common/components/dependency/DependencyComponent.java index 09a70b8e..595eb00b 100644 --- a/src/main/java/net/buildtheearth/modules/common/components/dependency/DependencyComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/components/dependency/DependencyComponent.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.common.components.dependency; +package net.buildtheearth.buildteamtools.modules.common.components.dependency; import com.sk89q.worldedit.WorldEdit; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; import java.util.Objects; diff --git a/src/main/java/net/buildtheearth/modules/common/components/pluginmessaging/PluginMessagingComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/components/pluginmessaging/PluginMessagingComponent.java similarity index 86% rename from src/main/java/net/buildtheearth/modules/common/components/pluginmessaging/PluginMessagingComponent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/common/components/pluginmessaging/PluginMessagingComponent.java index fa93b403..9760a42f 100644 --- a/src/main/java/net/buildtheearth/modules/common/components/pluginmessaging/PluginMessagingComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/components/pluginmessaging/PluginMessagingComponent.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.common.components.pluginmessaging; +package net.buildtheearth.buildteamtools.modules.common.components.pluginmessaging; import com.alpsbte.alpslib.utils.ChatHelper; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteStreams; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.ModuleComponent; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.stats.StatsModule; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.stats.StatsModule; import org.bukkit.entity.Player; import org.bukkit.plugin.messaging.PluginMessageListener; diff --git a/src/main/java/net/buildtheearth/modules/common/components/updater/UpdaterComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/components/updater/UpdaterComponent.java similarity index 97% rename from src/main/java/net/buildtheearth/modules/common/components/updater/UpdaterComponent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/common/components/updater/UpdaterComponent.java index 8d0a058b..0eea39a3 100644 --- a/src/main/java/net/buildtheearth/modules/common/components/updater/UpdaterComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/components/updater/UpdaterComponent.java @@ -1,22 +1,17 @@ -package net.buildtheearth.modules.common.components.updater; +package net.buildtheearth.buildteamtools.modules.common.components.updater; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import net.buildtheearth.modules.ModuleComponent; -import net.buildtheearth.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; import org.bukkit.Bukkit; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; +import java.io.*; import java.net.HttpURLConnection; import java.net.URL; import java.util.logging.Level; diff --git a/src/main/java/net/buildtheearth/modules/common/components/version/VersionComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/components/version/VersionComponent.java similarity index 94% rename from src/main/java/net/buildtheearth/modules/common/components/version/VersionComponent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/common/components/version/VersionComponent.java index 6f658ce7..311ae89a 100644 --- a/src/main/java/net/buildtheearth/modules/common/components/version/VersionComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/components/version/VersionComponent.java @@ -1,7 +1,7 @@ -package net.buildtheearth.modules.common.components.version; +package net.buildtheearth.buildteamtools.modules.common.components.version; import lombok.Getter; -import net.buildtheearth.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; import org.bukkit.Bukkit; import java.util.Arrays; diff --git a/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/listeners/CommandListener.java similarity index 88% rename from src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/common/listeners/CommandListener.java index 4ce65cf8..02b15748 100644 --- a/src/main/java/net/buildtheearth/modules/common/listeners/CommandListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/listeners/CommandListener.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.common.listeners; +package net.buildtheearth.buildteamtools.modules.common.listeners; import com.alpsbte.alpslib.utils.ChatHelper; -import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.ModuleHandler; +import net.buildtheearth.buildteamtools.modules.Module; +import net.buildtheearth.buildteamtools.modules.ModuleHandler; import org.bukkit.command.PluginCommand; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/main/java/net/buildtheearth/modules/common/listeners/ExceptionListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/listeners/ExceptionListener.java similarity index 88% rename from src/main/java/net/buildtheearth/modules/common/listeners/ExceptionListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/common/listeners/ExceptionListener.java index 810c018f..07523e49 100644 --- a/src/main/java/net/buildtheearth/modules/common/listeners/ExceptionListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/listeners/ExceptionListener.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.common.listeners; +package net.buildtheearth.buildteamtools.modules.common.listeners; import com.destroystokyo.paper.event.server.ServerExceptionEvent; import org.bukkit.event.EventHandler; diff --git a/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/GeneratorModule.java similarity index 75% rename from src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/GeneratorModule.java index ff001828..681ede42 100644 --- a/src/main/java/net/buildtheearth/modules/generator/GeneratorModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/GeneratorModule.java @@ -1,24 +1,24 @@ -package net.buildtheearth.modules.generator; +package net.buildtheearth.buildteamtools.modules.generator; import com.alpsbte.alpslib.utils.GeneratorUtils; import com.sk89q.worldedit.LocalSession; import lombok.Getter; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.generator.commands.GeneratorCommand; -import net.buildtheearth.modules.generator.components.field.Field; -import net.buildtheearth.modules.generator.components.house.House; -import net.buildtheearth.modules.generator.components.kml.KmlCommand; -import net.buildtheearth.modules.generator.components.kml.KmlTabCompleter; -import net.buildtheearth.modules.generator.components.rail.Rail; -import net.buildtheearth.modules.generator.components.road.Road; -import net.buildtheearth.modules.generator.components.tree.Tree; -import net.buildtheearth.modules.generator.listeners.GeneratorListener; -import net.buildtheearth.modules.generator.model.Command; -import net.buildtheearth.modules.generator.model.GeneratorCollections; -import net.buildtheearth.modules.generator.model.History; -import net.buildtheearth.utils.WikiLinks; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.Module; +import net.buildtheearth.buildteamtools.modules.common.CommonModule; +import net.buildtheearth.buildteamtools.modules.generator.commands.GeneratorCommand; +import net.buildtheearth.buildteamtools.modules.generator.components.field.Field; +import net.buildtheearth.buildteamtools.modules.generator.components.house.House; +import net.buildtheearth.buildteamtools.modules.generator.components.kml.KmlCommand; +import net.buildtheearth.buildteamtools.modules.generator.components.kml.KmlTabCompleter; +import net.buildtheearth.buildteamtools.modules.generator.components.rail.Rail; +import net.buildtheearth.buildteamtools.modules.generator.components.road.Road; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.Tree; +import net.buildtheearth.buildteamtools.modules.generator.listeners.GeneratorListener; +import net.buildtheearth.buildteamtools.modules.generator.model.Command; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorCollections; +import net.buildtheearth.buildteamtools.modules.generator.model.History; +import net.buildtheearth.buildteamtools.utils.WikiLinks; import org.bukkit.entity.Player; import java.util.ArrayList; diff --git a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/commands/GeneratorCommand.java similarity index 91% rename from src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/commands/GeneratorCommand.java index e13ddd85..b3fe253c 100644 --- a/src/main/java/net/buildtheearth/modules/generator/commands/GeneratorCommand.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/commands/GeneratorCommand.java @@ -1,11 +1,11 @@ -package net.buildtheearth.modules.generator.commands; +package net.buildtheearth.buildteamtools.modules.generator.commands; import com.alpsbte.alpslib.utils.ChatHelper; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.menu.GeneratorMenu; -import net.buildtheearth.modules.generator.model.History; -import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.Utils; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.menu.GeneratorMenu; +import net.buildtheearth.buildteamtools.modules.generator.model.History; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.utils.Utils; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.command.Command; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/CropStage.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/CropStage.java similarity index 89% rename from src/main/java/net/buildtheearth/modules/generator/components/field/CropStage.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/CropStage.java index 87d0ec5a..c32d16db 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/CropStage.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/CropStage.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.components.field; +package net.buildtheearth.buildteamtools.modules.generator.components.field; public enum CropStage { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/CropType.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/CropType.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/generator/components/field/CropType.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/CropType.java index 4e08678c..6e87a19a 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/CropType.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/CropType.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.components.field; +package net.buildtheearth.buildteamtools.modules.generator.components.field; public enum CropType { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/Field.java similarity index 75% rename from src/main/java/net/buildtheearth/modules/generator/components/field/Field.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/Field.java index f11d8e2a..69df9d05 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/Field.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/Field.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.generator.components.field; +package net.buildtheearth.buildteamtools.modules.generator.components.field; import com.alpsbte.alpslib.utils.GeneratorUtils; -import net.buildtheearth.modules.generator.model.GeneratorComponent; -import net.buildtheearth.modules.generator.model.GeneratorType; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorComponent; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorType; import org.bukkit.entity.Player; public class Field extends GeneratorComponent { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldFlag.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/FieldFlag.java similarity index 76% rename from src/main/java/net/buildtheearth/modules/generator/components/field/FieldFlag.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/FieldFlag.java index 10025e72..754e5cde 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldFlag.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/FieldFlag.java @@ -1,7 +1,7 @@ -package net.buildtheearth.modules.generator.components.field; +package net.buildtheearth.buildteamtools.modules.generator.components.field; -import net.buildtheearth.modules.generator.model.FlagType; -import net.buildtheearth.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.FlagType; public enum FieldFlag implements Flag { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/FieldScripts.java similarity index 97% rename from src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/FieldScripts.java index aebe8665..88ab3e91 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldScripts.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/FieldScripts.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules.generator.components.field; +package net.buildtheearth.buildteamtools.modules.generator.components.field; import com.alpsbte.alpslib.utils.GeneratorUtils; -import net.buildtheearth.modules.generator.model.Flag; -import net.buildtheearth.modules.generator.model.GeneratorComponent; -import net.buildtheearth.modules.generator.model.Script; +import net.buildtheearth.buildteamtools.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorComponent; +import net.buildtheearth.buildteamtools.modules.generator.model.Script; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldSettings.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/FieldSettings.java similarity index 86% rename from src/main/java/net/buildtheearth/modules/generator/components/field/FieldSettings.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/FieldSettings.java index 35dede83..8f4395a7 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/FieldSettings.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/FieldSettings.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules.generator.components.field; +package net.buildtheearth.buildteamtools.modules.generator.components.field; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.Utils; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.Utils; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropStageMenu.java similarity index 92% rename from src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropStageMenu.java index 32444cd4..329ac04e 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropStageMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropStageMenu.java @@ -1,14 +1,14 @@ -package net.buildtheearth.modules.generator.components.field.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.field.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.field.*; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.WikiLinks; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.field.*; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.WikiLinks; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java similarity index 91% rename from src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java index b66528de..0180412d 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/CropTypeMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java @@ -1,16 +1,16 @@ -package net.buildtheearth.modules.generator.components.field.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.field.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.field.CropType; -import net.buildtheearth.modules.generator.components.field.FieldFlag; -import net.buildtheearth.modules.generator.components.field.FieldSettings; -import net.buildtheearth.modules.generator.menu.GeneratorMenu; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.field.CropType; +import net.buildtheearth.buildteamtools.modules.generator.components.field.FieldFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.field.FieldSettings; +import net.buildtheearth.buildteamtools.modules.generator.menu.GeneratorMenu; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/FenceTypeMenu.java similarity index 71% rename from src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/FenceTypeMenu.java index dd9e3ce3..85d0c503 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/field/menu/FenceTypeMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/FenceTypeMenu.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.generator.components.field.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.field.menu; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.field.FieldFlag; -import net.buildtheearth.modules.generator.components.field.FieldSettings; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.BlockListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.field.FieldFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.field.FieldSettings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.BlockListMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/House.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/House.java similarity index 80% rename from src/main/java/net/buildtheearth/modules/generator/components/house/House.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/House.java index 5d618fe7..e0da3777 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/House.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/House.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.generator.components.house; +package net.buildtheearth.buildteamtools.modules.generator.components.house; import com.alpsbte.alpslib.utils.GeneratorUtils; -import net.buildtheearth.modules.generator.model.GeneratorComponent; -import net.buildtheearth.modules.generator.model.GeneratorType; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorComponent; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorType; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseFlag.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/HouseFlag.java similarity index 84% rename from src/main/java/net/buildtheearth/modules/generator/components/house/HouseFlag.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/HouseFlag.java index b1685bfe..117d011b 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseFlag.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/HouseFlag.java @@ -1,7 +1,7 @@ -package net.buildtheearth.modules.generator.components.house; +package net.buildtheearth.buildteamtools.modules.generator.components.house; -import net.buildtheearth.modules.generator.model.FlagType; -import net.buildtheearth.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.FlagType; public enum HouseFlag implements Flag { WALL_COLOR("w", FlagType.XMATERIAL_LIST), diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/HouseScripts.java similarity index 99% rename from src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/HouseScripts.java index 0e1af58b..c972420b 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseScripts.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/HouseScripts.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.components.house; +package net.buildtheearth.buildteamtools.modules.generator.components.house; import com.alpsbte.alpslib.utils.GeneratorUtils; import com.alpsbte.alpslib.utils.item.Item; @@ -7,11 +7,11 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.generator.model.Flag; -import net.buildtheearth.modules.generator.model.GeneratorComponent; -import net.buildtheearth.modules.generator.model.Script; -import net.buildtheearth.utils.MenuItems; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorComponent; +import net.buildtheearth.buildteamtools.modules.generator.model.Script; +import net.buildtheearth.buildteamtools.utils.MenuItems; import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseSettings.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/HouseSettings.java similarity index 91% rename from src/main/java/net/buildtheearth/modules/generator/components/house/HouseSettings.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/HouseSettings.java index ae0caa54..95c0ef45 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/HouseSettings.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/HouseSettings.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules.generator.components.house; +package net.buildtheearth.buildteamtools.modules.generator.components.house; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.Utils; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.Utils; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/RoofType.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/RoofType.java similarity index 87% rename from src/main/java/net/buildtheearth/modules/generator/components/house/RoofType.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/RoofType.java index 41e51280..9312da19 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/RoofType.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/RoofType.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.components.house; +package net.buildtheearth.buildteamtools.modules.generator.components.house; public enum RoofType { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/AdvancedSettingsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java similarity index 89% rename from src/main/java/net/buildtheearth/modules/generator/components/house/menu/AdvancedSettingsMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java index cfe85206..69dd70a7 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/AdvancedSettingsMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.generator.components.house.menu; - -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.modules.generator.components.house.House; -import net.buildtheearth.modules.generator.components.house.HouseFlag; -import net.buildtheearth.modules.generator.components.house.HouseSettings; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractMenu; +package net.buildtheearth.buildteamtools.modules.generator.components.house.menu; + +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.house.House; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseSettings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.ipvp.canvas.mask.BinaryMask; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/BaseColorMenu.java similarity index 71% rename from src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/BaseColorMenu.java index 455e412c..cecb09af 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/BaseColorMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/BaseColorMenu.java @@ -1,12 +1,12 @@ -package net.buildtheearth.modules.generator.components.house.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.house.menu; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.house.HouseFlag; -import net.buildtheearth.modules.generator.components.house.HouseSettings; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.BlockListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseSettings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.BlockListMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofColorMenu.java similarity index 80% rename from src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofColorMenu.java index 4acab2f3..698a53a5 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofColorMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofColorMenu.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.generator.components.house.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.house.menu; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.house.HouseFlag; -import net.buildtheearth.modules.generator.components.house.HouseSettings; -import net.buildtheearth.modules.generator.components.house.RoofType; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.BlockListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.house.RoofType; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.BlockListMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofTypeMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java similarity index 87% rename from src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofTypeMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java index 5cc30dbc..204384c0 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/RoofTypeMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java @@ -1,15 +1,15 @@ -package net.buildtheearth.modules.generator.components.house.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.house.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.house.HouseFlag; -import net.buildtheearth.modules.generator.components.house.HouseSettings; -import net.buildtheearth.modules.generator.components.house.RoofType; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.house.RoofType; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/WallColorMenu.java similarity index 68% rename from src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/WallColorMenu.java index 41d1ac45..bb68936e 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/house/menu/WallColorMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/WallColorMenu.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.generator.components.house.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.house.menu; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.house.HouseFlag; -import net.buildtheearth.modules.generator.components.house.HouseSettings; -import net.buildtheearth.modules.generator.menu.GeneratorMenu; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.BlockListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseSettings; +import net.buildtheearth.buildteamtools.modules.generator.menu.GeneratorMenu; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.BlockListMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/kml/BlockCreationMode.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/BlockCreationMode.java similarity index 63% rename from src/main/java/net/buildtheearth/modules/generator/components/kml/BlockCreationMode.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/BlockCreationMode.java index a9a40065..00a47a48 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/kml/BlockCreationMode.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/BlockCreationMode.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.components.kml; +package net.buildtheearth.buildteamtools.modules.generator.components.kml; public enum BlockCreationMode { POINTS, //geopoints diff --git a/src/main/java/net/buildtheearth/modules/generator/components/kml/ChangeTransaction.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/ChangeTransaction.java similarity index 96% rename from src/main/java/net/buildtheearth/modules/generator/components/kml/ChangeTransaction.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/ChangeTransaction.java index 3125360d..d545b900 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/kml/ChangeTransaction.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/ChangeTransaction.java @@ -1,18 +1,16 @@ -package net.buildtheearth.modules.generator.components.kml; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +package net.buildtheearth.buildteamtools.modules.generator.components.kml; +import net.buildtheearth.buildteamtools.utils.BlockLocation; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.entity.Player; - -import net.buildtheearth.utils.BlockLocation; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; /** * A set of block changes that should be bundled together. diff --git a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlCommand.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlCommand.java index 9bb511c4..78520890 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlCommand.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlCommand.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.generator.components.kml; +package net.buildtheearth.buildteamtools.modules.generator.components.kml; import com.alpsbte.alpslib.utils.ChatHelper; import com.cryptomorin.xseries.XMaterial; import de.micromata.opengis.kml.v_2_2_0.Coordinate; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.BlockLocation; -import net.buildtheearth.utils.GeometricUtils; -import net.buildtheearth.utils.LineRasterization; -import net.buildtheearth.utils.PolygonTools; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.utils.BlockLocation; +import net.buildtheearth.buildteamtools.utils.GeometricUtils; +import net.buildtheearth.buildteamtools.utils.LineRasterization; +import net.buildtheearth.buildteamtools.utils.PolygonTools; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlParser.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlParser.java similarity index 99% rename from src/main/java/net/buildtheearth/modules/generator/components/kml/KmlParser.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlParser.java index d48bdb06..8b9f92dc 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlParser.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlParser.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.components.kml; +package net.buildtheearth.buildteamtools.modules.generator.components.kml; import de.micromata.opengis.kml.v_2_2_0.*; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlTabCompleter.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlTabCompleter.java similarity index 97% rename from src/main/java/net/buildtheearth/modules/generator/components/kml/KmlTabCompleter.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlTabCompleter.java index 2d2a3ecc..3695e2f8 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/kml/KmlTabCompleter.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlTabCompleter.java @@ -1,8 +1,4 @@ -package net.buildtheearth.modules.generator.components.kml; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +package net.buildtheearth.buildteamtools.modules.generator.components.kml; import org.bukkit.Material; import org.bukkit.command.Command; @@ -10,6 +6,10 @@ import org.bukkit.command.TabCompleter; import org.bukkit.entity.Player; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + public class KmlTabCompleter implements TabCompleter{ public KmlTabCompleter(){ //compile list of block material types for completion diff --git a/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/Rail.java similarity index 62% rename from src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/Rail.java index 4d06e3cc..b0a7b913 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/rail/Rail.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/Rail.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules.generator.components.rail; +package net.buildtheearth.buildteamtools.modules.generator.components.rail; import com.alpsbte.alpslib.utils.GeneratorUtils; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.GeneratorComponent; -import net.buildtheearth.modules.generator.model.GeneratorType; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorComponent; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorType; import org.bukkit.entity.Player; public class Rail extends GeneratorComponent { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailFlag.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/RailFlag.java similarity index 74% rename from src/main/java/net/buildtheearth/modules/generator/components/rail/RailFlag.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/RailFlag.java index e0d17484..a78994b0 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailFlag.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/RailFlag.java @@ -1,7 +1,7 @@ -package net.buildtheearth.modules.generator.components.rail; +package net.buildtheearth.buildteamtools.modules.generator.components.rail; -import net.buildtheearth.modules.generator.model.FlagType; -import net.buildtheearth.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.FlagType; public enum RailFlag implements Flag { LANE_COUNT("c", FlagType.INTEGER); diff --git a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/RailScripts.java similarity index 95% rename from src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/RailScripts.java index 1593df6b..ab1156d2 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailScripts.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/RailScripts.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.generator.components.rail; +package net.buildtheearth.buildteamtools.modules.generator.components.rail; import com.alpsbte.alpslib.utils.GeneratorUtils; -import net.buildtheearth.modules.generator.model.GeneratorComponent; -import net.buildtheearth.modules.generator.model.Script; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorComponent; +import net.buildtheearth.buildteamtools.modules.generator.model.Script; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailSettings.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/RailSettings.java similarity index 65% rename from src/main/java/net/buildtheearth/modules/generator/components/rail/RailSettings.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/RailSettings.java index 9b62c40e..0d7ef243 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/rail/RailSettings.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/rail/RailSettings.java @@ -1,6 +1,6 @@ -package net.buildtheearth.modules.generator.components.rail; +package net.buildtheearth.buildteamtools.modules.generator.components.rail; -import net.buildtheearth.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; import org.bukkit.entity.Player; public class RailSettings extends Settings { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/Road.java similarity index 61% rename from src/main/java/net/buildtheearth/modules/generator/components/road/Road.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/Road.java index c22f1831..dc133d3f 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/Road.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/Road.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules.generator.components.road; +package net.buildtheearth.buildteamtools.modules.generator.components.road; import com.alpsbte.alpslib.utils.GeneratorUtils; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.model.GeneratorComponent; -import net.buildtheearth.modules.generator.model.GeneratorType; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorComponent; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorType; import org.bukkit.entity.Player; public class Road extends GeneratorComponent { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadFlag.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadFlag.java similarity index 85% rename from src/main/java/net/buildtheearth/modules/generator/components/road/RoadFlag.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadFlag.java index 9205134b..79760261 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadFlag.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadFlag.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.generator.components.road; +package net.buildtheearth.buildteamtools.modules.generator.components.road; -import net.buildtheearth.modules.generator.model.FlagType; -import net.buildtheearth.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.FlagType; public enum RoadFlag implements Flag { LANE_COUNT("c", FlagType.INTEGER), diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadScripts.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadScripts.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/generator/components/road/RoadScripts.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadScripts.java index d3090857..7fbaa368 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadScripts.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadScripts.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.generator.components.road; +package net.buildtheearth.buildteamtools.modules.generator.components.road; import com.alpsbte.alpslib.utils.GeneratorUtils; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.generator.model.Flag; -import net.buildtheearth.modules.generator.model.GeneratorComponent; -import net.buildtheearth.modules.generator.model.Script; +import net.buildtheearth.buildteamtools.modules.common.CommonModule; +import net.buildtheearth.buildteamtools.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorComponent; +import net.buildtheearth.buildteamtools.modules.generator.model.Script; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadSettings.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadSettings.java similarity index 94% rename from src/main/java/net/buildtheearth/modules/generator/components/road/RoadSettings.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadSettings.java index 8312b288..1cda8457 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/RoadSettings.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadSettings.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.generator.components.road; +package net.buildtheearth.buildteamtools.modules.generator.components.road; import com.alpsbte.alpslib.utils.GeneratorUtils; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; import org.bukkit.entity.Player; import java.io.File; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedColorMenu.java similarity index 74% rename from src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedColorMenu.java index bd647800..0a4e79c6 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedColorMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedColorMenu.java @@ -1,11 +1,11 @@ -package net.buildtheearth.modules.generator.components.road.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.road.menu; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.road.RoadFlag; -import net.buildtheearth.modules.generator.components.road.RoadSettings; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.menus.BlockListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadSettings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.menus.BlockListMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedSettingsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java similarity index 92% rename from src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedSettingsMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java index 9aa71755..40334242 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/AdvancedSettingsMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java @@ -1,16 +1,16 @@ -package net.buildtheearth.modules.generator.components.road.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.road.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.road.Road; -import net.buildtheearth.modules.generator.components.road.RoadFlag; -import net.buildtheearth.modules.generator.components.road.RoadSettings; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.road.Road; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadSettings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/RoadColorMenu.java similarity index 68% rename from src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/RoadColorMenu.java index c46e2e30..d76379f6 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/RoadColorMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/RoadColorMenu.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.generator.components.road.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.road.menu; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.road.RoadFlag; -import net.buildtheearth.modules.generator.components.road.RoadSettings; -import net.buildtheearth.modules.generator.menu.GeneratorMenu; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.BlockListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadSettings; +import net.buildtheearth.buildteamtools.modules.generator.menu.GeneratorMenu; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.BlockListMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/SidewalkColorMenu.java similarity index 71% rename from src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/SidewalkColorMenu.java index 2e6a7f84..8f79bf8d 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/road/menu/SidewalkColorMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/SidewalkColorMenu.java @@ -1,12 +1,12 @@ -package net.buildtheearth.modules.generator.components.road.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.road.menu; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.road.RoadFlag; -import net.buildtheearth.modules.generator.components.road.RoadSettings; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.BlockListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadSettings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.BlockListMenu; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/Tree.java similarity index 81% rename from src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/Tree.java index a8189235..6c5e747f 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/Tree.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/Tree.java @@ -1,11 +1,11 @@ -package net.buildtheearth.modules.generator.components.tree; +package net.buildtheearth.buildteamtools.modules.generator.components.tree; import com.alpsbte.alpslib.utils.GeneratorUtils; import lombok.Getter; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.generator.model.GeneratorCollections; -import net.buildtheearth.modules.generator.model.GeneratorComponent; -import net.buildtheearth.modules.generator.model.GeneratorType; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorCollections; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorComponent; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorType; import org.bukkit.Bukkit; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeFlag.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeFlag.java similarity index 74% rename from src/main/java/net/buildtheearth/modules/generator/components/tree/TreeFlag.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeFlag.java index 85fd4de9..e23308bc 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeFlag.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeFlag.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.generator.components.tree; +package net.buildtheearth.buildteamtools.modules.generator.components.tree; import lombok.Getter; -import net.buildtheearth.modules.generator.model.Flag; -import net.buildtheearth.modules.generator.model.FlagType; +import net.buildtheearth.buildteamtools.modules.generator.model.Flag; +import net.buildtheearth.buildteamtools.modules.generator.model.FlagType; import org.jspecify.annotations.Nullable; public enum TreeFlag implements Flag { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeScripts.java similarity index 92% rename from src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeScripts.java index 02307a5d..143a1c8c 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeScripts.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeScripts.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.generator.components.tree; +package net.buildtheearth.buildteamtools.modules.generator.components.tree; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; import org.bukkit.Material; import org.bukkit.entity.Player; import org.jspecify.annotations.NonNull; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeSettings.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeSettings.java similarity index 66% rename from src/main/java/net/buildtheearth/modules/generator/components/tree/TreeSettings.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeSettings.java index d751d0b5..dcf183e9 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeSettings.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeSettings.java @@ -1,7 +1,7 @@ -package net.buildtheearth.modules.generator.components.tree; +package net.buildtheearth.buildteamtools.modules.generator.components.tree; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.modules.generator.components.road.RoadFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadFlag; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; import org.bukkit.entity.Player; public class TreeSettings extends Settings { diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeType.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeType.java similarity index 94% rename from src/main/java/net/buildtheearth/modules/generator/components/tree/TreeType.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeType.java index 1e0379ad..31d88fc3 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeType.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeType.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.components.tree; +package net.buildtheearth.buildteamtools.modules.generator.components.tree; import lombok.Getter; import org.jspecify.annotations.Nullable; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeWidth.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeWidth.java similarity index 87% rename from src/main/java/net/buildtheearth/modules/generator/components/tree/TreeWidth.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeWidth.java index af1eb7e3..3b958fe8 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/TreeWidth.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeWidth.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.components.tree; +package net.buildtheearth.buildteamtools.modules.generator.components.tree; import lombok.Getter; import org.jspecify.annotations.Nullable; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeHeightMenu.java similarity index 81% rename from src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeHeightMenu.java index 993a7b4a..1683d870 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeHeightMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeHeightMenu.java @@ -1,12 +1,12 @@ -package net.buildtheearth.modules.generator.components.tree.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.tree.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.tree.TreeFlag; -import net.buildtheearth.modules.generator.components.tree.TreeSettings; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.menus.NameListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeSettings; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.menus.NameListMenu; import net.daporkchop.lib.common.misc.Tuple; import org.apache.commons.lang3.StringUtils; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeTypeMenu.java similarity index 76% rename from src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeTypeMenu.java index bab6c688..d2de1d4a 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeTypeMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeTypeMenu.java @@ -1,14 +1,14 @@ -package net.buildtheearth.modules.generator.components.tree.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.tree.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.tree.TreeFlag; -import net.buildtheearth.modules.generator.components.tree.TreeSettings; -import net.buildtheearth.modules.generator.components.tree.TreeType; -import net.buildtheearth.modules.generator.menu.GeneratorMenu; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.menus.NameListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeType; +import net.buildtheearth.buildteamtools.modules.generator.menu.GeneratorMenu; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.menus.NameListMenu; import net.daporkchop.lib.common.misc.Tuple; import org.apache.commons.lang3.StringUtils; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeWidthMenu.java similarity index 78% rename from src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeWidthMenu.java index 84a4f7bd..a8fb57a4 100644 --- a/src/main/java/net/buildtheearth/modules/generator/components/tree/menu/TreeWidthMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeWidthMenu.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.generator.components.tree.menu; +package net.buildtheearth.buildteamtools.modules.generator.components.tree.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.tree.TreeFlag; -import net.buildtheearth.modules.generator.components.tree.TreeSettings; -import net.buildtheearth.modules.generator.components.tree.TreeWidth; -import net.buildtheearth.modules.generator.model.Settings; -import net.buildtheearth.utils.menus.NameListMenu; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeWidth; +import net.buildtheearth.buildteamtools.modules.generator.model.Settings; +import net.buildtheearth.buildteamtools.utils.menus.NameListMenu; import net.daporkchop.lib.common.misc.Tuple; import org.apache.commons.lang3.StringUtils; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/listeners/GeneratorListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/listeners/GeneratorListener.java similarity index 90% rename from src/main/java/net/buildtheearth/modules/generator/listeners/GeneratorListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/listeners/GeneratorListener.java index 8ac94cf4..1d4523ae 100644 --- a/src/main/java/net/buildtheearth/modules/generator/listeners/GeneratorListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/listeners/GeneratorListener.java @@ -1,7 +1,7 @@ -package net.buildtheearth.modules.generator.listeners; +package net.buildtheearth.buildteamtools.modules.generator.listeners; import com.alpsbte.alpslib.utils.ChatHelper; -import net.buildtheearth.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java similarity index 87% rename from src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java index b3fc563d..ef738425 100644 --- a/src/main/java/net/buildtheearth/modules/generator/menu/GeneratorMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java @@ -1,24 +1,24 @@ -package net.buildtheearth.modules.generator.menu; +package net.buildtheearth.buildteamtools.modules.generator.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.generator.GeneratorModule; -import net.buildtheearth.modules.generator.components.house.House; -import net.buildtheearth.modules.generator.components.house.HouseSettings; -import net.buildtheearth.modules.generator.components.house.RoofType; -import net.buildtheearth.modules.generator.components.house.menu.WallColorMenu; -import net.buildtheearth.modules.generator.components.road.Road; -import net.buildtheearth.modules.generator.components.road.RoadSettings; -import net.buildtheearth.modules.generator.components.road.menu.RoadColorMenu; -import net.buildtheearth.modules.generator.components.tree.Tree; -import net.buildtheearth.modules.generator.components.tree.TreeSettings; -import net.buildtheearth.modules.generator.components.tree.menu.TreeTypeMenu; -import net.buildtheearth.modules.generator.model.GeneratorCollections; -import net.buildtheearth.modules.generator.model.GeneratorType; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.modules.common.CommonModule; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.components.house.House; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.house.RoofType; +import net.buildtheearth.buildteamtools.modules.generator.components.house.menu.WallColorMenu; +import net.buildtheearth.buildteamtools.modules.generator.components.road.Road; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.road.menu.RoadColorMenu; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.Tree; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.menu.TreeTypeMenu; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorCollections; +import net.buildtheearth.buildteamtools.modules.generator.model.GeneratorType; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Command.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Command.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/generator/model/Command.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Command.java index 24136664..4ac228fd 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Command.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Command.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.GeneratorUtils; @@ -11,8 +11,8 @@ import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import lombok.Getter; -import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.utils.MenuItems; +import net.buildtheearth.buildteamtools.modules.common.CommonModule; +import net.buildtheearth.buildteamtools.utils.MenuItems; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Flag.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Flag.java similarity index 54% rename from src/main/java/net/buildtheearth/modules/generator/model/Flag.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Flag.java index d49d80d1..c95f7177 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Flag.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Flag.java @@ -1,10 +1,10 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; -import net.buildtheearth.modules.generator.components.field.FieldFlag; -import net.buildtheearth.modules.generator.components.house.HouseFlag; -import net.buildtheearth.modules.generator.components.rail.RailFlag; -import net.buildtheearth.modules.generator.components.road.RoadFlag; -import net.buildtheearth.modules.generator.components.tree.TreeFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.field.FieldFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.rail.RailFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadFlag; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeFlag; import org.jspecify.annotations.NonNull; public interface Flag { diff --git a/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/FlagType.java similarity index 85% rename from src/main/java/net/buildtheearth/modules/generator/model/FlagType.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/FlagType.java index 500aaeb2..ed9dc8dd 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/FlagType.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/FlagType.java @@ -1,14 +1,14 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import lombok.Getter; -import net.buildtheearth.modules.generator.components.field.CropStage; -import net.buildtheearth.modules.generator.components.field.CropType; -import net.buildtheearth.modules.generator.components.house.RoofType; -import net.buildtheearth.modules.generator.components.tree.TreeType; -import net.buildtheearth.modules.generator.components.tree.TreeWidth; +import net.buildtheearth.buildteamtools.modules.generator.components.field.CropStage; +import net.buildtheearth.buildteamtools.modules.generator.components.field.CropType; +import net.buildtheearth.buildteamtools.modules.generator.components.house.RoofType; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeType; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeWidth; public enum FlagType { diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorCollections.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorCollections.java index 4b183d15..fb9c3924 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorCollections.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorCollections.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; import com.alpsbte.alpslib.utils.ChatHelper; import com.fastasyncworldedit.core.FaweAPI; @@ -8,8 +8,8 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; import lombok.experimental.UtilityClass; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.common.CommonModule; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.common.CommonModule; import org.bukkit.Bukkit; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorComponent.java similarity index 90% rename from src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorComponent.java index 00e8a622..67f41622 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorComponent.java @@ -1,15 +1,15 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; import com.alpsbte.alpslib.utils.GeneratorUtils; import com.alpsbte.alpslib.utils.WikiDocumented; import lombok.Getter; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.ModuleComponent; -import net.buildtheearth.modules.generator.components.field.FieldSettings; -import net.buildtheearth.modules.generator.components.house.HouseSettings; -import net.buildtheearth.modules.generator.components.rail.RailSettings; -import net.buildtheearth.modules.generator.components.road.RoadSettings; -import net.buildtheearth.modules.generator.components.tree.TreeSettings; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.modules.generator.components.field.FieldSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.rail.RailSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadSettings; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeSettings; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.event.ClickEvent; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorType.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorType.java similarity index 79% rename from src/main/java/net/buildtheearth/modules/generator/model/GeneratorType.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorType.java index 1e00d64b..53b53551 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/GeneratorType.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorType.java @@ -1,7 +1,7 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; import lombok.Getter; -import net.buildtheearth.utils.WikiLinks; +import net.buildtheearth.buildteamtools.utils.WikiLinks; public enum GeneratorType { diff --git a/src/main/java/net/buildtheearth/modules/generator/model/History.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/History.java similarity index 97% rename from src/main/java/net/buildtheearth/modules/generator/model/History.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/History.java index 94d66932..02e8473f 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/History.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/History.java @@ -1,11 +1,11 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.GeneratorUtils; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; import lombok.Getter; -import net.buildtheearth.BuildTeamTools; +import net.buildtheearth.buildteamtools.BuildTeamTools; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.HoverEvent; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Operation.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Operation.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/generator/model/Operation.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Operation.java index 6fdddc1d..0d230139 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Operation.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Operation.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; import com.sk89q.worldedit.world.block.BlockState; import lombok.Getter; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Script.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Script.java similarity index 99% rename from src/main/java/net/buildtheearth/modules/generator/model/Script.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Script.java index 8639c5d9..0a5dc7a0 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Script.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Script.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; import com.alpsbte.alpslib.utils.GeneratorUtils; import com.cryptomorin.xseries.XMaterial; @@ -13,7 +13,7 @@ import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import lombok.Getter; -import net.buildtheearth.modules.generator.GeneratorModule; +import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/generator/model/Settings.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Settings.java similarity index 88% rename from src/main/java/net/buildtheearth/modules/generator/model/Settings.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Settings.java index 4c0c8ff4..7bed4c57 100644 --- a/src/main/java/net/buildtheearth/modules/generator/model/Settings.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Settings.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.generator.model; +package net.buildtheearth.buildteamtools.modules.generator.model; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import lombok.Getter; import lombok.Setter; -import net.buildtheearth.modules.generator.components.field.CropStage; -import net.buildtheearth.modules.generator.components.field.CropType; -import net.buildtheearth.modules.generator.components.house.RoofType; -import net.buildtheearth.modules.generator.components.tree.TreeWidth; +import net.buildtheearth.buildteamtools.modules.generator.components.field.CropStage; +import net.buildtheearth.buildteamtools.modules.generator.components.field.CropType; +import net.buildtheearth.buildteamtools.modules.generator.components.house.RoofType; +import net.buildtheearth.buildteamtools.modules.generator.components.tree.TreeWidth; import org.bukkit.block.Block; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/MiscModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/MiscModule.java similarity index 85% rename from src/main/java/net/buildtheearth/modules/miscellaneous/MiscModule.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/MiscModule.java index 4c7b77b1..c24b9136 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/MiscModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/MiscModule.java @@ -1,10 +1,10 @@ -package net.buildtheearth.modules.miscellaneous; +package net.buildtheearth.buildteamtools.modules.miscellaneous; -import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.miscellaneous.blockpalettegui.BlockPaletteCommand; -import net.buildtheearth.modules.miscellaneous.blockpalettegui.BlockPaletteGUI; -import net.buildtheearth.modules.miscellaneous.blockpalettegui.BlockPaletteManager; -import net.buildtheearth.utils.WikiLinks; +import net.buildtheearth.buildteamtools.modules.Module; +import net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui.BlockPaletteCommand; +import net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui.BlockPaletteGUI; +import net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui.BlockPaletteManager; +import net.buildtheearth.buildteamtools.utils.WikiLinks; import org.bukkit.command.CommandExecutor; import org.bukkit.command.PluginCommand; import org.bukkit.command.TabCompleter; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteCommand.java similarity index 97% rename from src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteCommand.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteCommand.java index b8b9632a..b94edbc6 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteCommand.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteCommand.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.miscellaneous.blockpalettegui; +package net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteGUI.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteGUI.java similarity index 83% rename from src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteGUI.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteGUI.java index 5236b432..305eae06 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteGUI.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteGUI.java @@ -1,6 +1,6 @@ -package net.buildtheearth.modules.miscellaneous.blockpalettegui; +package net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui; -import net.buildtheearth.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; import org.bukkit.plugin.java.JavaPlugin; public class BlockPaletteGUI extends ModuleComponent { diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java similarity index 99% rename from src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java index 704e038e..ccce387e 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java @@ -1,15 +1,15 @@ -package net.buildtheearth.modules.miscellaneous.blockpalettegui; +package net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui; import com.cryptomorin.xseries.XMaterial; +import lombok.Getter; +import lombok.Setter; import org.bukkit.Material; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; -import lombok.Getter; -import lombok.Setter; import java.io.File; import java.io.IOException; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteMenuType.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteMenuType.java similarity index 92% rename from src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteMenuType.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteMenuType.java index d799338d..a84281b6 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/BlockPaletteMenuType.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteMenuType.java @@ -1,14 +1,10 @@ -package net.buildtheearth.modules.miscellaneous.blockpalettegui; +package net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui; -import net.buildtheearth.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.MenuItems; import org.bukkit.inventory.ItemStack; -import java.util.HashMap; -import java.util.Map; +import java.util.*; import java.util.function.Supplier; -import java.util.List; -import java.util.Arrays; -import java.util.Collections; import java.util.stream.Collectors; public enum BlockPaletteMenuType { diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java index f5751b53..0ebc9542 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.miscellaneous.blockpalettegui; +package net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.menus.AbstractPaginatedMenu; +import net.buildtheearth.buildteamtools.utils.menus.AbstractPaginatedMenu; import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.enchantments.Enchantment; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java index 8176f581..9026673d 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.miscellaneous.blockpalettegui; +package net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java index a26c6369..64a2ccbe 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.miscellaneous.blockpalettegui; +package net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java similarity index 98% rename from src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java index eb7f8404..5fd56f0e 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.miscellaneous.blockpalettegui; +package net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java similarity index 96% rename from src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java index da0475ac..d66c4b75 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules.miscellaneous.blockpalettegui; +package net.buildtheearth.buildteamtools.modules.miscellaneous.blockpalettegui; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractPaginatedMenu; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractPaginatedMenu; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/main/java/net/buildtheearth/modules/miscellaneous/signtextgenerator/SignTextGenerator.java b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/signtextgenerator/SignTextGenerator.java similarity index 72% rename from src/main/java/net/buildtheearth/modules/miscellaneous/signtextgenerator/SignTextGenerator.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/signtextgenerator/SignTextGenerator.java index e10cd54c..ee93e0b3 100644 --- a/src/main/java/net/buildtheearth/modules/miscellaneous/signtextgenerator/SignTextGenerator.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/signtextgenerator/SignTextGenerator.java @@ -1,6 +1,6 @@ -package net.buildtheearth.modules.miscellaneous.signtextgenerator; +package net.buildtheearth.buildteamtools.modules.miscellaneous.signtextgenerator; -import net.buildtheearth.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; public class SignTextGenerator extends ModuleComponent { diff --git a/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/navigation/NavUtils.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java index fd1b2f25..83c575c8 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/NavUtils.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.navigation; +package net.buildtheearth.buildteamtools.modules.navigation; import com.alpsbte.alpslib.utils.ChatHelper; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import lombok.experimental.UtilityClass; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ComponentBuilder; import net.md_5.bungee.api.chat.HoverEvent; diff --git a/src/main/java/net/buildtheearth/modules/navigation/NavigationModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavigationModule.java similarity index 52% rename from src/main/java/net/buildtheearth/modules/navigation/NavigationModule.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavigationModule.java index 79f8f36b..d63c5e21 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/NavigationModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavigationModule.java @@ -1,21 +1,21 @@ -package net.buildtheearth.modules.navigation; +package net.buildtheearth.buildteamtools.modules.navigation; import lombok.Getter; -import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.navigation.components.navigator.NavigatorComponent; -import net.buildtheearth.modules.navigation.components.navigator.commands.BuildteamCommand; -import net.buildtheearth.modules.navigation.components.navigator.commands.NavigatorCommand; -import net.buildtheearth.modules.navigation.components.navigator.listeners.NavigatorJoinListener; -import net.buildtheearth.modules.navigation.components.navigator.listeners.NavigatorOpenListener; -import net.buildtheearth.modules.navigation.components.tpll.TpllComponent; -import net.buildtheearth.modules.navigation.components.tpll.listeners.TpllJoinListener; -import net.buildtheearth.modules.navigation.components.tpll.listeners.TpllListener; -import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; -import net.buildtheearth.modules.navigation.components.warps.commands.WarpCommand; -import net.buildtheearth.modules.navigation.components.warps.commands.WarpsBtCommand; -import net.buildtheearth.modules.navigation.components.warps.listeners.WarpJoinListener; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.utils.WikiLinks; +import net.buildtheearth.buildteamtools.modules.Module; +import net.buildtheearth.buildteamtools.modules.navigation.components.navigator.NavigatorComponent; +import net.buildtheearth.buildteamtools.modules.navigation.components.navigator.commands.BuildteamCommand; +import net.buildtheearth.buildteamtools.modules.navigation.components.navigator.commands.NavigatorCommand; +import net.buildtheearth.buildteamtools.modules.navigation.components.navigator.listeners.NavigatorJoinListener; +import net.buildtheearth.buildteamtools.modules.navigation.components.navigator.listeners.NavigatorOpenListener; +import net.buildtheearth.buildteamtools.modules.navigation.components.tpll.TpllComponent; +import net.buildtheearth.buildteamtools.modules.navigation.components.tpll.listeners.TpllJoinListener; +import net.buildtheearth.buildteamtools.modules.navigation.components.tpll.listeners.TpllListener; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.WarpsComponent; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.commands.WarpCommand; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.commands.WarpsBtCommand; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.listeners.WarpJoinListener; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.utils.WikiLinks; /** * Manages all things related to universal tpll diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/NavigatorComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/NavigatorComponent.java similarity index 87% rename from src/main/java/net/buildtheearth/modules/navigation/components/navigator/NavigatorComponent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/NavigatorComponent.java index 272f65ab..f65d0179 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/NavigatorComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/NavigatorComponent.java @@ -1,14 +1,14 @@ -package net.buildtheearth.modules.navigation.components.navigator; +package net.buildtheearth.buildteamtools.modules.navigation.components.navigator; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; import com.sk89q.worldedit.WorldEdit; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.ModuleComponent; -import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.utils.io.ConfigPaths; -import net.buildtheearth.utils.io.ConfigUtil; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.modules.common.CommonModule; +import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; +import net.buildtheearth.buildteamtools.utils.io.ConfigUtil; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/BuildteamCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/commands/BuildteamCommand.java similarity index 87% rename from src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/BuildteamCommand.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/commands/BuildteamCommand.java index 7716901f..6ec563e6 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/BuildteamCommand.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/commands/BuildteamCommand.java @@ -1,10 +1,10 @@ -package net.buildtheearth.modules.navigation.components.navigator.commands; +package net.buildtheearth.buildteamtools.modules.navigation.components.navigator.commands; import com.alpsbte.alpslib.utils.ChatHelper; -import net.buildtheearth.modules.navigation.NavUtils; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/NavigatorCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/commands/NavigatorCommand.java similarity index 78% rename from src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/NavigatorCommand.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/commands/NavigatorCommand.java index 03063c43..f1dbe38c 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/commands/NavigatorCommand.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/commands/NavigatorCommand.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules.navigation.components.navigator.commands; +package net.buildtheearth.buildteamtools.modules.navigation.components.navigator.commands; import com.alpsbte.alpslib.utils.ChatHelper; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.modules.navigation.menu.MainMenu; -import net.buildtheearth.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.navigation.menu.MainMenu; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/listeners/NavigatorJoinListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/listeners/NavigatorJoinListener.java similarity index 67% rename from src/main/java/net/buildtheearth/modules/navigation/components/navigator/listeners/NavigatorJoinListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/listeners/NavigatorJoinListener.java index 6638b371..5afda224 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/listeners/NavigatorJoinListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/listeners/NavigatorJoinListener.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules.navigation.components.navigator.listeners; +package net.buildtheearth.buildteamtools.modules.navigation.components.navigator.listeners; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.utils.io.ConfigPaths; -import net.buildtheearth.utils.io.ConfigUtil; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; +import net.buildtheearth.buildteamtools.utils.io.ConfigUtil; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/listeners/NavigatorOpenListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/listeners/NavigatorOpenListener.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/navigation/components/navigator/listeners/NavigatorOpenListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/listeners/NavigatorOpenListener.java index 70880293..c564a8e6 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/navigator/listeners/NavigatorOpenListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/listeners/NavigatorOpenListener.java @@ -1,7 +1,7 @@ -package net.buildtheearth.modules.navigation.components.navigator.listeners; +package net.buildtheearth.buildteamtools.modules.navigation.components.navigator.listeners; -import net.buildtheearth.modules.navigation.menu.MainMenu; -import net.buildtheearth.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.navigation.menu.MainMenu; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/TpllComponent.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/TpllComponent.java index 24a6b51b..ddd1bac9 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/TpllComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/TpllComponent.java @@ -1,14 +1,14 @@ -package net.buildtheearth.modules.navigation.components.tpll; +package net.buildtheearth.buildteamtools.modules.navigation.components.tpll; import com.alpsbte.alpslib.utils.ChatHelper; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.ModuleComponent; -import net.buildtheearth.modules.navigation.NavUtils; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.utils.GeometricUtils; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.utils.GeometricUtils; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.NamespacedKey; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllJoinListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/listeners/TpllJoinListener.java similarity index 80% rename from src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllJoinListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/listeners/TpllJoinListener.java index 9483e89f..8750abb3 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllJoinListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/listeners/TpllJoinListener.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.navigation.components.tpll.listeners; +package net.buildtheearth.buildteamtools.modules.navigation.components.tpll.listeners; import com.alpsbte.alpslib.utils.ChatHelper; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.modules.navigation.components.tpll.TpllComponent; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.navigation.components.tpll.TpllComponent; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/listeners/TpllListener.java similarity index 90% rename from src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/listeners/TpllListener.java index 837ada94..b3f967c5 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/tpll/listeners/TpllListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/listeners/TpllListener.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.navigation.components.tpll.listeners; +package net.buildtheearth.buildteamtools.modules.navigation.components.tpll.listeners; import com.alpsbte.alpslib.utils.AlpsUtils; import com.alpsbte.alpslib.utils.ChatHelper; -import net.buildtheearth.modules.navigation.NavUtils; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.api.OpenStreetMapAPI; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.modules.network.model.Region; +import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.api.OpenStreetMapAPI; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.modules.network.model.Region; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerCommandPreprocessEvent; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java similarity index 88% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java index b7224a9f..43cc4da5 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/WarpsComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java @@ -1,24 +1,24 @@ -package net.buildtheearth.modules.navigation.components.warps; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps; import com.alpsbte.alpslib.utils.ChatHelper; import com.google.common.io.ByteArrayDataInput; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.ModuleComponent; -import net.buildtheearth.modules.navigation.NavUtils; -import net.buildtheearth.modules.navigation.components.warps.menu.WarpEditMenu; -import net.buildtheearth.modules.navigation.components.warps.menu.WarpGroupEditMenu; -import net.buildtheearth.modules.navigation.components.warps.menu.WarpGroupMenu; -import net.buildtheearth.modules.navigation.components.warps.menu.WarpMenu; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.api.OpenStreetMapAPI; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.utils.GeometricUtils; -import net.buildtheearth.utils.geo.CoordinateConversion; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.ModuleComponent; +import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu.WarpEditMenu; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu.WarpGroupEditMenu; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu.WarpGroupMenu; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu.WarpMenu; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.api.OpenStreetMapAPI; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.utils.GeometricUtils; +import net.buildtheearth.buildteamtools.utils.geo.CoordinateConversion; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.NamespacedKey; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/commands/WarpCommand.java similarity index 88% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpCommand.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/commands/WarpCommand.java index 1da940c4..37938a69 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpCommand.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/commands/WarpCommand.java @@ -1,11 +1,11 @@ -package net.buildtheearth.modules.navigation.components.warps.commands; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.commands; import com.alpsbte.alpslib.utils.ChatHelper; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.WarpsComponent; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpsBtCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/commands/WarpsBtCommand.java similarity index 61% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpsBtCommand.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/commands/WarpsBtCommand.java index e7336706..fb5648bb 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/commands/WarpsBtCommand.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/commands/WarpsBtCommand.java @@ -1,9 +1,9 @@ -package net.buildtheearth.modules.navigation.components.warps.commands; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.commands; -import net.buildtheearth.modules.navigation.components.navigator.commands.BuildteamCommand; -import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.modules.navigation.components.navigator.commands.BuildteamCommand; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.WarpsComponent; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/listeners/WarpJoinListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/listeners/WarpJoinListener.java similarity index 81% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/listeners/WarpJoinListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/listeners/WarpJoinListener.java index b140de92..a054afcf 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/listeners/WarpJoinListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/listeners/WarpJoinListener.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.navigation.components.warps.listeners; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.listeners; import com.alpsbte.alpslib.utils.ChatHelper; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.WarpsComponent; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java index d17b9a5e..9cb831ba 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java @@ -1,13 +1,13 @@ -package net.buildtheearth.modules.navigation.components.warps.menu; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.Utils; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.Utils; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import net.wesjd.anvilgui.AnvilGUI; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/MaterialSelectionMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java similarity index 92% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/MaterialSelectionMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java index bfed7047..9e45e8f2 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/MaterialSelectionMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java @@ -1,16 +1,16 @@ -package net.buildtheearth.modules.navigation.components.warps.menu; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractMenu; -import net.buildtheearth.utils.menus.BookMenu; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.utils.menus.BookMenu; import net.wesjd.anvilgui.AnvilGUI; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpEditMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java index 4e52875f..7f5de25c 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpEditMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java @@ -1,18 +1,18 @@ -package net.buildtheearth.modules.navigation.components.warps.menu; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.api.OpenStreetMapAPI; -import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.geo.CoordinateConversion; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.api.OpenStreetMapAPI; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.geo.CoordinateConversion; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import net.wesjd.anvilgui.AnvilGUI; import org.bukkit.Location; import org.bukkit.Sound; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupEditMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java index fc2707f5..b2ba0a6a 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupEditMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java @@ -1,18 +1,18 @@ -package net.buildtheearth.modules.navigation.components.warps.menu; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu; import com.alpsbte.alpslib.utils.AlpsUtils; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractMenu; -import net.buildtheearth.utils.menus.BookMenu; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.utils.menus.BookMenu; import net.wesjd.anvilgui.AnvilGUI; import org.bukkit.Sound; import org.bukkit.entity.Player; @@ -24,7 +24,7 @@ import java.util.Collections; import java.util.List; -import static net.buildtheearth.modules.navigation.components.warps.menu.WarpEditMenu.CONFIRM_SLOT; +import static net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu.WarpEditMenu.CONFIRM_SLOT; public class WarpGroupEditMenu extends AbstractMenu { diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java similarity index 90% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java index b4f44a8b..a40f7b79 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java @@ -1,21 +1,21 @@ -package net.buildtheearth.modules.navigation.components.warps.menu; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import com.google.gson.Gson; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.io.ConfigPaths; -import net.buildtheearth.utils.io.ConfigUtil; -import net.buildtheearth.utils.menus.AbstractMenu; -import net.buildtheearth.utils.menus.AbstractPaginatedMenu; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; +import net.buildtheearth.buildteamtools.utils.io.ConfigUtil; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.utils.menus.AbstractPaginatedMenu; import org.bukkit.entity.Player; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java similarity index 82% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java index 70df51eb..25ca84a1 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.navigation.components.warps.menu; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java similarity index 85% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java index b35247ef..8b5d85bd 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/menu/WarpMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java @@ -1,15 +1,15 @@ -package net.buildtheearth.modules.navigation.components.warps.menu; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.modules.navigation.NavigationModule; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractPaginatedMenu; +import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractPaginatedMenu; import org.bukkit.entity.Player; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/Warp.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java similarity index 94% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/model/Warp.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java index 3eb5bd0b..456753c6 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/Warp.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java @@ -1,12 +1,12 @@ -package net.buildtheearth.modules.navigation.components.warps.model; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.model; import com.alpsbte.alpslib.utils.item.Item; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.Utils; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.Utils; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.json.JSONObject; diff --git a/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/WarpGroup.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java similarity index 91% rename from src/main/java/net/buildtheearth/modules/navigation/components/warps/model/WarpGroup.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java index 6499973e..833a9f48 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/components/warps/model/WarpGroup.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java @@ -1,11 +1,11 @@ -package net.buildtheearth.modules.navigation.components.warps.model; +package net.buildtheearth.buildteamtools.modules.navigation.components.warps.model; import com.alpsbte.alpslib.utils.item.Item; import lombok.Getter; import lombok.Setter; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.ListUtil; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.ListUtil; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.json.JSONObject; diff --git a/src/main/java/net/buildtheearth/modules/navigation/menu/CountrySelectorMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/CountrySelectorMenu.java similarity index 88% rename from src/main/java/net/buildtheearth/modules/navigation/menu/CountrySelectorMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/CountrySelectorMenu.java index 868abbaa..cbde5bfe 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/menu/CountrySelectorMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/CountrySelectorMenu.java @@ -1,18 +1,18 @@ -package net.buildtheearth.modules.navigation.menu; +package net.buildtheearth.buildteamtools.modules.navigation.menu; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import lombok.NonNull; -import net.buildtheearth.modules.navigation.NavUtils; -import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.modules.network.model.Continent; -import net.buildtheearth.modules.network.model.Permissions; -import net.buildtheearth.modules.network.model.Region; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractPaginatedMenu; +import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.WarpsComponent; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.modules.network.model.Continent; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; +import net.buildtheearth.buildteamtools.modules.network.model.Region; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractPaginatedMenu; import org.bukkit.entity.Player; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; diff --git a/src/main/java/net/buildtheearth/modules/navigation/menu/ExploreMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/ExploreMenu.java similarity index 90% rename from src/main/java/net/buildtheearth/modules/navigation/menu/ExploreMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/ExploreMenu.java index c29be7fc..3b3690f7 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/menu/ExploreMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/ExploreMenu.java @@ -1,12 +1,12 @@ -package net.buildtheearth.modules.navigation.menu; +package net.buildtheearth.buildteamtools.modules.navigation.menu; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.network.model.Continent; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.modules.network.model.Continent; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.entity.Player; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; diff --git a/src/main/java/net/buildtheearth/modules/navigation/menu/MainMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/MainMenu.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/navigation/menu/MainMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/MainMenu.java index db12d2eb..cf433250 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/menu/MainMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/MainMenu.java @@ -1,16 +1,16 @@ -package net.buildtheearth.modules.navigation.menu; +package net.buildtheearth.buildteamtools.modules.navigation.menu; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.navigation.NavUtils; -import net.buildtheearth.modules.navigation.components.warps.WarpsComponent; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.io.ConfigPaths; -import net.buildtheearth.utils.io.ConfigUtil; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.WarpsComponent; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; +import net.buildtheearth.buildteamtools.utils.io.ConfigUtil; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import net.kyori.adventure.text.format.NamedTextColor; import org.apache.commons.lang3.BooleanUtils; import org.bukkit.configuration.file.FileConfiguration; diff --git a/src/main/java/net/buildtheearth/modules/navigation/menu/StateSelectorMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/StateSelectorMenu.java similarity index 90% rename from src/main/java/net/buildtheearth/modules/navigation/menu/StateSelectorMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/StateSelectorMenu.java index 6f4bf270..c9a59567 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/menu/StateSelectorMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/StateSelectorMenu.java @@ -1,15 +1,15 @@ -package net.buildtheearth.modules.navigation.menu; +package net.buildtheearth.buildteamtools.modules.navigation.menu; import com.alpsbte.alpslib.utils.ChatHelper; import com.alpsbte.alpslib.utils.item.Item; import lombok.NonNull; -import net.buildtheearth.modules.navigation.NavUtils; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.Region; -import net.buildtheearth.modules.network.model.RegionType; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractPaginatedMenu; +import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.Region; +import net.buildtheearth.buildteamtools.modules.network.model.RegionType; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractPaginatedMenu; import org.bukkit.entity.Player; import org.ipvp.canvas.mask.BinaryMask; import org.ipvp.canvas.mask.Mask; diff --git a/src/main/java/net/buildtheearth/modules/navigation/menu/TutorialsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/TutorialsMenu.java similarity index 87% rename from src/main/java/net/buildtheearth/modules/navigation/menu/TutorialsMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/TutorialsMenu.java index 4c4a3c15..e58ed572 100644 --- a/src/main/java/net/buildtheearth/modules/navigation/menu/TutorialsMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/TutorialsMenu.java @@ -1,6 +1,6 @@ -package net.buildtheearth.modules.navigation.menu; +package net.buildtheearth.buildteamtools.modules.navigation.menu; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.entity.Player; import org.ipvp.canvas.mask.Mask; diff --git a/src/main/java/net/buildtheearth/modules/network/NetworkModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java similarity index 87% rename from src/main/java/net/buildtheearth/modules/network/NetworkModule.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java index ac75a8a4..7f5f78a4 100644 --- a/src/main/java/net/buildtheearth/modules/network/NetworkModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java @@ -1,21 +1,21 @@ -package net.buildtheearth.modules.network; +package net.buildtheearth.buildteamtools.modules.network; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import lombok.Getter; import lombok.Setter; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.network.api.NetworkAPI; -import net.buildtheearth.modules.network.listeners.NetworkJoinListener; -import net.buildtheearth.modules.network.listeners.NetworkQuitListener; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.modules.network.model.Region; -import net.buildtheearth.modules.network.model.RegionType; -import net.buildtheearth.utils.WikiLinks; -import net.buildtheearth.utils.io.ConfigPaths; -import net.buildtheearth.utils.io.Constants; -import net.buildtheearth.utils.io.Errors; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.Module; +import net.buildtheearth.buildteamtools.modules.network.api.NetworkAPI; +import net.buildtheearth.buildteamtools.modules.network.listeners.NetworkJoinListener; +import net.buildtheearth.buildteamtools.modules.network.listeners.NetworkQuitListener; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.modules.network.model.Region; +import net.buildtheearth.buildteamtools.modules.network.model.RegionType; +import net.buildtheearth.buildteamtools.utils.WikiLinks; +import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; +import net.buildtheearth.buildteamtools.utils.io.Constants; +import net.buildtheearth.buildteamtools.utils.io.Errors; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/net/buildtheearth/modules/network/api/API.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/api/API.java similarity index 97% rename from src/main/java/net/buildtheearth/modules/network/api/API.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/api/API.java index 00b688e7..326cf005 100644 --- a/src/main/java/net/buildtheearth/modules/network/api/API.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/api/API.java @@ -1,12 +1,7 @@ -package net.buildtheearth.modules.network.api; - -import net.buildtheearth.BuildTeamTools; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; +package net.buildtheearth.buildteamtools.modules.network.api; + +import net.buildtheearth.buildteamtools.BuildTeamTools; +import okhttp3.*; import okio.Buffer; import org.jetbrains.annotations.NotNull; import org.json.simple.JSONArray; diff --git a/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/api/NetworkAPI.java similarity index 96% rename from src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/api/NetworkAPI.java index 14e37dcf..35c6e7b8 100644 --- a/src/main/java/net/buildtheearth/modules/network/api/NetworkAPI.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/api/NetworkAPI.java @@ -1,17 +1,17 @@ -package net.buildtheearth.modules.network.api; +package net.buildtheearth.buildteamtools.modules.network.api; import com.alpsbte.alpslib.utils.ChatHelper; import lombok.experimental.UtilityClass; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.navigation.NavUtils; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.model.BuildTeam; -import net.buildtheearth.modules.network.model.Continent; -import net.buildtheearth.modules.network.model.Region; -import net.buildtheearth.modules.network.model.RegionType; -import net.buildtheearth.utils.io.ConfigPaths; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; +import net.buildtheearth.buildteamtools.modules.network.model.Continent; +import net.buildtheearth.buildteamtools.modules.network.model.Region; +import net.buildtheearth.buildteamtools.modules.network.model.RegionType; +import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; import okhttp3.MediaType; import okhttp3.RequestBody; import org.bukkit.Bukkit; diff --git a/src/main/java/net/buildtheearth/modules/network/api/OpenStreetMapAPI.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/api/OpenStreetMapAPI.java similarity index 96% rename from src/main/java/net/buildtheearth/modules/network/api/OpenStreetMapAPI.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/api/OpenStreetMapAPI.java index b9406963..92d7993e 100644 --- a/src/main/java/net/buildtheearth/modules/network/api/OpenStreetMapAPI.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/api/OpenStreetMapAPI.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.network.api; +package net.buildtheearth.buildteamtools.modules.network.api; import com.alpsbte.alpslib.utils.ChatHelper; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/net/buildtheearth/modules/network/listeners/NetworkJoinListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/listeners/NetworkJoinListener.java similarity index 71% rename from src/main/java/net/buildtheearth/modules/network/listeners/NetworkJoinListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/listeners/NetworkJoinListener.java index b60a6c47..2a1b7d82 100644 --- a/src/main/java/net/buildtheearth/modules/network/listeners/NetworkJoinListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/listeners/NetworkJoinListener.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.network.listeners; +package net.buildtheearth.buildteamtools.modules.network.listeners; -import net.buildtheearth.modules.common.CommonModule; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.api.NetworkAPI; +import net.buildtheearth.buildteamtools.modules.common.CommonModule; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.api.NetworkAPI; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/main/java/net/buildtheearth/modules/network/listeners/NetworkQuitListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/listeners/NetworkQuitListener.java similarity index 69% rename from src/main/java/net/buildtheearth/modules/network/listeners/NetworkQuitListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/listeners/NetworkQuitListener.java index 00735bd7..9a48777f 100644 --- a/src/main/java/net/buildtheearth/modules/network/listeners/NetworkQuitListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/listeners/NetworkQuitListener.java @@ -1,7 +1,7 @@ -package net.buildtheearth.modules.network.listeners; +package net.buildtheearth.buildteamtools.modules.network.listeners; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.api.NetworkAPI; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.api.NetworkAPI; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/main/java/net/buildtheearth/modules/network/model/BuildTeam.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/BuildTeam.java similarity index 94% rename from src/main/java/net/buildtheearth/modules/network/model/BuildTeam.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/model/BuildTeam.java index 825b6f8e..7f5dddf4 100644 --- a/src/main/java/net/buildtheearth/modules/network/model/BuildTeam.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/BuildTeam.java @@ -1,12 +1,12 @@ -package net.buildtheearth.modules.network.model; +package net.buildtheearth.buildteamtools.modules.network.model; import com.alpsbte.alpslib.utils.ChatHelper; import lombok.Getter; -import net.buildtheearth.modules.navigation.components.warps.model.Warp; -import net.buildtheearth.modules.navigation.components.warps.model.WarpGroup; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.network.api.API; -import net.buildtheearth.modules.network.api.NetworkAPI; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.api.API; +import net.buildtheearth.buildteamtools.modules.network.api.NetworkAPI; import org.bukkit.entity.Player; import java.io.IOException; diff --git a/src/main/java/net/buildtheearth/modules/network/model/Continent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/Continent.java similarity index 94% rename from src/main/java/net/buildtheearth/modules/network/model/Continent.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/model/Continent.java index 5c704384..c5ad9bf0 100644 --- a/src/main/java/net/buildtheearth/modules/network/model/Continent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/Continent.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.network.model; +package net.buildtheearth.buildteamtools.modules.network.model; import lombok.Getter; import lombok.NonNull; diff --git a/src/main/java/net/buildtheearth/modules/network/model/Permissions.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/Permissions.java similarity index 95% rename from src/main/java/net/buildtheearth/modules/network/model/Permissions.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/model/Permissions.java index f2cf1dff..d29ee740 100644 --- a/src/main/java/net/buildtheearth/modules/network/model/Permissions.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/Permissions.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.network.model; +package net.buildtheearth.buildteamtools.modules.network.model; public abstract class Permissions { diff --git a/src/main/java/net/buildtheearth/modules/network/model/Region.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/Region.java similarity index 97% rename from src/main/java/net/buildtheearth/modules/network/model/Region.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/model/Region.java index 41f5a3a4..ff60aa64 100644 --- a/src/main/java/net/buildtheearth/modules/network/model/Region.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/Region.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.network.model; +package net.buildtheearth.buildteamtools.modules.network.model; import lombok.Getter; diff --git a/src/main/java/net/buildtheearth/modules/network/model/RegionType.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/RegionType.java similarity index 89% rename from src/main/java/net/buildtheearth/modules/network/model/RegionType.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/network/model/RegionType.java index 6279a005..a58d40e7 100644 --- a/src/main/java/net/buildtheearth/modules/network/model/RegionType.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/model/RegionType.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.network.model; +package net.buildtheearth.buildteamtools.modules.network.model; import lombok.Getter; import lombok.NonNull; diff --git a/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/plotsystem/PlotSystemModule.java similarity index 94% rename from src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/plotsystem/PlotSystemModule.java index ad38318b..edbf1950 100644 --- a/src/main/java/net/buildtheearth/modules/plotsystem/PlotSystemModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/plotsystem/PlotSystemModule.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.plotsystem; +package net.buildtheearth.buildteamtools.modules.plotsystem; -import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.plotsystem.commands.PlotSystemTerraCommand; -import net.buildtheearth.utils.WikiLinks; +import net.buildtheearth.buildteamtools.modules.Module; +import net.buildtheearth.buildteamtools.modules.plotsystem.commands.PlotSystemTerraCommand; +import net.buildtheearth.buildteamtools.utils.WikiLinks; public class PlotSystemModule extends Module { diff --git a/src/main/java/net/buildtheearth/modules/plotsystem/commands/PlotSystemTerraCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/plotsystem/commands/PlotSystemTerraCommand.java similarity index 81% rename from src/main/java/net/buildtheearth/modules/plotsystem/commands/PlotSystemTerraCommand.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/plotsystem/commands/PlotSystemTerraCommand.java index 3b84735e..d318c2c8 100644 --- a/src/main/java/net/buildtheearth/modules/plotsystem/commands/PlotSystemTerraCommand.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/plotsystem/commands/PlotSystemTerraCommand.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.plotsystem.commands; +package net.buildtheearth.buildteamtools.modules.plotsystem.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/src/main/java/net/buildtheearth/modules/stats/StatsModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/StatsModule.java similarity index 86% rename from src/main/java/net/buildtheearth/modules/stats/StatsModule.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/stats/StatsModule.java index d8257ff4..90df7693 100644 --- a/src/main/java/net/buildtheearth/modules/stats/StatsModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/StatsModule.java @@ -1,15 +1,15 @@ -package net.buildtheearth.modules.stats; +package net.buildtheearth.buildteamtools.modules.stats; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import lombok.Getter; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.modules.Module; -import net.buildtheearth.modules.network.NetworkModule; -import net.buildtheearth.modules.stats.listeners.StatsListener; -import net.buildtheearth.modules.stats.model.StatsPlayer; -import net.buildtheearth.modules.stats.model.StatsServer; -import net.buildtheearth.utils.WikiLinks; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.modules.Module; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.stats.listeners.StatsListener; +import net.buildtheearth.buildteamtools.modules.stats.model.StatsPlayer; +import net.buildtheearth.buildteamtools.modules.stats.model.StatsServer; +import net.buildtheearth.buildteamtools.utils.WikiLinks; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.json.JSONArray; diff --git a/src/main/java/net/buildtheearth/modules/stats/listeners/StatsListener.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/listeners/StatsListener.java similarity index 89% rename from src/main/java/net/buildtheearth/modules/stats/listeners/StatsListener.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/stats/listeners/StatsListener.java index dce7ad88..4f6ad9f1 100644 --- a/src/main/java/net/buildtheearth/modules/stats/listeners/StatsListener.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/listeners/StatsListener.java @@ -1,8 +1,8 @@ -package net.buildtheearth.modules.stats.listeners; +package net.buildtheearth.buildteamtools.modules.stats.listeners; -import net.buildtheearth.modules.stats.StatsModule; -import net.buildtheearth.modules.stats.model.StatsPlayerType; -import net.buildtheearth.modules.stats.model.StatsServerType; +import net.buildtheearth.buildteamtools.modules.stats.StatsModule; +import net.buildtheearth.buildteamtools.modules.stats.model.StatsPlayerType; +import net.buildtheearth.buildteamtools.modules.stats.model.StatsServerType; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; diff --git a/src/main/java/net/buildtheearth/modules/stats/menu/StatsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java similarity index 88% rename from src/main/java/net/buildtheearth/modules/stats/menu/StatsMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java index 7e18e47f..60a778fa 100644 --- a/src/main/java/net/buildtheearth/modules/stats/menu/StatsMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java @@ -1,14 +1,14 @@ -package net.buildtheearth.modules.stats.menu; +package net.buildtheearth.buildteamtools.modules.stats.menu; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.modules.stats.StatsModule; -import net.buildtheearth.modules.stats.model.StatsPlayer; -import net.buildtheearth.modules.stats.model.StatsServer; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.ListUtil; -import net.buildtheearth.utils.MenuItems; -import net.buildtheearth.utils.menus.AbstractMenu; +import net.buildtheearth.buildteamtools.modules.stats.StatsModule; +import net.buildtheearth.buildteamtools.modules.stats.model.StatsPlayer; +import net.buildtheearth.buildteamtools.modules.stats.model.StatsServer; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.ListUtil; +import net.buildtheearth.buildteamtools.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.ipvp.canvas.mask.BinaryMask; diff --git a/src/main/java/net/buildtheearth/modules/stats/model/StatsPlayer.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsPlayer.java similarity index 93% rename from src/main/java/net/buildtheearth/modules/stats/model/StatsPlayer.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsPlayer.java index f2a79004..99bd57f5 100644 --- a/src/main/java/net/buildtheearth/modules/stats/model/StatsPlayer.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsPlayer.java @@ -1,6 +1,6 @@ -package net.buildtheearth.modules.stats.model; +package net.buildtheearth.buildteamtools.modules.stats.model; -import net.buildtheearth.modules.stats.StatsModule; +import net.buildtheearth.buildteamtools.modules.stats.StatsModule; import org.json.simple.JSONObject; import java.util.HashMap; diff --git a/src/main/java/net/buildtheearth/modules/stats/model/StatsPlayerType.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsPlayerType.java similarity index 70% rename from src/main/java/net/buildtheearth/modules/stats/model/StatsPlayerType.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsPlayerType.java index 23dc6313..61f63a77 100644 --- a/src/main/java/net/buildtheearth/modules/stats/model/StatsPlayerType.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsPlayerType.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.stats.model; +package net.buildtheearth.buildteamtools.modules.stats.model; public enum StatsPlayerType { PLAYTIME, diff --git a/src/main/java/net/buildtheearth/modules/stats/model/StatsServer.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsServer.java similarity index 92% rename from src/main/java/net/buildtheearth/modules/stats/model/StatsServer.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsServer.java index ba53c4c0..d8b9052c 100644 --- a/src/main/java/net/buildtheearth/modules/stats/model/StatsServer.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsServer.java @@ -1,6 +1,6 @@ -package net.buildtheearth.modules.stats.model; +package net.buildtheearth.buildteamtools.modules.stats.model; -import net.buildtheearth.modules.stats.StatsModule; +import net.buildtheearth.buildteamtools.modules.stats.StatsModule; import org.json.simple.JSONObject; import java.util.HashMap; diff --git a/src/main/java/net/buildtheearth/modules/stats/model/StatsServerType.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsServerType.java similarity index 72% rename from src/main/java/net/buildtheearth/modules/stats/model/StatsServerType.java rename to src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsServerType.java index cbcfcf5f..460c9a16 100644 --- a/src/main/java/net/buildtheearth/modules/stats/model/StatsServerType.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/model/StatsServerType.java @@ -1,4 +1,4 @@ -package net.buildtheearth.modules.stats.model; +package net.buildtheearth.buildteamtools.modules.stats.model; public enum StatsServerType { UPTIME, diff --git a/src/main/java/net/buildtheearth/utils/BlockLocation.java b/src/main/java/net/buildtheearth/buildteamtools/utils/BlockLocation.java similarity index 93% rename from src/main/java/net/buildtheearth/utils/BlockLocation.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/BlockLocation.java index 46a42657..909b2305 100644 --- a/src/main/java/net/buildtheearth/utils/BlockLocation.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/BlockLocation.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; import org.bukkit.Location; import org.bukkit.World; diff --git a/src/main/java/net/buildtheearth/utils/Config.java b/src/main/java/net/buildtheearth/buildteamtools/utils/Config.java similarity index 97% rename from src/main/java/net/buildtheearth/utils/Config.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/Config.java index 26d200c0..68963917 100644 --- a/src/main/java/net/buildtheearth/utils/Config.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/Config.java @@ -1,6 +1,6 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; -import net.buildtheearth.BuildTeamTools; +import net.buildtheearth.buildteamtools.BuildTeamTools; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; diff --git a/src/main/java/net/buildtheearth/utils/CustomHeads.java b/src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java similarity index 99% rename from src/main/java/net/buildtheearth/utils/CustomHeads.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java index f29317d1..c56c9076 100644 --- a/src/main/java/net/buildtheearth/utils/CustomHeads.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; import com.alpsbte.alpslib.utils.item.Item; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/utils/GeometricUtils.java b/src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java similarity index 92% rename from src/main/java/net/buildtheearth/utils/GeometricUtils.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java index ae19fd20..ee2e3c48 100644 --- a/src/main/java/net/buildtheearth/utils/GeometricUtils.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java @@ -1,8 +1,8 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.geo.CoordinateConversion; -import net.buildtheearth.utils.io.ConfigPaths; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.utils.geo.CoordinateConversion; +import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; diff --git a/src/main/java/net/buildtheearth/utils/JsonUtils.java b/src/main/java/net/buildtheearth/buildteamtools/utils/JsonUtils.java similarity index 95% rename from src/main/java/net/buildtheearth/utils/JsonUtils.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/JsonUtils.java index fc800e99..b9dff456 100644 --- a/src/main/java/net/buildtheearth/utils/JsonUtils.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/JsonUtils.java @@ -18,13 +18,9 @@ * */ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; -import com.google.gson.JsonElement; -import com.google.gson.JsonIOException; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.JsonSyntaxException; +import com.google.gson.*; import com.google.gson.internal.Streams; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; diff --git a/src/main/java/net/buildtheearth/utils/LineRasterization.java b/src/main/java/net/buildtheearth/buildteamtools/utils/LineRasterization.java similarity index 97% rename from src/main/java/net/buildtheearth/utils/LineRasterization.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/LineRasterization.java index 40fa6f80..d8d0432e 100644 --- a/src/main/java/net/buildtheearth/utils/LineRasterization.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/LineRasterization.java @@ -1,9 +1,9 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; import org.bukkit.Location; -import java.util.List; import java.util.ArrayList; +import java.util.List; public class LineRasterization { diff --git a/src/main/java/net/buildtheearth/utils/ListUtil.java b/src/main/java/net/buildtheearth/buildteamtools/utils/ListUtil.java similarity index 87% rename from src/main/java/net/buildtheearth/utils/ListUtil.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/ListUtil.java index cb832636..fff5eac6 100644 --- a/src/main/java/net/buildtheearth/utils/ListUtil.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/ListUtil.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; import java.util.ArrayList; diff --git a/src/main/java/net/buildtheearth/utils/MathUtils.java b/src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java similarity index 98% rename from src/main/java/net/buildtheearth/utils/MathUtils.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java index 4d112945..85ab6bd1 100644 --- a/src/main/java/net/buildtheearth/utils/MathUtils.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; public class MathUtils { /** diff --git a/src/main/java/net/buildtheearth/utils/MenuItems.java b/src/main/java/net/buildtheearth/buildteamtools/utils/MenuItems.java similarity index 99% rename from src/main/java/net/buildtheearth/utils/MenuItems.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/MenuItems.java index 8ab36efd..4f9ddba3 100644 --- a/src/main/java/net/buildtheearth/utils/MenuItems.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/MenuItems.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; diff --git a/src/main/java/net/buildtheearth/utils/PolygonTools.java b/src/main/java/net/buildtheearth/buildteamtools/utils/PolygonTools.java similarity index 95% rename from src/main/java/net/buildtheearth/utils/PolygonTools.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/PolygonTools.java index d768faf0..24bbd70b 100644 --- a/src/main/java/net/buildtheearth/utils/PolygonTools.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/PolygonTools.java @@ -1,8 +1,7 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; import org.bukkit.Location; - import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/net/buildtheearth/utils/Utils.java b/src/main/java/net/buildtheearth/buildteamtools/utils/Utils.java similarity index 98% rename from src/main/java/net/buildtheearth/utils/Utils.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/Utils.java index d1446a9d..6780d572 100644 --- a/src/main/java/net/buildtheearth/utils/Utils.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/Utils.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/net/buildtheearth/utils/WikiLinks.java b/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java similarity index 97% rename from src/main/java/net/buildtheearth/utils/WikiLinks.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java index dc6a83a3..efa27b07 100644 --- a/src/main/java/net/buildtheearth/utils/WikiLinks.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils; +package net.buildtheearth.buildteamtools.utils; import lombok.experimental.UtilityClass; diff --git a/src/main/java/net/buildtheearth/utils/geo/CoordinateConversion.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/CoordinateConversion.java similarity index 92% rename from src/main/java/net/buildtheearth/utils/geo/CoordinateConversion.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/CoordinateConversion.java index 52b35bdd..c725b53e 100644 --- a/src/main/java/net/buildtheearth/utils/geo/CoordinateConversion.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/CoordinateConversion.java @@ -22,12 +22,12 @@ * SOFTWARE. */ -package net.buildtheearth.utils.geo; +package net.buildtheearth.buildteamtools.utils.geo; -import net.buildtheearth.utils.geo.projection.GeographicProjection; -import net.buildtheearth.utils.geo.projection.OffsetProjectionTransform; -import net.buildtheearth.utils.geo.projection.OutOfProjectionBoundsException; -import net.buildtheearth.utils.geo.projection.ScaleProjectionTransform; +import net.buildtheearth.buildteamtools.utils.geo.projection.GeographicProjection; +import net.buildtheearth.buildteamtools.utils.geo.projection.OffsetProjectionTransform; +import net.buildtheearth.buildteamtools.utils.geo.projection.OutOfProjectionBoundsException; +import net.buildtheearth.buildteamtools.utils.geo.projection.ScaleProjectionTransform; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/GeographicProjection.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/GeographicProjection.java similarity index 93% rename from src/main/java/net/buildtheearth/utils/geo/projection/GeographicProjection.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/GeographicProjection.java index 04b8b61d..06ec5ce6 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/GeographicProjection.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/GeographicProjection.java @@ -1,9 +1,9 @@ -package net.buildtheearth.utils.geo.projection; +package net.buildtheearth.buildteamtools.utils.geo.projection; -import net.buildtheearth.utils.geo.projection.airocean.Airocean; -import net.buildtheearth.utils.geo.projection.airocean.ConformalEstimate; -import net.buildtheearth.utils.geo.projection.airocean.ModifiedAirocean; +import net.buildtheearth.buildteamtools.utils.geo.projection.airocean.Airocean; +import net.buildtheearth.buildteamtools.utils.geo.projection.airocean.ConformalEstimate; +import net.buildtheearth.buildteamtools.utils.geo.projection.airocean.ModifiedAirocean; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/InvertableVectorField.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java similarity index 96% rename from src/main/java/net/buildtheearth/utils/geo/projection/InvertableVectorField.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java index 19923822..caf88399 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/InvertableVectorField.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java @@ -1,7 +1,7 @@ -package net.buildtheearth.utils.geo.projection; +package net.buildtheearth.buildteamtools.utils.geo.projection; -import net.buildtheearth.utils.MathUtils; +import net.buildtheearth.buildteamtools.utils.MathUtils; public class InvertableVectorField { diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/OffsetProjectionTransform.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OffsetProjectionTransform.java similarity index 95% rename from src/main/java/net/buildtheearth/utils/geo/projection/OffsetProjectionTransform.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OffsetProjectionTransform.java index 92d09bd4..28ac4d19 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/OffsetProjectionTransform.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OffsetProjectionTransform.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.geo.projection; +package net.buildtheearth.buildteamtools.utils.geo.projection; import com.google.common.base.Preconditions; diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/OutOfProjectionBoundsException.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OutOfProjectionBoundsException.java similarity index 90% rename from src/main/java/net/buildtheearth/utils/geo/projection/OutOfProjectionBoundsException.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OutOfProjectionBoundsException.java index 93c45e2e..fc5e8ef9 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/OutOfProjectionBoundsException.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OutOfProjectionBoundsException.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.geo.projection; +package net.buildtheearth.buildteamtools.utils.geo.projection; public final class OutOfProjectionBoundsException extends Exception { private static final OutOfProjectionBoundsException INSTANCE = new OutOfProjectionBoundsException(false); diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/ProjectionTransform.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ProjectionTransform.java similarity index 89% rename from src/main/java/net/buildtheearth/utils/geo/projection/ProjectionTransform.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ProjectionTransform.java index 95e07a9b..9a1dd0aa 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/ProjectionTransform.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ProjectionTransform.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.geo.projection; +package net.buildtheearth.buildteamtools.utils.geo.projection; public abstract class ProjectionTransform extends GeographicProjection { protected final GeographicProjection input; diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/ScaleProjectionTransform.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ScaleProjectionTransform.java similarity index 96% rename from src/main/java/net/buildtheearth/utils/geo/projection/ScaleProjectionTransform.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ScaleProjectionTransform.java index ab108a2d..50ca09b6 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/ScaleProjectionTransform.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ScaleProjectionTransform.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.geo.projection; +package net.buildtheearth.buildteamtools.utils.geo.projection; import com.google.common.base.Preconditions; diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/UprightOrientationProjectionTransform.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/UprightOrientationProjectionTransform.java similarity index 93% rename from src/main/java/net/buildtheearth/utils/geo/projection/UprightOrientationProjectionTransform.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/UprightOrientationProjectionTransform.java index 856500f1..05701260 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/UprightOrientationProjectionTransform.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/UprightOrientationProjectionTransform.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.geo.projection; +package net.buildtheearth.buildteamtools.utils.geo.projection; /** * Mirrors the warped projection vertically. diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/airocean/Airocean.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/Airocean.java similarity index 97% rename from src/main/java/net/buildtheearth/utils/geo/projection/airocean/Airocean.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/Airocean.java index 19defd96..a8e636da 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/airocean/Airocean.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/Airocean.java @@ -1,8 +1,8 @@ -package net.buildtheearth.utils.geo.projection.airocean; +package net.buildtheearth.buildteamtools.utils.geo.projection.airocean; -import net.buildtheearth.utils.MathUtils; -import net.buildtheearth.utils.geo.projection.GeographicProjection; -import net.buildtheearth.utils.geo.projection.OutOfProjectionBoundsException; +import net.buildtheearth.buildteamtools.utils.MathUtils; +import net.buildtheearth.buildteamtools.utils.geo.projection.GeographicProjection; +import net.buildtheearth.buildteamtools.utils.geo.projection.OutOfProjectionBoundsException; /** * Implementation of the Dynmaxion projection. diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/airocean/ConformalEstimate.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ConformalEstimate.java similarity index 93% rename from src/main/java/net/buildtheearth/utils/geo/projection/airocean/ConformalEstimate.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ConformalEstimate.java index 57715f45..b868ad55 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/airocean/ConformalEstimate.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ConformalEstimate.java @@ -1,7 +1,7 @@ -package net.buildtheearth.utils.geo.projection.airocean; +package net.buildtheearth.buildteamtools.utils.geo.projection.airocean; -import net.buildtheearth.utils.MathUtils; -import net.buildtheearth.utils.geo.projection.InvertableVectorField; +import net.buildtheearth.buildteamtools.utils.MathUtils; +import net.buildtheearth.buildteamtools.utils.geo.projection.InvertableVectorField; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/net/buildtheearth/utils/geo/projection/airocean/ModifiedAirocean.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ModifiedAirocean.java similarity index 94% rename from src/main/java/net/buildtheearth/utils/geo/projection/airocean/ModifiedAirocean.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ModifiedAirocean.java index 3e84fb75..0f224892 100644 --- a/src/main/java/net/buildtheearth/utils/geo/projection/airocean/ModifiedAirocean.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ModifiedAirocean.java @@ -1,8 +1,8 @@ -package net.buildtheearth.utils.geo.projection.airocean; +package net.buildtheearth.buildteamtools.utils.geo.projection.airocean; -import net.buildtheearth.utils.MathUtils; -import net.buildtheearth.utils.geo.projection.OutOfProjectionBoundsException; +import net.buildtheearth.buildteamtools.utils.MathUtils; +import net.buildtheearth.buildteamtools.utils.geo.projection.OutOfProjectionBoundsException; /** * Implementation of the BTE modified Dynmaxion projection. diff --git a/src/main/java/net/buildtheearth/utils/io/ConfigPaths.java b/src/main/java/net/buildtheearth/buildteamtools/utils/io/ConfigPaths.java similarity index 98% rename from src/main/java/net/buildtheearth/utils/io/ConfigPaths.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/io/ConfigPaths.java index e8831afa..9258c538 100644 --- a/src/main/java/net/buildtheearth/utils/io/ConfigPaths.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/io/ConfigPaths.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.io; +package net.buildtheearth.buildteamtools.utils.io; public abstract class ConfigPaths { diff --git a/src/main/java/net/buildtheearth/utils/io/ConfigUtil.java b/src/main/java/net/buildtheearth/buildteamtools/utils/io/ConfigUtil.java similarity index 97% rename from src/main/java/net/buildtheearth/utils/io/ConfigUtil.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/io/ConfigUtil.java index b043f629..e7b20228 100644 --- a/src/main/java/net/buildtheearth/utils/io/ConfigUtil.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/io/ConfigUtil.java @@ -22,7 +22,7 @@ * SOFTWARE. */ -package net.buildtheearth.utils.io; +package net.buildtheearth.buildteamtools.utils.io; import com.alpsbte.alpslib.io.config.ConfigNotImplementedException; import com.alpsbte.alpslib.io.config.ConfigurationUtil; diff --git a/src/main/java/net/buildtheearth/utils/io/Constants.java b/src/main/java/net/buildtheearth/buildteamtools/utils/io/Constants.java similarity index 89% rename from src/main/java/net/buildtheearth/utils/io/Constants.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/io/Constants.java index 463e3b33..a1e85fa2 100644 --- a/src/main/java/net/buildtheearth/utils/io/Constants.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/io/Constants.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.io; +package net.buildtheearth.buildteamtools.utils.io; public class Constants { diff --git a/src/main/java/net/buildtheearth/utils/io/Errors.java b/src/main/java/net/buildtheearth/buildteamtools/utils/io/Errors.java similarity index 92% rename from src/main/java/net/buildtheearth/utils/io/Errors.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/io/Errors.java index ba5fcb12..823f0e9d 100644 --- a/src/main/java/net/buildtheearth/utils/io/Errors.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/io/Errors.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.io; +package net.buildtheearth.buildteamtools.utils.io; public class Errors { diff --git a/src/main/java/net/buildtheearth/utils/io/LangPaths.java b/src/main/java/net/buildtheearth/buildteamtools/utils/io/LangPaths.java similarity index 96% rename from src/main/java/net/buildtheearth/utils/io/LangPaths.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/io/LangPaths.java index d10ac862..91ba9860 100644 --- a/src/main/java/net/buildtheearth/utils/io/LangPaths.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/io/LangPaths.java @@ -22,7 +22,7 @@ * SOFTWARE. */ -package net.buildtheearth.utils.io; +package net.buildtheearth.buildteamtools.utils.io; public abstract class LangPaths { private static final String LANG = "lang."; diff --git a/src/main/java/net/buildtheearth/utils/io/LangUtil.java b/src/main/java/net/buildtheearth/buildteamtools/utils/io/LangUtil.java similarity index 97% rename from src/main/java/net/buildtheearth/utils/io/LangUtil.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/io/LangUtil.java index c94657d0..a7a66d50 100644 --- a/src/main/java/net/buildtheearth/utils/io/LangUtil.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/io/LangUtil.java @@ -22,7 +22,7 @@ * SOFTWARE. */ -package net.buildtheearth.utils.io; +package net.buildtheearth.buildteamtools.utils.io; import com.alpsbte.alpslib.io.lang.LanguageUtil; diff --git a/src/main/java/net/buildtheearth/utils/menus/AbstractMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java similarity index 97% rename from src/main/java/net/buildtheearth/utils/menus/AbstractMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java index 8b26a7bf..94d30121 100644 --- a/src/main/java/net/buildtheearth/utils/menus/AbstractMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java @@ -1,9 +1,9 @@ -package net.buildtheearth.utils.menus; +package net.buildtheearth.buildteamtools.utils.menus; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.CustomHeads; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.utils.CustomHeads; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import org.bukkit.Bukkit; diff --git a/src/main/java/net/buildtheearth/utils/menus/AbstractPaginatedMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java similarity index 96% rename from src/main/java/net/buildtheearth/utils/menus/AbstractPaginatedMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java index fe022cf9..b6eb6ae1 100644 --- a/src/main/java/net/buildtheearth/utils/menus/AbstractPaginatedMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java @@ -1,7 +1,7 @@ -package net.buildtheearth.utils.menus; +package net.buildtheearth.buildteamtools.utils.menus; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.CustomHeads; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.utils.CustomHeads; import org.bukkit.Bukkit; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/utils/menus/BlockListMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java similarity index 96% rename from src/main/java/net/buildtheearth/utils/menus/BlockListMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java index 1f07498c..5aee3e70 100644 --- a/src/main/java/net/buildtheearth/utils/menus/BlockListMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java @@ -1,8 +1,8 @@ -package net.buildtheearth.utils.menus; +package net.buildtheearth.buildteamtools.utils.menus; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.MenuItems; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/net/buildtheearth/utils/menus/BookMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BookMenu.java similarity index 97% rename from src/main/java/net/buildtheearth/utils/menus/BookMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/menus/BookMenu.java index 4595c2eb..20962aa4 100644 --- a/src/main/java/net/buildtheearth/utils/menus/BookMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BookMenu.java @@ -1,9 +1,9 @@ -package net.buildtheearth.utils.menus; +package net.buildtheearth.buildteamtools.utils.menus; import com.alpsbte.alpslib.utils.item.Item; import com.cryptomorin.xseries.XMaterial; -import net.buildtheearth.BuildTeamTools; -import net.buildtheearth.utils.MenuItems; +import net.buildtheearth.buildteamtools.BuildTeamTools; +import net.buildtheearth.buildteamtools.utils.MenuItems; import org.bukkit.Bukkit; import org.bukkit.Sound; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/utils/menus/NameListMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java similarity index 96% rename from src/main/java/net/buildtheearth/utils/menus/NameListMenu.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java index 3a1f61c6..f22ee90f 100644 --- a/src/main/java/net/buildtheearth/utils/menus/NameListMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java @@ -1,8 +1,8 @@ -package net.buildtheearth.utils.menus; +package net.buildtheearth.buildteamtools.utils.menus; import com.alpsbte.alpslib.utils.item.Item; -import net.buildtheearth.utils.CustomHeads; -import net.buildtheearth.utils.MenuItems; +import net.buildtheearth.buildteamtools.utils.CustomHeads; +import net.buildtheearth.buildteamtools.utils.MenuItems; import net.daporkchop.lib.common.misc.Tuple; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; diff --git a/src/main/java/net/buildtheearth/utils/raycast/Raycast.java b/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/Raycast.java similarity index 99% rename from src/main/java/net/buildtheearth/utils/raycast/Raycast.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/raycast/Raycast.java index b400cef6..bd68a22c 100644 --- a/src/main/java/net/buildtheearth/utils/raycast/Raycast.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/Raycast.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.raycast; +package net.buildtheearth.buildteamtools.utils.raycast; import com.cryptomorin.xseries.XMaterial; import org.bukkit.Location; diff --git a/src/main/java/net/buildtheearth/utils/raycast/RaycastAPIMath.java b/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/RaycastAPIMath.java similarity index 97% rename from src/main/java/net/buildtheearth/utils/raycast/RaycastAPIMath.java rename to src/main/java/net/buildtheearth/buildteamtools/utils/raycast/RaycastAPIMath.java index b60510b7..17f2c3a9 100644 --- a/src/main/java/net/buildtheearth/utils/raycast/RaycastAPIMath.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/RaycastAPIMath.java @@ -1,4 +1,4 @@ -package net.buildtheearth.utils.raycast; +package net.buildtheearth.buildteamtools.utils.raycast; import org.bukkit.util.Vector; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index ecf6ef75..b7984b01 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: BuildTeamTools -main: net.buildtheearth.BuildTeamTools +main: net.buildtheearth.buildteamtools.BuildTeamTools api-version: 1.13 version: ${version} description: ${description} From ee87f2515dfee2b2f7489c80fdcc62e0c19e1363 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Tue, 13 Jan 2026 15:25:45 +0100 Subject: [PATCH 23/37] =?UTF-8?q?feat(build):=20=E2=9C=A8=20add=20GitHub?= =?UTF-8?q?=20Actions=20workflow=20for=20Java=20CI=20with=20Gradle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..7e87526e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 # full history + fetch-tags: true # grab your tags + # Make sure we check out by branch name, not just SHA: + ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }} + + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: '21' + distribution: 'temurin' + + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build with Gradle Wrapper + run: ./gradlew clean build + + - uses: actions/upload-artifact@v4 + with: + name: Staging-Build + path: build/libs + compression-level: '9' From 21f8f3c2f0c4a2d55ad697cd8760ebd48b7a71b6 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Fri, 16 Jan 2026 14:24:17 +0100 Subject: [PATCH 24/37] =?UTF-8?q?fix(build):=20=E2=9C=A8=20improve=20API?= =?UTF-8?q?=20key=20instructions=20and=20enhance=20module=20shutdown=20che?= =?UTF-8?q?cks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../buildteamtools/modules/ModuleHandler.java | 3 ++- .../buildteamtools/modules/stats/StatsModule.java | 9 ++++++++- src/main/resources/config.yml | 7 ++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java b/src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java index 3bcffe1f..2bb8e756 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java @@ -60,7 +60,8 @@ public boolean enable(@NotNull Module module, @Nullable CommandSender executor) if (m.getModuleName().equals(module.getModuleName()) && m.isEnabled()) return false; - if (!module.getModuleName().equals("Common") && BuildTeamTools.getInstance().getConfig().getList(ConfigPaths.DISABLED_MODULES, List.of()).contains(module.getModuleName())) { + if (!module.getModuleName().equals("Common") && BuildTeamTools.getInstance().getConfig() + .getStringList(ConfigPaths.DISABLED_MODULES).stream().anyMatch(module.getModuleName()::equalsIgnoreCase)) { module.shutdown("This module is disabled in the config."); } else { boolean containsDisabledDependencyModule = false; diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/stats/StatsModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/StatsModule.java index 90df7693..a5113395 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/modules/stats/StatsModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/StatsModule.java @@ -48,11 +48,18 @@ public void enable() { return; } - if (!NetworkModule.getInstance().getBuildTeam().isConnected() || !Bukkit.getServerConfig().isProxyEnabled()) { + if (!NetworkModule.getInstance().getBuildTeam().isConnected()) { shutdown("The Build Team have to be connected to the BtE Network (Proxy)."); return; } + try { + if (!Bukkit.getServerConfig().isProxyEnabled()) { + shutdown("The Build Team have to be connected to the BtE Network (Proxy)."); + return; + } + } catch (NoSuchMethodError e) { /* it's fine - we assume proxy is enabled This Method only exist in 1.21.5+ */} + statsServer = new StatsServer(); statsPlayerList = new HashMap<>(); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 3fc73a47..8db89e38 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -6,9 +6,10 @@ # | [Contacts - Discord] BTE Development Hub, @zoriot # ---------------------------------------------------------------------------------------------- -# The Build Team API Key used to fetch build team info for display. -# Find the key on the Minecraft Network at "buildtheearth.net". Navigate: Compass > Build Teams > My Teams > Your Team > API-Key. -# Without this key, some plugin components wont function. For assistance, see #server-support on the staff discord. +# The Build Team API Key used to fetch build team info for display. Find the key on the Minecraft Network at "buildtheearth.net". +# Navigate: Compass > Build Teams > Your Country > Your Team → Edit > API-Key → Right click on it → Click on the api key in chat. +# Without this key, some plugin components won`t function. For assistance, see #server-support on the staff discord - +# you might need to be added as a owner first. api-key: 00000000-0000-0000-0000-000000000000 # The main world using the custom BTE Dynmaxion projection From c2956cb8a002f9b32c5219ddf23b8f443a68b439 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Sat, 17 Jan 2026 00:19:49 +0100 Subject: [PATCH 25/37] =?UTF-8?q?fix(build):=20=E2=9C=A8=20adjust=20click?= =?UTF-8?q?=20handler=20logic=20in=20MainMenu=20for=20warp=20menu=20access?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../buildteamtools/modules/navigation/menu/MainMenu.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/MainMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/MainMenu.java index cf433250..28210725 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/MainMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/MainMenu.java @@ -7,6 +7,7 @@ import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; import net.buildtheearth.buildteamtools.modules.navigation.components.warps.WarpsComponent; import net.buildtheearth.buildteamtools.modules.network.NetworkModule; +import net.buildtheearth.buildteamtools.modules.network.model.Permissions; import net.buildtheearth.buildteamtools.utils.MenuItems; import net.buildtheearth.buildteamtools.utils.io.ConfigPaths; import net.buildtheearth.buildteamtools.utils.io.ConfigUtil; @@ -109,10 +110,11 @@ protected void setItemClickEventsAsync() { // Set Explore Item Click Event getMenu().getSlot(Objects.requireNonNull(slots.pollFirst())).setClickHandler((clickPlayer, clickInformation) -> { clickPlayer.closeInventory(); - if (clickInformation.getClickType().isRightClick()) { - new ExploreMenu(clickPlayer, true); - } else { + if (!clickInformation.getClickType().isRightClick() && !NetworkModule.getInstance().getBuildTeam().getWarpGroups().isEmpty() + && clickPlayer.hasPermission(Permissions.WARP_USE)) { WarpsComponent.openWarpMenu(clickPlayer, NetworkModule.getInstance().getBuildTeam(), this); + } else { + new ExploreMenu(clickPlayer, true); } }); } From f03228012ecc785bc0fef67bf1a65ee5b5b90030 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 19 Jan 2026 12:15:48 +0100 Subject: [PATCH 26/37] =?UTF-8?q?chore(build):=20=E2=9C=A8=20Update=20libr?= =?UTF-8?q?ary=20versions=20&=20cleanup=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #71. --- build.gradle.kts | 57 ++----------------------------------- gradle/libs.versions.toml | 38 +++++++++++-------------- settings.gradle.kts | 60 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 75 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b5fb1595..2afa8b7a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,58 +9,6 @@ plugins { alias(libs.plugins.shadow) } -repositories { - //mavenLocal() // NEVER use in Production/Commits! - mavenCentral() - maven { - url = uri("https://repo.papermc.io/repository/maven-public/") - } - - maven { - url = uri("https://maven.buildtheearth.net/releases") - } - - maven { - url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") - } - - maven { - url = uri("https://mvn.alps-bte.com/repository/alps-bte/") - } - - maven { - url = uri("https://repo.onarandombox.com/content/groups/public/") - } - - maven { - url = uri("https://repo.codemc.io/repository/maven-snapshots/") - } - - maven { - url = uri("https://repo.codemc.io/repository/maven-public/") - } - - maven { - url = uri("https://jitpack.io") - } - - maven { - url = uri("https://repo.dmulloy2.net/repository/public/") - } - - maven { - url = uri("https://maven.daporkchop.net/") - } - - maven { - url = uri("https://download.java.net/maven/2") - } - - maven { - url = uri("https://maven.enginehub.org/repo/") - } -} - dependencies { //implementation(libs.com.alpsbte.alpslib.alpslib.libpsterra) CURRENTLY BROKEN implementation(libs.alpslib.io) @@ -79,9 +27,10 @@ dependencies { exclude(group = "com.sun.xml.bind", module = "jaxb-xjc") // Else Remapping will yell of duplicated classes } implementation(libs.com.googlecode.json.simple) + implementation(platform(libs.fawe.bom)) + compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core") + compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit") { isTransitive = false } compileOnly(libs.io.papermc.paper.paper.api) - compileOnly(libs.com.fastasyncworldedit.fastasyncworldedit.core) - compileOnly(libs.com.fastasyncworldedit.fastasyncworldedit.bukkit) } val versionDetails: groovy.lang.Closure by extra diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3a764c30..7a8cdee4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,45 +2,41 @@ # https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format [versions] -com-alpsbte-alpslib-alpslib-libpsterra = "1.1.3" -com-alpsbte-canvas = "1.3" -com-fastasyncworldedit-fastasyncworldedit-bukkit = "2.12.3" -com-fastasyncworldedit-fastasyncworldedit-core = "2.12.3" +com-alpsbte-alpslib-alpslib-libpsterra = "1.1.4" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-libpsterra/ +com-alpsbte-canvas = "1.3" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/canvas/ com-github-cryptomorin-xseries = "13.6.0" # https://github.com/CryptoMorin/XSeries/releases -com-google-code-gson-gson = "2.13.1" -com-mojang-authlib = "7.0.61" -com-squareup-okhttp3-okhttp-jvm = "5.1.0" +com-google-code-gson-gson = "2.13.1" # https://central.sonatype.com/artifact/com.google.code.gson/gson +com-squareup-okhttp3-okhttp-jvm = "5.3.2" # https://central.sonatype.com/artifact/com.squareup.okhttp3/okhttp-jvm javaapiforkml = "3.0.10" # https://github.com/urbancamo/javaapiforkml -io-papermc-paper-paper-api = "1.21.10-R0.1-SNAPSHOT" -micycle-clipper2 = "1.2.2" -net-daporkchop-lib-binary = "0.5.7-SNAPSHOT" -net-wesjd-anvilgui = "1.10.8-SNAPSHOT" -org-json-json = "20251224" # https://mvnrepository.com/artifact/org.json/json/20251224 -io-freefair-lombok = "9.1.0" +io-papermc-paper-paper-api = "1.21.11-R0.1-SNAPSHOT" # https://artifactory.papermc.io/ui/native/universe/io/papermc/paper/paper-api/ +micycle-clipper2 = "1.3.3" # https://github.com/micycle1/Clipper2-java/releases +net-daporkchop-lib-binary = "0.5.9-SNAPSHOT" # https://maven.daporkchop.net/net/daporkchop/lib/binary/ +net-wesjd-anvilgui = "1.10.11-SNAPSHOT" # https://github.com/WesJD/AnvilGUI https://mvn.wesjd.net/ +org-json-json = "20251224" # https://mvnrepository.com/artifact/org.json/json +io-freefair-lombok = "9.2.0" # https://plugins.gradle.org/plugin/io.freefair.lombok com-googlecode-json-simple = "1.1.1" # https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -com-palantir-git-version = "4.0.0" -com-gradleup-shadow = "9.3.0" -alpslib-io = "1.2.0" -alpslib-utils = "1.4.0" +com-palantir-git-version = "4.2.0" # https://github.com/palantir/gradle-git-version/releases +com-gradleup-shadow = "9.3.1" # https://github.com/GradleUp/shadow/releases +alpslib-io = "1.2.0" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-io/ +alpslib-utils = "1.4.0" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-utils/ +fawe-bom = "1.55" # Ref: https://github.com/IntellectualSites/bom [libraries] com-alpsbte-alpslib-alpslib-libpsterra = { module = "com.alpsbte.alpslib:alpslib-libpsterra", version.ref = "com-alpsbte-alpslib-alpslib-libpsterra" } com-alpsbte-canvas = { module = "com.alpsbte:canvas", version.ref = "com-alpsbte-canvas" } -com-fastasyncworldedit-fastasyncworldedit-bukkit = { module = "com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit", version.ref = "com-fastasyncworldedit-fastasyncworldedit-bukkit" } -com-fastasyncworldedit-fastasyncworldedit-core = { module = "com.fastasyncworldedit:FastAsyncWorldEdit-Core", version.ref = "com-fastasyncworldedit-fastasyncworldedit-core" } com-github-cryptomorin-xseries = { module = "com.github.cryptomorin:XSeries", version.ref = "com-github-cryptomorin-xseries" } com-google-code-gson-gson = { module = "com.google.code.gson:gson", version.ref = "com-google-code-gson-gson" } -com-mojang-authlib = { module = "com.mojang:authlib", version.ref = "com-mojang-authlib" } com-squareup-okhttp3-okhttp-jvm = { module = "com.squareup.okhttp3:okhttp-jvm", version.ref = "com-squareup-okhttp3-okhttp-jvm" } javaapiforkml = { module = "uk.m0nom:javaapiforkml", version.ref = "javaapiforkml" } io-papermc-paper-paper-api = { module = "io.papermc.paper:paper-api", version.ref = "io-papermc-paper-paper-api" } -micycle-clipper2 = { module = "micycle:clipper2", version.ref = "micycle-clipper2" } +micycle-clipper2 = { module = "com.github.micycle1:Clipper2-java", version.ref = "micycle-clipper2" } net-daporkchop-lib-binary = { module = "net.daporkchop.lib:binary", version.ref = "net-daporkchop-lib-binary" } net-wesjd-anvilgui = { module = "net.wesjd:anvilgui", version.ref = "net-wesjd-anvilgui" } org-json-json = { module = "org.json:json", version.ref = "org-json-json" } com-googlecode-json-simple = { module = "com.googlecode.json-simple:json-simple", version.ref = "com-googlecode-json-simple" } alpslib-io = { module = "com.alpsbte.alpslib:alpslib-io", version.ref = "alpslib-io" } alpslib-utils = { module = "com.alpsbte.alpslib:alpslib-utils", version.ref = "alpslib-utils" } +fawe-bom = { module = "com.intellectualsites.bom:bom-newest", version.ref = "fawe-bom" } [plugins] lombok = { id = "io.freefair.lombok", version.ref = "io-freefair-lombok" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 5a289eac..9a9e8d80 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,3 +3,63 @@ */ rootProject.name = "BuildTeamTools" + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenCentral() + //mavenLocal() // NEVER use in Production/Commits! + maven { + url = uri("https://repo.papermc.io/repository/maven-public/") + } + + maven { + url = uri("https://maven.buildtheearth.net/releases") + } + + maven { + url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") + } + + maven { + url = uri("https://mvn.alps-bte.com/repository/alps-bte/") + } + + maven { + url = uri("https://repo.onarandombox.com/content/groups/public/") + } + + maven { + url = uri("https://repo.codemc.io/repository/maven-snapshots/") + } + + maven { + url = uri("https://repo.codemc.io/repository/maven-public/") + } + + maven { + url = uri("https://jitpack.io") + } + + maven { + url = uri("https://repo.dmulloy2.net/repository/public/") + } + + maven { + url = uri("https://maven.daporkchop.net/") + } + + maven { + url = uri("https://download.java.net/maven/2") + } + + maven { + url = uri("https://maven.enginehub.org/repo/") + } + + maven { + url = uri("https://mvn.wesjd.net/") + } + maven { url = uri("https://jitpack.io") } + } +} \ No newline at end of file From aa65f3a115bed9c989b0dc08bbd467e284675def Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 26 Jan 2026 11:25:44 +0100 Subject: [PATCH 27/37] =?UTF-8?q?fix(docs):=20=F0=9F=90=9B=20Fix=20the=20W?= =?UTF-8?q?iki=20links=20to=20point=20to=20a=20internal=20url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../buildteamtools/utils/WikiLinks.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java b/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java index efa27b07..fe6a5ee2 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java @@ -4,25 +4,26 @@ @UtilityClass public class WikiLinks { - private static final String WIKI_BASE_URL = "https://resources.buildtheearth.net/doc/"; - public static final String ENTRY = WIKI_BASE_URL + "build-team-tools-gwhwx9xRsX"; - public static final String GEN = WIKI_BASE_URL + "generator-module-13zqgI4yFA"; - public static final String NAV = WIKI_BASE_URL + "sledgehammer-module-T7I0PWPsTD"; - public static final String MISC = WIKI_BASE_URL + "miscellaneous-appUzeNc5I"; - public static final String STATS = WIKI_BASE_URL + "statistics-module-iM7IfoKroF"; + private static final String WIKI_BASE_URL = "https://resources.buildtheearth.net/s/btt/"; + private static final String WIKI_BASE_URL_DOC = WIKI_BASE_URL + "doc/"; + public static final String ENTRY = WIKI_BASE_URL; + public static final String GEN = WIKI_BASE_URL_DOC + "generator-module-13zqgI4yFA"; + public static final String NAV = WIKI_BASE_URL_DOC + "sledgehammer-module-T7I0PWPsTD"; + public static final String MISC = WIKI_BASE_URL_DOC + "miscellaneous-appUzeNc5I"; + public static final String STATS = WIKI_BASE_URL_DOC + "statistics-module-iM7IfoKroF"; public static final String PLOT = "https://github.com/AlpsBTE/Plot-System/wiki/Installation#setting-up-the-terra-servers"; @UtilityClass public static class Gen { - public static final String RAIL = WIKI_BASE_URL + "rail-generator-EfgKXdBvk1"; - public static final String ROAD = WIKI_BASE_URL + "road-generator-QqKBBP0nqO"; - public static final String TREE = WIKI_BASE_URL + "tree-generator-pnDmYC9hzW"; - public static final String HOUSE = WIKI_BASE_URL + "house-generator-YKQunon6Bp"; - public static final String FIELD = WIKI_BASE_URL + "field-generator-OqIN2BrZT7"; + public static final String RAIL = WIKI_BASE_URL_DOC + "rail-generator-EfgKXdBvk1"; + public static final String ROAD = WIKI_BASE_URL_DOC + "road-generator-QqKBBP0nqO"; + public static final String TREE = WIKI_BASE_URL_DOC + "tree-generator-pnDmYC9hzW"; + public static final String HOUSE = WIKI_BASE_URL_DOC + "house-generator-YKQunon6Bp"; + public static final String FIELD = WIKI_BASE_URL_DOC + "field-generator-OqIN2BrZT7"; @UtilityClass public static class Field { - private static final String CROP_BASE = WIKI_BASE_URL + "crop-types-z7ww6RZK2J"; + private static final String CROP_BASE = WIKI_BASE_URL_DOC + "crop-types-z7ww6RZK2J"; public static final String CROP_POTATO = CROP_BASE + "#h-potato-field"; public static final String CROP_CORN = CROP_BASE + "#h-corn-field"; public static final String CROP_WHEAT = CROP_BASE + "#h-wheat-field"; From 1ca9f4d472dc810cde33fb49511728374255806c Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 26 Jan 2026 11:28:08 +0100 Subject: [PATCH 28/37] =?UTF-8?q?fix(docs):=20=F0=9F=90=9B=20Point=20to=20?= =?UTF-8?q?wiki=20for=20getting=20the=20api=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 8db89e38..697f7cc8 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -6,10 +6,9 @@ # | [Contacts - Discord] BTE Development Hub, @zoriot # ---------------------------------------------------------------------------------------------- -# The Build Team API Key used to fetch build team info for display. Find the key on the Minecraft Network at "buildtheearth.net". -# Navigate: Compass > Build Teams > Your Country > Your Team → Edit > API-Key → Right click on it → Click on the api key in chat. -# Without this key, some plugin components won`t function. For assistance, see #server-support on the staff discord - -# you might need to be added as a owner first. +# The Build Team API Key used to fetch build team info for display. +# Visit https://resources.buildtheearth.net/s/btt/doc/configuration-tpEHSZ6Zt2#h-api-key-of-the-server +# for an up-to-date guide on how to get your own API key. api-key: 00000000-0000-0000-0000-000000000000 # The main world using the custom BTE Dynmaxion projection From d6cd5d57b1fb296ef374aa2f81e1529a7e1f1fc9 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 26 Jan 2026 11:32:38 +0100 Subject: [PATCH 29/37] =?UTF-8?q?fix(build):=20=E2=9C=A8=20Add=20override?= =?UTF-8?q?=20annotation=20to=20getWikiPage=20method=20in=20GeneratorCompo?= =?UTF-8?q?nent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/generator/model/GeneratorComponent.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorComponent.java index 67f41622..cde217d7 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorComponent.java @@ -174,6 +174,7 @@ protected void convertArgsToSettings(Player p, String[] args){ sendHelp(p); } + @Override public String getWikiPage() { return generatorType.getWikiPage(); } From ea6ade8507fcf3f28cd00e9aa426a58253b00073 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 26 Jan 2026 12:25:44 +0100 Subject: [PATCH 30/37] =?UTF-8?q?feat(build):=20=E2=9C=A8=20Remove=20commi?= =?UTF-8?q?t=20distance=20from=20version=20for=20snaps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2afa8b7a..207cdc59 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -37,7 +37,7 @@ val versionDetails: groovy.lang.Closure Date: Mon, 26 Jan 2026 13:29:13 +0100 Subject: [PATCH 31/37] build: ci - add workflow dispatch + change branch to main --- .github/workflows/build.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e87526e..337a15b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,9 +5,10 @@ name: Java CI with Gradle on: push: - branches: [ "master" ] + branches: [ "main" ] pull_request: - branches: [ "master" ] + branches: [ "main" ] + workflow_dispatch: jobs: build: @@ -17,7 +18,7 @@ jobs: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # full history fetch-tags: true # grab your tags @@ -33,12 +34,12 @@ jobs: # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/actions/setup-gradle@v5 - name: Build with Gradle Wrapper run: ./gradlew clean build - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v6 with: name: Staging-Build path: build/libs From 4c9d2ac2f80e253cb4e54599e3ef5c5520c23801 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 26 Jan 2026 14:05:15 +0100 Subject: [PATCH 32/37] fix(generator): require fawe instead of also worldedit --- .../buildteamtools/modules/generator/GeneratorModule.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/GeneratorModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/GeneratorModule.java index 681ede42..c0033b94 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/GeneratorModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/GeneratorModule.java @@ -59,9 +59,8 @@ public void enable() { GeneratorUtils.plugin = BuildTeamTools.getInstance(); // Check if WorldEdit is enabled - if (!CommonModule.getInstance().getDependencyComponent().isWorldEditEnabled() - && !CommonModule.getInstance().getDependencyComponent().isFastAsyncWorldEditEnabled()) { - shutdown("§cWorldEdit is not installed."); + if (!CommonModule.getInstance().getDependencyComponent().isFastAsyncWorldEditEnabled()) { + shutdown("§FastAsyncWorldEdit is not installed."); return; } From a2280e6fdaf1786115e3909e0b65ce825a250355 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 2 Feb 2026 19:29:47 +0100 Subject: [PATCH 33/37] =?UTF-8?q?fix(nav):=20=F0=9F=90=9B=20Add=20other=20?= =?UTF-8?q?warp=20group=20always=20to=20warp=20group=20selection=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/warps/WarpsComponent.java | 12 ++-- .../components/warps/menu/WarpGroupMenu.java | 66 ++++++------------- .../warps/menu/WarpGroupSelectionMenu.java | 16 +++++ 3 files changed, 42 insertions(+), 52 deletions(-) diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java index 43cc4da5..b00a579d 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java @@ -26,8 +26,10 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.NonNull; import java.util.HashMap; +import java.util.List; import java.util.UUID; import java.util.concurrent.CompletableFuture; @@ -135,12 +137,12 @@ public void warpPlayer(Player player, @NotNull Warp warp) { } } - public WarpGroup getOtherWarpGroup() { - return NetworkModule.getInstance().getBuildTeam().getWarpGroups().stream().filter(warpGroup -> warpGroup.getName().equalsIgnoreCase("Other")).findFirst().orElse(null); + public static WarpGroup getOtherWarpGroup(@NonNull List groups) { + return groups.stream().filter(warpGroup -> warpGroup.getName().equalsIgnoreCase("Other")).findFirst().orElse(null); } - public void createWarp(Player creator) { - WarpGroup group = getOtherWarpGroup(); + public static void createWarp(Player creator) { + WarpGroup group = getOtherWarpGroup(NetworkModule.getInstance().getBuildTeam().getWarpGroups()); if (group == null) { group = NavUtils.createOtherWarpGroup(NetworkModule.getInstance().getBuildTeam()); } @@ -151,7 +153,7 @@ public void createWarp(Player creator) { * * @param creator The player that is creating the warp */ - public void createWarp(Player creator, WarpGroup group) { + public static void createWarp(@NonNull Player creator, WarpGroup group) { // Get the geographic coordinates of the player's location. Location location = creator.getLocation(); double[] coordinates = CoordinateConversion.convertToGeo(location.getX(), location.getZ()); diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java index a40f7b79..4df504ad 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java @@ -24,7 +24,6 @@ import java.util.ArrayDeque; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; public class WarpGroupMenu extends AbstractPaginatedMenu { @@ -34,8 +33,8 @@ public class WarpGroupMenu extends AbstractPaginatedMenu { private final boolean hasBackItem; private final BuildTeam buildTeam; - private int plusSlot = ALTERNATE_PLUS_SLOT; private AbstractMenu backMenue; + private final boolean showPlusItem; /** In this menu the player can select a warp group to view the warps in each warp group. * @@ -47,6 +46,8 @@ public WarpGroupMenu(Player menuPlayer, BuildTeam buildTeam, boolean hasBackItem super(4, 3, "Warp Menu", menuPlayer, autoLoad); this.hasBackItem = hasBackItem; this.buildTeam = buildTeam; + this.showPlusItem = getMenuPlayer().hasPermission(Permissions.WARP_GROUP_CREATE) + && NetworkModule.getInstance().getBuildTeam().equals(buildTeam); } public WarpGroupMenu(Player menuPlayer, BuildTeam buildTeam, boolean hasBackItem, boolean autoLoad, AbstractMenu menu) { @@ -72,24 +73,22 @@ protected void setPaginatedPreviewItems(@NotNull List source) { List warpGroups = source.stream().map(l -> (WarpGroup) l).toList(); getMenu().getSlot(ALTERNATE_PLUS_SLOT).setItem(MenuItems.ITEM_BACKGROUND); - final int nextSlot = recalculateAutoSlots(warpGroups); + recalculateAutoSlots(warpGroups); // Create the country items for (WarpGroup warpGroup : warpGroups) { - // Create a create warp group item if the player has permission - if(isPlusItem(warpGroup)){ - setPlusSlot(warpGroup.getInternalSlot(), nextSlot); - getMenu().getSlot(plusSlot).setItem( - Item.createCustomHeadBase64( - CustomHeads.GREEN_PLUS, "§a§lCreate a new Warp Group", - ListUtil.createList("§8Click to create a new warp group.") - ) - ); - continue; - } - getMenu().getSlot(getWarpGroupSlot(warpGroup)).setItem(warpGroup.getMaterialItem()); } + + // Create a create warp group item if the player has permission + if (showPlusItem) { + getMenu().getSlot(ALTERNATE_PLUS_SLOT).setItem( + Item.createCustomHeadBase64( + CustomHeads.GREEN_PLUS, "§a§lCreate a new Warp Group", + ListUtil.createList("§8Click to create a new warp group.") + ) + ); + } } @Override @@ -117,19 +116,9 @@ protected List getSource() { .getString(ConfigPaths.Navigation.WARPS_GROUP_SORTING_MODE, ""); if (mode.equalsIgnoreCase("name")) { - warpGroups = buildTeam.getWarpGroups().stream().sorted((warpGroup1, warpGroup2) -> warpGroup1.getName().compareToIgnoreCase(warpGroup2.getName())).collect(Collectors.toList()); + warpGroups = buildTeam.getWarpGroups().stream().sorted((warpGroup1, warpGroup2) -> warpGroup1.getName().compareToIgnoreCase(warpGroup2.getName())).toList(); } else warpGroups = new ArrayList<>(buildTeam.getWarpGroups()); - // If the warp group "Other" has no warps, remove it from the list - WarpGroup otherWarpGroup = warpGroups.stream().filter(warpGroup -> warpGroup.getName().equalsIgnoreCase("Other")).findFirst().orElse(null); - if (otherWarpGroup != null && otherWarpGroup.getWarps().isEmpty()) - warpGroups.remove(otherWarpGroup); - - // Add a create warp group item if the player has permission - if (getMenuPlayer().hasPermission(Permissions.WARP_GROUP_CREATE) - && NetworkModule.getInstance().getBuildTeam().equals(buildTeam)) - warpGroups.add(new WarpGroup(null, "%create-warp-group%", null, -1, null)); - return warpGroups; } @@ -143,32 +132,25 @@ protected void setPaginatedItemClickEventsAsync(@NotNull List source) { } protected void setClickEventForSlot(@NotNull WarpGroup warpGroup) { - final int _slot = isPlusItem(warpGroup) ? plusSlot : getWarpGroupSlot(warpGroup); + final int _slot = getWarpGroupSlot(warpGroup); getMenu().getSlot(_slot).setClickHandler((clickPlayer, clickInformation) -> { clickPlayer.closeInventory(); - // Create a click action for the "Create Warp" item if the player has permission - if(isPlusItem(warpGroup)){ - NavigationModule.getInstance().getWarpsComponent().createWarpGroup(clickPlayer); - return; - } - if(clickInformation.getClickType().isRightClick() && clickPlayer.hasPermission(Permissions.WARP_GROUP_EDIT)) new WarpGroupEditMenu(clickPlayer, warpGroup, true, true); else leftClickAction(clickPlayer, warpGroup); }); + + getMenu().getSlot(ALTERNATE_PLUS_SLOT).setClickHandler((clickPlayer, clickInformation) + -> NavigationModule.getInstance().getWarpsComponent().createWarpGroup(clickPlayer)); } protected void leftClickAction(Player clickPlayer, @NotNull WarpGroup warpGroup) { new WarpMenu(clickPlayer, warpGroup, true, true); } - protected boolean isPlusItem(@NotNull WarpGroup warpGroup){ - return warpGroup.getName().equals("%create-warp-group%") && getMenuPlayer().hasPermission(Permissions.WARP_GROUP_CREATE); - } - protected int getWarpGroupSlot(@NotNull WarpGroup g) { int s = g.getSlot(); if (s >= 0 && s <= 26) return s; @@ -176,16 +158,6 @@ protected int getWarpGroupSlot(@NotNull WarpGroup g) { return a >= 0 && a <= 26 ? a : -1; } - protected void setPlusSlot(int internalSlot, int freeSlot){ - if(internalSlot >= 0) { - plusSlot = internalSlot; - return; - } - - if(freeSlot < 0) return; - plusSlot = freeSlot; - } - /** * Recalculates automatic slot assignments for the given warp groups. *

diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java index 25ca84a1..62d5b795 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupSelectionMenu.java @@ -1,12 +1,18 @@ package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu; +import net.buildtheearth.buildteamtools.modules.navigation.NavUtils; +import net.buildtheearth.buildteamtools.modules.navigation.components.warps.WarpsComponent; import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp; import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup; +import net.buildtheearth.buildteamtools.modules.network.NetworkModule; import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; +import java.util.List; +import java.util.stream.Collectors; + public class WarpGroupSelectionMenu extends WarpGroupMenu { private final Warp warp; @@ -35,6 +41,16 @@ protected void setItemClickEventsAsync() { }); } + @Override + protected List getSource() { + var source = super.getSource().stream().map(l -> (WarpGroup) l).collect(Collectors.toList()); + + var otherWarp = WarpsComponent.getOtherWarpGroup(source); + if (otherWarp == null) source.add(NavUtils.createOtherWarpGroup(NetworkModule.getInstance().getBuildTeam())); + + return source; + } + @Override protected void leftClickAction(@NotNull Player clickPlayer, @NotNull WarpGroup warpGroup) { clickPlayer.playSound(clickPlayer.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1.0F, 1.0F); From 08112b71fc2eaca06042d657f9ee56b27e59fc6c Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 2 Feb 2026 19:42:49 +0100 Subject: [PATCH 34/37] feat: change from sledgehammer to navigation --- README.md | 2 +- .../java/net/buildtheearth/buildteamtools/utils/WikiLinks.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e40c361b..5d982f8e 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Special thanks to the people currently working on the plugin: ## Index Click the links below for more information, or see the [wiki](https://resources.buildtheearth.net/s/btt). -- [Sledgehammer](https://resources.buildtheearth.net/s/btt/doc/sledgehammer-module-T7I0PWPsTD) +- [Navigation](https://resources.buildtheearth.net/s/btt/doc/navigation-module-T7I0PWPsTD) - [Generators](https://resources.buildtheearth.net/s/btt/doc/generator-module-13zqgI4yFA) - [Houses](https://resources.buildtheearth.net/s/btt/doc/house-generator-YKQunon6Bp) - [Roads](https://resources.buildtheearth.net/s/btt/doc/road-generator-QqKBBP0nqO) diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java b/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java index fe6a5ee2..4dd1ba5e 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java +++ b/src/main/java/net/buildtheearth/buildteamtools/utils/WikiLinks.java @@ -8,7 +8,7 @@ public class WikiLinks { private static final String WIKI_BASE_URL_DOC = WIKI_BASE_URL + "doc/"; public static final String ENTRY = WIKI_BASE_URL; public static final String GEN = WIKI_BASE_URL_DOC + "generator-module-13zqgI4yFA"; - public static final String NAV = WIKI_BASE_URL_DOC + "sledgehammer-module-T7I0PWPsTD"; + public static final String NAV = WIKI_BASE_URL_DOC + "navigation-module-T7I0PWPsTD"; public static final String MISC = WIKI_BASE_URL_DOC + "miscellaneous-appUzeNc5I"; public static final String STATS = WIKI_BASE_URL_DOC + "statistics-module-iM7IfoKroF"; public static final String PLOT = "https://github.com/AlpsBTE/Plot-System/wiki/Installation#setting-up-the-terra-servers"; From 23a79919b13eef5f8149a9911b317e2d1b631bdf Mon Sep 17 00:00:00 2001 From: Zoriot Date: Mon, 2 Feb 2026 21:24:46 +0100 Subject: [PATCH 35/37] feat: update readme --- README.md | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 5d982f8e..c9e2e1b9 100644 --- a/README.md +++ b/README.md @@ -29,33 +29,34 @@
- ## About The Plugin -BuildTeamTools offers a comprehensive suite of tools designed to enhance the building and exploration experience in BuildTheEarth.
Whether you're a casual creator or an experienced builder, the plugin provides powerful features such as Generators, Navigators, Warps, PlotSystem, Statistics and more to streamline your workflow. +BuildTeamTools offers a comprehensive suite of tools designed to enhance the building and exploration experience in +BuildTheEarth. +Whether you're a casual creator or an experienced builder, the plugin provides powerful features such as Generators, +Navigators, Warps, Statistics and more to streamline your workflow. Its primary goal is to significantly speed up the building process by eliminating repetitive tasks while also providing an intuitive entry point for newcomers to the project. - ## Features -🔨 **Easy-to-use** Tools for everything around BuildTheEarth
-⏱ **Multi-Version** support from `1.18` - `1.21.x`
-✔️ **User-friendly** GUIs and Commands
-📆 **Automatic** Updates
-🔌 **Easy setup** and configuration
-**Multi-Language** Support (PLANNED)
- - + +🔨 **Easy-to-use** Tools +⏱ **Multi-Version** support from `1.18` - `1.21.x` +✔️ **User-friendly** GUIs and Commands +📆 **Automatic** Updates +🔌 **Easy setup** and configuration + ## Components - - - - - - + +![Nav Module Overview](https://raw.githubusercontent.com/BuildTheEarth/assets/0f7a4f0e9c5a7ce9ab41636182d93e9d1948c4a1/images/btt/features/Navigation.png) +![Generator Module Overview](https://raw.githubusercontent.com/BuildTheEarth/assets/0f7a4f0e9c5a7ce9ab41636182d93e9d1948c4a1/images/btt/features/Generator.png) +![PlotSystem Module Overview](https://raw.githubusercontent.com/BuildTheEarth/assets/0f7a4f0e9c5a7ce9ab41636182d93e9d1948c4a1/images/btt/features/PlotSystem.png) +![Statistics Module Overview](https://raw.githubusercontent.com/BuildTheEarth/assets/0f7a4f0e9c5a7ce9ab41636182d93e9d1948c4a1/images/btt/features/Statistics.png) +![Tutorials Module Overview](https://raw.githubusercontent.com/BuildTheEarth/assets/0f7a4f0e9c5a7ce9ab41636182d93e9d1948c4a1/images/btt/features/Tutorials.png)

-The **\*** symbol shows that this feature is still being developed or under maintenance +The **\*** symbol shows that this feature is still being developed or under maintenance. *This image might be slightly +outdated.*

@@ -67,11 +68,12 @@ The **\*** symbol shows that this feature is still being developed or under main 🚩 **How to install:** 1. Download BuildTeamTools [here](https://www.spigotmc.org/resources/buildteamtools.101854/). 2. Place the downloaded plugin in your server's **../plugins** folder. -3. *(Optional)* Some of the modules require initial configuration or dependencies to run: +3. *(Optional)* Some modules require initial configuration or dependencies to run: > - To activate the **Navigation Module**, please configure an **API Key** in the config.yml file. > - To activate the **Network Module**, please configure an **API Key** in the config.yml file. > - To activate the **Generator Module**, please install the [FastAsyncWorldEdit](https://modrinth.com/plugin/fastasyncworldedit/versions/) plugin. -> - To activate the **Tree Generator Component**, install the [SchematicBrush 0.5.2](https://dev.bukkit.org/projects/schematicbrush) plugin. +> - To activate the **Tree Generator Component**, install + the [SchematicBrushReborn v1](https://www.spigotmc.org/resources/schematic-brush-reborn.79441/history) plugin. 4. Restart your server. 5. Done! @@ -89,7 +91,8 @@ Special thanks to the people currently working on the plugin: - **[frikandelworst](https://github.com/kyanvde)** - **[MineFact](https://github.com/MineFact)** -## Index +## Infos + Click the links below for more information, or see the [wiki](https://resources.buildtheearth.net/s/btt). - [Navigation](https://resources.buildtheearth.net/s/btt/doc/navigation-module-T7I0PWPsTD) @@ -98,9 +101,7 @@ Click the links below for more information, or see the [wiki](https://resources. - [Roads](https://resources.buildtheearth.net/s/btt/doc/road-generator-QqKBBP0nqO) - [Railways [Currently Broken]](https://resources.buildtheearth.net/s/btt/doc/rail-generator-EfgKXdBvk1) - [Trees](https://resources.buildtheearth.net/s/btt/doc/tree-generator-pnDmYC9hzW) - - [Fields](https://resources.buildtheearth.net/s/btt/doc/field-generator-OqIN2BrZT7) + - [Fields [Currently Broken]](https://resources.buildtheearth.net/s/btt/doc/field-generator-OqIN2BrZT7) - [Statistics](https://resources.buildtheearth.net/s/btt/doc/statistics-module-iM7IfoKroF) - [Miscellaneous](https://resources.buildtheearth.net/doc/miscellaneous-appUzeNc5I) - [Block Palette GUI](https://resources.buildtheearth.net/doc/block-palette-gui-hW8InCtxcq) -- Tutorials (PLANNED) -- Plot System (PLANNED - use [PST](https://github.com/AlpsBTE/Plot-System-Terra) for now) From 52ee033f70de51e106014ffdc8e5d66053e300e2 Mon Sep 17 00:00:00 2001 From: redstoner507 Date: Tue, 3 Feb 2026 13:59:22 +0100 Subject: [PATCH 36/37] Included the basic metrics of bStats --- build.gradle.kts | 1 + gradle/libs.versions.toml | 2 ++ .../buildteamtools/modules/common/CommonModule.java | 2 ++ .../modules/common/metrics/MetricsManager.java | 13 +++++++++++++ 4 files changed, 18 insertions(+) create mode 100644 src/main/java/net/buildtheearth/buildteamtools/modules/common/metrics/MetricsManager.java diff --git a/build.gradle.kts b/build.gradle.kts index 207cdc59..480455f2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,6 +27,7 @@ dependencies { exclude(group = "com.sun.xml.bind", module = "jaxb-xjc") // Else Remapping will yell of duplicated classes } implementation(libs.com.googlecode.json.simple) + implementation(libs.bstats.bukkit) implementation(platform(libs.fawe.bom)) compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core") compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit") { isTransitive = false } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7a8cdee4..0f603a87 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,6 +20,7 @@ com-gradleup-shadow = "9.3.1" # https://github.com/GradleUp/shadow/releases alpslib-io = "1.2.0" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-io/ alpslib-utils = "1.4.0" # https://mvn.alps-bte.com/service/rest/repository/browse/alps-bte/com/alpsbte/alpslib/alpslib-utils/ fawe-bom = "1.55" # Ref: https://github.com/IntellectualSites/bom +bstats = "3.1.0" # https://central.sonatype.com/artifact/org.bstats/bstats-bukkit [libraries] com-alpsbte-alpslib-alpslib-libpsterra = { module = "com.alpsbte.alpslib:alpslib-libpsterra", version.ref = "com-alpsbte-alpslib-alpslib-libpsterra" } @@ -37,6 +38,7 @@ com-googlecode-json-simple = { module = "com.googlecode.json-simple:json-simple" alpslib-io = { module = "com.alpsbte.alpslib:alpslib-io", version.ref = "alpslib-io" } alpslib-utils = { module = "com.alpsbte.alpslib:alpslib-utils", version.ref = "alpslib-utils" } fawe-bom = { module = "com.intellectualsites.bom:bom-newest", version.ref = "fawe-bom" } +bstats-bukkit = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" } [plugins] lombok = { id = "io.freefair.lombok", version.ref = "io-freefair-lombok" } diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/common/CommonModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/CommonModule.java index 0f4811f3..13882c4e 100644 --- a/src/main/java/net/buildtheearth/buildteamtools/modules/common/CommonModule.java +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/CommonModule.java @@ -13,6 +13,7 @@ import net.buildtheearth.buildteamtools.modules.common.components.version.VersionComponent; import net.buildtheearth.buildteamtools.modules.common.listeners.CommandListener; import net.buildtheearth.buildteamtools.modules.common.listeners.ExceptionListener; +import net.buildtheearth.buildteamtools.modules.common.metrics.MetricsManager; import net.buildtheearth.buildteamtools.modules.generator.GeneratorModule; import net.buildtheearth.buildteamtools.modules.network.NetworkModule; import net.buildtheearth.buildteamtools.modules.stats.StatsModule; @@ -75,6 +76,7 @@ public void enable() { dependencyComponent = new DependencyComponent(); versionComponent = new VersionComponent(); + MetricsManager.init(BuildTeamTools.getInstance()); // Start the timer startTimer(); diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/common/metrics/MetricsManager.java b/src/main/java/net/buildtheearth/buildteamtools/modules/common/metrics/MetricsManager.java new file mode 100644 index 00000000..73ecee20 --- /dev/null +++ b/src/main/java/net/buildtheearth/buildteamtools/modules/common/metrics/MetricsManager.java @@ -0,0 +1,13 @@ +package net.buildtheearth.buildteamtools.modules.common.metrics; + +import org.bstats.bukkit.Metrics; +import org.bukkit.plugin.java.JavaPlugin; + +public class MetricsManager { + + private static final int BSTATS_PLUGIN_ID = 29076; + + public static void init(JavaPlugin plugin) { + new Metrics(plugin, BSTATS_PLUGIN_ID); + } +} From 48046cf7a5b251f174cbb19967f25d0e3abb6dc7 Mon Sep 17 00:00:00 2001 From: Zoriot Date: Tue, 3 Feb 2026 15:28:42 +0100 Subject: [PATCH 37/37] build(qodana): Add all qodana includes + baseline & pr analysis --- .github/workflows/qodana.sarif.json | 62627 ++++++++++++++++++++ .github/workflows/qodana_code_quality.yml | 7 +- qodana.yaml | 11 +- 3 files changed, 62638 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/qodana.sarif.json diff --git a/.github/workflows/qodana.sarif.json b/.github/workflows/qodana.sarif.json new file mode 100644 index 00000000..581fe96d --- /dev/null +++ b/.github/workflows/qodana.sarif.json @@ -0,0 +1,62627 @@ +{ + "$schema": "https://raw.githubusercontent.com/schemastore/schemastore/master/src/schemas/json/sarif-2.1.0-rtm.5.json", + "version": "2.1.0", + "runs": [ + { + "tool": { + "driver": { + "name": "QDJVMC", + "fullName": "Qodana Community for JVM", + "version": "252.28459", + "rules": [], + "taxa": [ + { + "id": "Language injection", + "name": "Language injection" + }, + { + "id": "Maven", + "name": "Maven" + }, + { + "id": "Kotlin", + "name": "Kotlin" + }, + { + "id": "Kotlin/Style issues", + "name": "Style issues", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JVM languages", + "name": "JVM languages" + }, + { + "id": "Kotlin/Redundant constructs", + "name": "Redundant constructs", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java", + "name": "Java" + }, + { + "id": "Java/Portability", + "name": "Portability", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Threading issues", + "name": "Threading issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Internationalization", + "name": "Internationalization", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Performance", + "name": "Performance", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Code style issues", + "name": "Code style issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Class structure", + "name": "Class structure", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Probable bugs", + "name": "Probable bugs", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Declaration redundancy", + "name": "Declaration redundancy", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Error handling", + "name": "Error handling", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Pattern validation", + "name": "Pattern validation" + }, + { + "id": "Java/Serialization issues", + "name": "Serialization issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Performance/Embedded", + "name": "Embedded", + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy", + "name": "Groovy" + }, + { + "id": "Groovy/GPath", + "name": "GPath", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Imports", + "name": "Imports", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Data flow", + "name": "Data flow", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Kotlin/Probable bugs", + "name": "Probable bugs", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Inheritance issues", + "name": "Inheritance issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Numeric issues", + "name": "Numeric issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Control flow issues", + "name": "Control flow issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Plugin DevKit", + "name": "Plugin DevKit" + }, + { + "id": "Plugin DevKit/Plugin descriptor", + "name": "Plugin descriptor", + "relationships": [ + { + "target": { + "id": "Plugin DevKit", + "index": 27, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Initialization", + "name": "Initialization", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HTML", + "name": "HTML" + }, + { + "id": "Java/Security", + "name": "Security", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Properties files", + "name": "Properties files" + }, + { + "id": "EditorConfig", + "name": "EditorConfig" + }, + { + "id": "Plugin DevKit/Code", + "name": "Code", + "relationships": [ + { + "target": { + "id": "Plugin DevKit", + "index": 27, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/JavaBeans issues", + "name": "JavaBeans issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Assignment issues", + "name": "Assignment issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Naming conventions", + "name": "Naming conventions", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Packaging issues", + "name": "Packaging issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Verbose or redundant code constructs", + "name": "Verbose or redundant code constructs", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Threading issues", + "name": "Threading issues", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Gradle", + "name": "Gradle" + }, + { + "id": "Gradle/Probable bugs", + "name": "Probable bugs", + "relationships": [ + { + "target": { + "id": "Gradle", + "index": 41, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Error handling", + "name": "Error handling", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "General", + "name": "General" + }, + { + "id": "Java/Javadoc", + "name": "Javadoc", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JVM languages/Logging", + "name": "Logging", + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Resource management", + "name": "Resource management", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Gradle/Validity issues", + "name": "Validity issues", + "relationships": [ + { + "target": { + "id": "Gradle", + "index": 41, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Kotlin/Naming conventions", + "name": "Naming conventions", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Code maturity", + "name": "Code maturity", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Naming conventions", + "name": "Naming conventions", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids", + "name": "Java language level migration aids", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 5", + "name": "Java 5", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Probable bugs", + "name": "Probable bugs", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Plugin DevKit/Workspace model", + "name": "Workspace model", + "relationships": [ + { + "target": { + "id": "Plugin DevKit", + "index": 27, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Visibility", + "name": "Visibility", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Lombok", + "name": "Lombok", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Lombok/Redundant definitions", + "name": "Redundant definitions", + "relationships": [ + { + "target": { + "id": "Java/Lombok", + "index": 57, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Encapsulation", + "name": "Encapsulation", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Concurrency annotation issues", + "name": "Concurrency annotation issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 8", + "name": "Java 8", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level issues", + "name": "Java language level issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XML", + "name": "XML" + }, + { + "id": "Java/Finalization", + "name": "Finalization", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Assignment issues", + "name": "Assignment issues", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Modularization issues", + "name": "Modularization issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Kotlin/Java interop issues", + "name": "Java interop issues", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Naming conventions/Class", + "name": "Class", + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Memory", + "name": "Memory", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Control flow issues", + "name": "Control flow issues", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Code", + "name": "Code" + }, + { + "id": "Groovy/Potentially confusing code constructs", + "name": "Potentially confusing code constructs", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/TestNG", + "name": "TestNG", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JUnit", + "name": "JUnit" + }, + { + "id": "Kotlin/Other problems", + "name": "Other problems", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Abstraction issues", + "name": "Abstraction issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 21", + "name": "Java 21", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 9", + "name": "Java 9", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/JUnit", + "name": "JUnit", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Kotlin/Numeric issues", + "name": "Numeric issues", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Other", + "name": "Other", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Cloning issues", + "name": "Cloning issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Style", + "name": "Style", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExp", + "name": "RegExp" + }, + { + "id": "Kotlin/Migration", + "name": "Migration", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Kotlin/Migration/Gradle", + "name": "Gradle", + "relationships": [ + { + "target": { + "id": "Kotlin/Migration", + "index": 85, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Kotlin/Code migration", + "name": "Code migration", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UI form", + "name": "UI form" + }, + { + "id": "Java/Lombok/Redundant modifiers", + "name": "Redundant modifiers", + "relationships": [ + { + "target": { + "id": "Java/Lombok", + "index": 57, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Class metrics", + "name": "Class metrics", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Naming conventions/Method", + "name": "Method", + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 25", + "name": "Java 25", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Dependency issues", + "name": "Dependency issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Compiler issues", + "name": "Compiler issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Annotations", + "name": "Annotations", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Proofreading", + "name": "Proofreading" + }, + { + "id": "Manifest", + "name": "Manifest" + }, + { + "id": "Java/Logging", + "name": "Logging", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Kotlin/Coroutine inspections", + "name": "Coroutine inspections", + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JVM languages/Test frameworks", + "name": "Test frameworks", + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Method metrics", + "name": "Method metrics", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Test frameworks", + "name": "Test frameworks", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Bitwise operation issues", + "name": "Bitwise operation issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Reflective access", + "name": "Reflective access", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 15", + "name": "Java 15", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 14", + "name": "Java 14", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Validity issues", + "name": "Validity issues", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Numeric issues/Cast", + "name": "Cast", + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Plugin DevKit/Description file", + "name": "Description file", + "relationships": [ + { + "target": { + "id": "Plugin DevKit", + "index": 27, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 23", + "name": "Java 23", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JSON and JSON5", + "name": "JSON and JSON5" + }, + { + "id": "Groovy/Data flow", + "name": "Data flow", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Method metrics", + "name": "Method metrics", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Kotlin/Migration/Maven", + "name": "Maven", + "relationships": [ + { + "target": { + "id": "Kotlin/Migration", + "index": 85, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Internationalization", + "name": "Internationalization" + }, + { + "id": "Java/Java language level migration aids/Java 10", + "name": "Java 10", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 16", + "name": "Java 16", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Java language level migration aids/Java 7", + "name": "Java 7", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Version control", + "name": "Version control" + }, + { + "id": "Java/Properties files", + "name": "Properties files", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java/Probable bugs/Nullability problems", + "name": "Nullability problems", + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Structural search", + "name": "Structural search" + }, + { + "id": "Java/toString() issues", + "name": "toString() issues", + "relationships": [ + { + "target": { + "id": "Java", + "index": 6, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RELAX NG", + "name": "RELAX NG" + }, + { + "id": "Java/Java language level migration aids/Java 11", + "name": "Java 11", + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Qodana", + "name": "Qodana" + }, + { + "id": "Code metrics", + "name": "Code metrics" + }, + { + "id": "Gradle/Best practises", + "name": "Best practises", + "relationships": [ + { + "target": { + "id": "Gradle", + "index": 41, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Groovy/Declaration redundancy", + "name": "Declaration redundancy", + "relationships": [ + { + "target": { + "id": "Groovy", + "index": 19, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + "extensions": [ + { + "name": "org.intellij.intelliLang", + "version": "252.28459.0", + "rules": [ + { + "id": "InjectionNotApplicable", + "shortDescription": { + "text": "Injection annotation is not applicable" + }, + "fullDescription": { + "text": "Reports when a '@Language' annotation is applied to an element with a type other than 'String' or 'String[]'. Example: '@Language(\"HTML\") int i;' After the quick-fix is applied: 'int i;' Inspection ID: InjectionNotApplicable", + "markdown": "Reports when a `@Language` annotation is applied to an element with a type other than `String` or `String[]`.\n\n**Example:**\n\n\n @Language(\"HTML\") int i;\n\nAfter the quick-fix is applied:\n\n\n int i;\n\nInspection ID: InjectionNotApplicable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "InjectionNotApplicable", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Language injection", + "index": 0, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PatternNotApplicable", + "shortDescription": { + "text": "Pattern annotation is not applicable" + }, + "fullDescription": { + "text": "Reports when a '@Pattern' annotation is applied to an element with a type other than 'String'. Example: '@Pattern(\"\\\\d\\\\d\") int i;' Inspection ID: PatternNotApplicable", + "markdown": "Reports when a `@Pattern` annotation is applied to an element with a type other than `String`.\n\n**Example:**\n\n\n @Pattern(\"\\\\d\\\\d\") int i;\n\nInspection ID: PatternNotApplicable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "PatternNotApplicable", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Pattern validation", + "index": 16, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnknownLanguage", + "shortDescription": { + "text": "Unknown Language ID" + }, + "fullDescription": { + "text": "Reports when the ID of the language used in a '@Language' annotation is unknown. Example: '@Language(\"HMTL\") String html;' Inspection ID: UnknownLanguage", + "markdown": "Reports when the ID of the language used in a `@Language` annotation is unknown.\n\n**Example:**\n\n\n @Language(\"HMTL\") String html;\n\nInspection ID: UnknownLanguage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "UnknownLanguage", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Language injection", + "index": 0, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PatternOverriddenByNonAnnotatedMethod", + "shortDescription": { + "text": "Non-annotated Method overrides @Pattern Method" + }, + "fullDescription": { + "text": "Reports when a method without any '@Pattern' annotation overrides a '@Pattern' annotated method. This does not prevent error-highlighting inside the editor, however the overriding method will not be checked at runtime. A quick fix is provided to add a '@Pattern' annotation that matches the one from the superclass method. This ensures the runtime-check instrumentation works correctly. Example: 'abstract class Parent {\n abstract @Pattern(\"\\\\d\\\\d-\\\\d\\\\d\\\\d\") String getId();\n }\n class Child extends Parent {\n @Override String getId() { // warning here\n return \"12-345\";\n }\n }' Inspection ID: PatternOverriddenByNonAnnotatedMethod", + "markdown": "Reports when a method without any `@Pattern` annotation overrides a `@Pattern` annotated method. This does not prevent error-highlighting inside the editor, however the overriding method will not be checked at runtime.\n\n\nA quick fix is provided to add a `@Pattern` annotation that matches the one from the superclass method. This ensures the\nruntime-check instrumentation works correctly.\n\n**Example:**\n\n\n abstract class Parent {\n abstract @Pattern(\"\\\\d\\\\d-\\\\d\\\\d\\\\d\") String getId();\n }\n class Child extends Parent {\n @Override String getId() { // warning here\n return \"12-345\";\n }\n }\n\nInspection ID: PatternOverriddenByNonAnnotatedMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PatternOverriddenByNonAnnotatedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Pattern validation", + "index": 16, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InjectedReferences", + "shortDescription": { + "text": "Injected references" + }, + "fullDescription": { + "text": "Reports unresolved references injected by Language Injections. Example: '@Language(\"file-reference\")\n String fileName = \"/home/user/nonexistent.file\"; // highlighted if file doesn't exist' Inspection ID: InjectedReferences", + "markdown": "Reports unresolved references injected by [Language Injections](https://www.jetbrains.com/help/idea/using-language-injections.html).\n\nExample:\n\n\n @Language(\"file-reference\")\n String fileName = \"/home/user/nonexistent.file\"; // highlighted if file doesn't exist\n\nInspection ID: InjectedReferences" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "InjectedReferences", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PatternValidation", + "shortDescription": { + "text": "Validate annotated patterns" + }, + "fullDescription": { + "text": "Reports expressions passed as arguments for '@Pattern' parameters and returned from '@Pattern'-annotated methods that do not match the specified pattern. Example: '@Pattern(\"\\\\d\\\\d-\\\\d\\\\d\\\\d\") String getId() {\n return \"1\";\n }' Use the Flag non compile-time constant expressions option to let the inspection report expressions with an unknown value and offer to add a substitution ('@Subst') annotation. Inspection ID: PatternValidation", + "markdown": "Reports expressions passed as arguments for `@Pattern` parameters and returned from `@Pattern`-annotated methods that do not match the specified pattern.\n\n**Example:**\n\n\n @Pattern(\"\\\\d\\\\d-\\\\d\\\\d\\\\d\") String getId() {\n return \"1\";\n }\n\n\nUse the **Flag non compile-time constant expressions** option to let the inspection report expressions with\nan unknown value and offer to add a substitution (`@Subst`) annotation.\n\nInspection ID: PatternValidation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PatternValidation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Pattern validation", + "index": 16, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LanguageMismatch", + "shortDescription": { + "text": "Language mismatch" + }, + "fullDescription": { + "text": "Reports when the language of a reference does not match the expected language of the usage context. Example: '@Language(\"JavaScript\")\n String JS_CODE = \"var x;\";\n\n @Language(\"XPath\")\n String XPATH_CODE = JS_CODE; // warning here' Inspection ID: LanguageMismatch", + "markdown": "Reports when the language of a reference does not match the expected language of the usage context.\n\nExample:\n\n\n @Language(\"JavaScript\")\n String JS_CODE = \"var x;\";\n\n @Language(\"XPath\")\n String XPATH_CODE = JS_CODE; // warning here\n\nInspection ID: LanguageMismatch" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LanguageMismatch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Language injection", + "index": 0, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.jetbrains.idea.maven", + "version": "252.28459.0", + "rules": [ + { + "id": "MavenRedundantGroupId", + "shortDescription": { + "text": "Redundant groupId" + }, + "fullDescription": { + "text": "Reports the unnecessary definition since it is already defined in the parent pom.xml Inspection ID: MavenRedundantGroupId", + "markdown": "Reports the unnecessary \\ definition since it is already defined in the parent pom.xml\n\nInspection ID: MavenRedundantGroupId" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MavenRedundantGroupId", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenDuplicatePluginInspection", + "shortDescription": { + "text": "Duplicate plugin declaration" + }, + "fullDescription": { + "text": "Reports the duplication of the plugin declaration in pom.xml Inspection ID: MavenDuplicatePluginInspection", + "markdown": "Reports the duplication of the plugin declaration in pom.xml\n\nInspection ID: MavenDuplicatePluginInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MavenDuplicatePluginInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenNewElementsInOldSchema", + "shortDescription": { + "text": "Wrong model version. Model version should be 4.1.0 for this tag" + }, + "fullDescription": { + "text": "Reports the new model tags in the old project schema and suggests updating the project schema Inspection ID: MavenNewElementsInOldSchema", + "markdown": "Reports the new model tags in the old project schema\n\n\nand suggests updating the project schema\n\nInspection ID: MavenNewElementsInOldSchema" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MavenNewElementsInOldSchema", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenPropertyInParent", + "shortDescription": { + "text": "Usage of properties in parent description" + }, + "fullDescription": { + "text": "Reports that the usage of properties in modules parent definition is prohibited Inspection ID: MavenPropertyInParent", + "markdown": "Reports that the usage of properties in modules parent definition is prohibited\n\nInspection ID: MavenPropertyInParent" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MavenPropertyInParent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenModelVersionMissed", + "shortDescription": { + "text": "'modelVersion' child tag should be defined" + }, + "fullDescription": { + "text": "Reports the absence of tag For Maven 4 and newer, it is optional, as it is derived from schema location. Inspection ID: MavenModelVersionMissed", + "markdown": "Reports the absence of \\ tag\n\n\nFor Maven 4 and newer, it is optional, as it is derived from schema location.\n\nInspection ID: MavenModelVersionMissed" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MavenModelVersionMissed", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenDuplicateDependenciesInspection", + "shortDescription": { + "text": "Duplicate Dependencies" + }, + "fullDescription": { + "text": "Reports duplicate dependencies Inspection ID: MavenDuplicateDependenciesInspection", + "markdown": "Reports duplicate dependencies\n\nInspection ID: MavenDuplicateDependenciesInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MavenDuplicateDependenciesInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenNewModelVersionInOldSchema", + "shortDescription": { + "text": "Wrong model version. Model version should be 4.1.0 for this tag" + }, + "fullDescription": { + "text": "Reports the new model version in the old project schema and suggests updating the project schema Inspection ID: MavenNewModelVersionInOldSchema", + "markdown": "Reports the new model version in the old project schema\n\n\nand suggests updating the project schema\n\nInspection ID: MavenNewModelVersionInOldSchema" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MavenNewModelVersionInOldSchema", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenParentMissedGroupIdArtifactIdInspection", + "shortDescription": { + "text": "Parent groupId or artifactId is missing" + }, + "fullDescription": { + "text": "Reports the absence of and elements in the tag. (for Maven 4 and later, they are optional if a parent POM could be found by the relativePath). Inspection ID: MavenParentMissedGroupIdArtifactIdInspection", + "markdown": "Reports the absence of \\ and \\ elements in the \\ tag.\n\n(for Maven 4 and later, they are optional if a parent POM could be found by the relativePath).\n\nInspection ID: MavenParentMissedGroupIdArtifactIdInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MavenParentMissedGroupIdArtifactIdInspection", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenModelInspection", + "shortDescription": { + "text": "Maven Model Inspection" + }, + "fullDescription": { + "text": "Reports resolution problems in a Maven model Inspection ID: MavenModelInspection", + "markdown": "Reports resolution problems in a Maven model\n\nInspection ID: MavenModelInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MavenModelInspection", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenParentMissedVersionInspection", + "shortDescription": { + "text": "Parent version missed" + }, + "fullDescription": { + "text": "Reports the absence of the parent version element for versions that do not support consumer POM feature Inspection ID: MavenParentMissedVersionInspection", + "markdown": "Reports the absence of the parent version element for versions that do not support consumer POM feature\n\nInspection ID: MavenParentMissedVersionInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MavenParentMissedVersionInspection", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Maven", + "index": 1, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.jetbrains.kotlin", + "version": "252.28459.0-IJ", + "rules": [ + { + "id": "RedundantRunCatching", + "shortDescription": { + "text": "Redundant 'runCatching' call" + }, + "fullDescription": { + "text": "Reports 'runCatching' calls that are immediately followed by 'getOrThrow'. Such calls can be replaced with just 'run'. Example: 'fun foo() = runCatching { doSomething() }.getOrThrow()' After the quick-fix is applied: 'fun foo() = run { doSomething() }' Inspection ID: RedundantRunCatching", + "markdown": "Reports `runCatching` calls that are immediately followed by `getOrThrow`. Such calls can be replaced with just `run`.\n\n**Example:**\n\n\n fun foo() = runCatching { doSomething() }.getOrThrow()\n\nAfter the quick-fix is applied:\n\n\n fun foo() = run { doSomething() }\n\nInspection ID: RedundantRunCatching" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantRunCatching", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimpleRedundantLet", + "shortDescription": { + "text": "Redundant receiver-based 'let' call" + }, + "fullDescription": { + "text": "Reports redundant receiver-based 'let' calls. The quick-fix removes the redundant 'let' call. Example: 'fun test(s: String?): Int? = s?.let { it.length }' After the quick-fix is applied: 'fun test(s: String?): Int? = s?.length' Inspection ID: SimpleRedundantLet", + "markdown": "Reports redundant receiver-based `let` calls.\n\nThe quick-fix removes the redundant `let` call.\n\n**Example:**\n\n\n fun test(s: String?): Int? = s?.let { it.length }\n\nAfter the quick-fix is applied:\n\n\n fun test(s: String?): Int? = s?.length\n\nInspection ID: SimpleRedundantLet" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SimpleRedundantLet", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveSingleExpressionStringTemplate", + "shortDescription": { + "text": "Redundant string template" + }, + "fullDescription": { + "text": "Reports single-expression string templates that can be safely removed. Example: 'val x = \"Hello\"\n val y = \"$x\"' After the quick-fix is applied: 'val x = \"Hello\"\n val y = x // <== Updated' Inspection ID: RemoveSingleExpressionStringTemplate", + "markdown": "Reports single-expression string templates that can be safely removed.\n\n**Example:**\n\n val x = \"Hello\"\n val y = \"$x\"\n\nAfter the quick-fix is applied:\n\n val x = \"Hello\"\n val y = x // <== Updated\n\nInspection ID: RemoveSingleExpressionStringTemplate" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RemoveSingleExpressionStringTemplate", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantSetter", + "shortDescription": { + "text": "Redundant property setter" + }, + "fullDescription": { + "text": "Reports redundant property setters. Setter is considered to be redundant in one of the following cases: Setter has no body. Accessor visibility isn't changed, declaration isn't 'external' and has no annotations. 'var myPropWithRedundantSetter: Int = 0\n set // redundant\n\n var myPropA: Int = 0\n private set // OK - property visibility is changed to private\n\n var myPropB: Int = 0\n external set // OK - implemented not in Kotlin (external)\n\n var myPropC: Int = 0\n @Inject set // OK - accessor is annotated' Setter body is a block with a single statement assigning the parameter to the backing field. 'var prop: Int = 0\n set(value) { // redundant\n field = value\n }' Inspection ID: RedundantSetter", + "markdown": "Reports redundant property setters.\n\n\nSetter is considered to be redundant in one of the following cases:\n\n1. Setter has no body. Accessor visibility isn't changed, declaration isn't `external` and has no annotations.\n\n\n var myPropWithRedundantSetter: Int = 0\n set // redundant\n\n var myPropA: Int = 0\n private set // OK - property visibility is changed to private\n\n var myPropB: Int = 0\n external set // OK - implemented not in Kotlin (external)\n\n var myPropC: Int = 0\n @Inject set // OK - accessor is annotated\n \n2. Setter body is a block with a single statement assigning the parameter to the backing field.\n\n\n var prop: Int = 0\n set(value) { // redundant\n field = value\n }\n \nInspection ID: RedundantSetter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantSetter", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncompleteDestructuring", + "shortDescription": { + "text": "Incomplete destructuring declaration" + }, + "fullDescription": { + "text": "Reports incomplete destructuring declaration. Example: 'data class Person(val name: String, val age: Int)\n val person = Person(\"\", 0)\n val (name) = person' The quick fix completes destructuring declaration with new variables: 'data class Person(val name: String, val age: Int)\n val person = Person(\"\", 0)\n val (name, age) = person' Inspection ID: IncompleteDestructuring", + "markdown": "Reports incomplete destructuring declaration.\n\n**Example:**\n\n\n data class Person(val name: String, val age: Int)\n val person = Person(\"\", 0)\n val (name) = person\n\nThe quick fix completes destructuring declaration with new variables:\n\n\n data class Person(val name: String, val age: Int)\n val person = Person(\"\", 0)\n val (name, age) = person\n\nInspection ID: IncompleteDestructuring" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "IncompleteDestructuring", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TrailingComma", + "shortDescription": { + "text": "Trailing comma recommendations" + }, + "fullDescription": { + "text": "Reports trailing commas that do not follow the recommended style guide. Inspection ID: TrailingComma", + "markdown": "Reports trailing commas that do not follow the recommended [style guide](https://kotlinlang.org/docs/coding-conventions.html#trailing-commas).\n\nInspection ID: TrailingComma" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TrailingComma", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FoldInitializerAndIfToElvis", + "shortDescription": { + "text": "If-Null return/break/... foldable to '?:'" + }, + "fullDescription": { + "text": "Reports an 'if' expression that checks variable being null or not right after initializing it that can be converted into an elvis operator in the initializer. Example: 'fun test(foo: Int?, bar: Int): Int {\n var i = foo\n if (i == null) {\n return bar\n }\n return i\n }' The quick-fix converts the 'if' expression with an initializer into an elvis expression: 'fun test(foo: Int?, bar: Int): Int {\n var i = foo ?: return bar\n return i\n }' Inspection ID: FoldInitializerAndIfToElvis", + "markdown": "Reports an `if` expression that checks variable being null or not right after initializing it that can be converted into an elvis operator in the initializer.\n\n**Example:**\n\n\n fun test(foo: Int?, bar: Int): Int {\n var i = foo\n if (i == null) {\n return bar\n }\n return i\n }\n\nThe quick-fix converts the `if` expression with an initializer into an elvis expression:\n\n\n fun test(foo: Int?, bar: Int): Int {\n var i = foo ?: return bar\n return i\n }\n\nInspection ID: FoldInitializerAndIfToElvis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "FoldInitializerAndIfToElvis", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PropertyName", + "shortDescription": { + "text": "Property naming convention" + }, + "fullDescription": { + "text": "Reports property names that do not follow the recommended naming conventions. Consistent naming allows for easier code reading and understanding. According to the Kotlin official style guide, property names should start with a lowercase letter and use camel case. It is possible to introduce other naming rules by changing the \"Pattern\" regular expression. Example: 'val My_Cool_Property = \"\"' The quick-fix renames the class according to the Kotlin naming conventions: 'val myCoolProperty = \"\"' Inspection ID: PropertyName", + "markdown": "Reports property names that do not follow the recommended naming conventions.\n\n\nConsistent naming allows for easier code reading and understanding.\nAccording to the [Kotlin official style guide](https://kotlinlang.org/docs/coding-conventions.html#naming-rules),\nproperty names should start with a lowercase letter and use camel case.\n\nIt is possible to introduce other naming rules by changing the \"Pattern\" regular expression.\n\n**Example:**\n\n\n val My_Cool_Property = \"\"\n\nThe quick-fix renames the class according to the Kotlin naming conventions:\n\n\n val myCoolProperty = \"\"\n\nInspection ID: PropertyName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "PropertyName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinMavenPluginPhase", + "shortDescription": { + "text": "Kotlin Maven Plugin misconfigured" + }, + "fullDescription": { + "text": "Reports kotlin-maven-plugin configuration issues", + "markdown": "Reports kotlin-maven-plugin configuration issues" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "KotlinMavenPluginPhase", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AmbiguousNonLocalJump", + "shortDescription": { + "text": "Ambiguous non-local 'break' or 'continue'" + }, + "fullDescription": { + "text": "Reports 'break' or 'continue' usages inside of lambdas of loop-like functions. 'break' and 'continue' keywords always apply to the real loops ('for', 'while', 'do-while'). 'break' and 'continue' never apply to any function; for example, 'break' and 'continue' don't apply to 'forEach', 'filter', 'map'. Using 'break' or 'continue' inside a loop-like function (for example, 'forEach') may be confusing. The inspection suggests adding a label to clarify to which statement 'break' or 'continue' applies to. Since Kotlin doesn't have a concept of loop-like functions, the inspection uses the heuristic. It assumes that functions that don't have one of 'callsInPlace(EXACTLY_ONCE)' or 'callsInPlace(AT_LEAST_ONCE)' contracts are loop-like functions. Example: 'for (file in files) {\n file.readLines().forEach { line ->\n if (line == commentMarkerLine) continue\n println(line)\n }\n }' The quick-fix adds clarifying labels: 'loop@ for (file in files) {\n file.readLines().forEach { line ->\n if (line == commentMarkerLine) continue@loop\n println(line)\n }\n }' Inspection ID: AmbiguousNonLocalJump", + "markdown": "Reports `break` or `continue` usages inside of lambdas of loop-like functions.\n\n\n`break` and `continue` keywords always apply to the real loops (`for`,\n`while`, `do-while`). `break` and `continue` never apply to any function; for example,\n`break` and `continue` don't apply to `forEach`, `filter`, `map`.\n\n\nUsing `break` or `continue` inside a loop-like function (for example, `forEach`) may be confusing.\nThe inspection suggests adding a label to clarify to which statement `break` or `continue` applies to.\n\n\nSince Kotlin doesn't have a concept of loop-like functions, the inspection uses the heuristic. It assumes that functions that don't\nhave one of `callsInPlace(EXACTLY_ONCE)` or `callsInPlace(AT_LEAST_ONCE)` contracts are loop-like functions.\n\n**Example:**\n\n\n for (file in files) {\n file.readLines().forEach { line ->\n if (line == commentMarkerLine) continue\n println(line)\n }\n }\n\nThe quick-fix adds clarifying labels:\n\n\n loop@ for (file in files) {\n file.readLines().forEach { line ->\n if (line == commentMarkerLine) continue@loop\n println(line)\n }\n }\n\nInspection ID: AmbiguousNonLocalJump" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "AmbiguousNonLocalJump", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToStringTemplate", + "shortDescription": { + "text": "String concatenation that can be converted to string template" + }, + "fullDescription": { + "text": "Reports string concatenation that can be converted to a string template. Using string templates is recommended as it makes code easier to read. Example: 'fun example() {\n val capitals = mapOf(\"France\" to \"Paris\", \"Spain\" to \"Madrid\")\n for ((country, capital) in capitals) {\n print(capital + \" is a capital of \" + country)\n }\n }' After the quick-fix is applied: 'fun example() {\n val capitals = mapOf(\"France\" to \"Paris\", \"Spain\" to \"Madrid\")\n for ((country, capital) in capitals) {\n print(\"$capital is a capital of $country\")\n }\n }' Inspection ID: ConvertToStringTemplate", + "markdown": "Reports string concatenation that can be converted to a string template.\n\nUsing string templates is recommended as it makes code easier to read.\n\n**Example:**\n\n\n fun example() {\n val capitals = mapOf(\"France\" to \"Paris\", \"Spain\" to \"Madrid\")\n for ((country, capital) in capitals) {\n print(capital + \" is a capital of \" + country)\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun example() {\n val capitals = mapOf(\"France\" to \"Paris\", \"Spain\" to \"Madrid\")\n for ((country, capital) in capitals) {\n print(\"$capital is a capital of $country\")\n }\n }\n\nInspection ID: ConvertToStringTemplate" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertToStringTemplate", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinInvalidBundleOrProperty", + "shortDescription": { + "text": "Invalid property key" + }, + "fullDescription": { + "text": "Reports unresolved references to '.properties' file keys and resource bundles in Kotlin files. Inspection ID: KotlinInvalidBundleOrProperty", + "markdown": "Reports unresolved references to `.properties` file keys and resource bundles in Kotlin files.\n\nInspection ID: KotlinInvalidBundleOrProperty" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "InvalidBundleOrProperty", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UselessCallOnCollection", + "shortDescription": { + "text": "Useless call on collection type" + }, + "fullDescription": { + "text": "Reports 'filter…' calls from the standard library on already filtered collections. Several functions from the standard library such as 'filterNotNull()' or 'filterIsInstance' have sense only when they are called on receivers that have types distinct from the resulting one. Otherwise, such calls can be omitted as the result will be the same. Remove redundant call quick-fix can be used to amend the code automatically. Example: 'fun test(list: List) {\n val x = list.filterNotNull() // quick-fix simplifies to 'list'\n val y = list.filterIsInstance() // quick-fix simplifies to 'list'\n }' Inspection ID: UselessCallOnCollection", + "markdown": "Reports `filter...` calls from the standard library on already filtered collections.\n\nSeveral functions from the standard library such as `filterNotNull()` or `filterIsInstance`\nhave sense only when they are called on receivers that have types distinct from the resulting one. Otherwise,\nsuch calls can be omitted as the result will be the same.\n\n**Remove redundant call** quick-fix can be used to amend the code automatically.\n\nExample:\n\n\n fun test(list: List) {\n val x = list.filterNotNull() // quick-fix simplifies to 'list'\n val y = list.filterIsInstance() // quick-fix simplifies to 'list'\n }\n\nInspection ID: UselessCallOnCollection" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UselessCallOnCollection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VariableInitializerIsRedundant", + "shortDescription": { + "text": "Variable initializer is redundant" + }, + "fullDescription": { + "text": "Reports redundant initializers for local variables. Example: 'fun example() {\n var local = 42 // Initializer is redundant\n local = 0\n println(local)\n }' Inspection ID: VariableInitializerIsRedundant", + "markdown": "Reports redundant initializers for local variables.\n\n**Example:**\n\n\n fun example() {\n var local = 42 // Initializer is redundant\n local = 0\n println(local)\n }\n\nInspection ID: VariableInitializerIsRedundant" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "VariableInitializerIsRedundant", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectLiteralToLambda", + "shortDescription": { + "text": "Object literal can be converted to lambda" + }, + "fullDescription": { + "text": "Reports anonymous object literals implementing a Java interface with a single abstract method that can be converted into a call with a lambda expression. Example: 'class SomeService {\n val threadPool = Executors.newCachedThreadPool()\n \n fun foo() {\n threadPool.submit(object : Runnable {\n override fun run() {\n println(\"hello\")\n }\n })\n }\n}' After the quick-fix is applied: 'fun foo() {\n threadPool.submit { println(\"hello\") }\n }' Inspection ID: ObjectLiteralToLambda", + "markdown": "Reports anonymous object literals implementing a Java interface with a single abstract method that can be converted into a call with a lambda expression.\n\n**Example:**\n\n\n class SomeService {\n val threadPool = Executors.newCachedThreadPool()\n \n fun foo() {\n threadPool.submit(object : Runnable {\n override fun run() {\n println(\"hello\")\n }\n })\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n threadPool.submit { println(\"hello\") }\n }\n\nInspection ID: ObjectLiteralToLambda" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ObjectLiteralToLambda", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantLambdaOrAnonymousFunction", + "shortDescription": { + "text": "Redundant creation of lambda or anonymous function" + }, + "fullDescription": { + "text": "Reports lambdas or anonymous functions that are created and used immediately. 'fun test() {\n ({ println() })() // redundant\n (fun() { println() })() // redundant\n }' Inspection ID: RedundantLambdaOrAnonymousFunction", + "markdown": "Reports lambdas or anonymous functions that are created and used immediately.\n\n\n fun test() {\n ({ println() })() // redundant\n (fun() { println() })() // redundant\n }\n\nInspection ID: RedundantLambdaOrAnonymousFunction" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantLambdaOrAnonymousFunction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantRequireNotNullCall", + "shortDescription": { + "text": "Redundant 'requireNotNull' or 'checkNotNull' call" + }, + "fullDescription": { + "text": "Reports redundant 'requireNotNull' or 'checkNotNull' call on non-nullable expressions. Example: 'fun foo(i: Int) {\n requireNotNull(i) // This 'i' is always not null, so this 'requireNotNull' call is redundant.\n ...\n }' After the quick-fix is applied: 'fun foo(i: Int) {\n ...\n }' Inspection ID: RedundantRequireNotNullCall", + "markdown": "Reports redundant `requireNotNull` or `checkNotNull` call on non-nullable expressions.\n\n**Example:**\n\n\n fun foo(i: Int) {\n requireNotNull(i) // This 'i' is always not null, so this 'requireNotNull' call is redundant.\n ...\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(i: Int) {\n ...\n }\n\nInspection ID: RedundantRequireNotNullCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantRequireNotNullCall", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectPropertyName", + "shortDescription": { + "text": "Object property naming convention" + }, + "fullDescription": { + "text": "Reports properties that do not follow the naming conventions. The following properties are reported: Top-level properties Properties in objects and companion objects You can specify the required pattern in the inspection options. Recommended naming conventions: it has to start with an uppercase letter, use camel case and no underscores. Example: '// top-level property\n val USER_NAME_FIELD = \"UserName\"\n // top-level property holding reference to singleton object\n val PersonComparator: Comparator = /*...*/\n\n class Person {\n companion object {\n // property in companion object\n val NO_NAME = Person()\n }\n }' Inspection ID: ObjectPropertyName", + "markdown": "Reports properties that do not follow the naming conventions.\n\nThe following properties are reported:\n\n* Top-level properties\n* Properties in objects and companion objects\n\nYou can specify the required pattern in the inspection options.\n\n[Recommended naming conventions](https://kotlinlang.org/docs/coding-conventions.html#naming-rules): it has to start with an uppercase letter, use camel case and no underscores.\n\n**Example:**\n\n\n // top-level property\n val USER_NAME_FIELD = \"UserName\"\n // top-level property holding reference to singleton object\n val PersonComparator: Comparator = /*...*/\n\n class Person {\n companion object {\n // property in companion object\n val NO_NAME = Person()\n }\n }\n\nInspection ID: ObjectPropertyName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ObjectPropertyName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageDirectoryMismatch", + "shortDescription": { + "text": "Package name does not match containing directory" + }, + "fullDescription": { + "text": "Reports 'package' directives that do not match the location of the file. When applying fixes, \"Move refactoring\" defaults are used to update usages of changed declarations, namely: \"Search in comments and strings\" \"Search for text occurrences\" Inspection ID: PackageDirectoryMismatch", + "markdown": "Reports `package` directives that do not match the location of the file.\n\n\nWhen applying fixes, \"Move refactoring\" defaults are used to update usages of changed declarations, namely:\n\n* \"Search in comments and strings\"\n* \"Search for text occurrences\"\n\nInspection ID: PackageDirectoryMismatch" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "PackageDirectoryMismatch", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Java interop issues", + "index": 67, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BooleanLiteralArgument", + "shortDescription": { + "text": "Boolean literal argument without parameter name" + }, + "fullDescription": { + "text": "Reports call arguments with 'Boolean' type without explicit parameter names specified. When multiple boolean literals are passed sequentially, it's easy to forget parameter ordering that could lead to mistakes. Explicit parameter names allow for easier code reading and understanding. Example: 'fun check(checkName: Boolean, checkAddress: Boolean, checkPhone: Boolean) {}\n\n fun usage() {\n check(true, false, true) // What does this mean?\n }' The quick-fix adds missing parameter names: 'fun check(checkName: Boolean, checkAddress: Boolean, checkPhone: Boolean) {}\n\n fun usage() {\n check(checkName = true, checkAddress = false, checkPhone = true)\n }' Inspection ID: BooleanLiteralArgument", + "markdown": "Reports call arguments with `Boolean` type without explicit parameter names specified.\n\n\nWhen multiple boolean literals are passed sequentially, it's easy to forget parameter ordering that could lead to mistakes.\nExplicit parameter names allow for easier code reading and understanding.\n\n**Example:**\n\n\n fun check(checkName: Boolean, checkAddress: Boolean, checkPhone: Boolean) {}\n\n fun usage() {\n check(true, false, true) // What does this mean?\n }\n\nThe quick-fix adds missing parameter names:\n\n\n fun check(checkName: Boolean, checkAddress: Boolean, checkPhone: Boolean) {}\n\n fun usage() {\n check(checkName = true, checkAddress = false, checkPhone = true)\n }\n\nInspection ID: BooleanLiteralArgument" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BooleanLiteralArgument", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertArgumentToSet", + "shortDescription": { + "text": "Argument could be converted to 'Set' to improve performance" + }, + "fullDescription": { + "text": "Detects the function calls that could work faster with an argument converted to 'Set'. Operations like 'minus' or 'intersect' are more effective when their argument is a set. An explicit conversion of an 'Iterable' or an 'Array' into a 'Set' can often make code more effective. The quick-fix adds an explicit conversion to the function call. Example: 'fun f(a: Iterable, b: Iterable): Int =\n a.intersect(b).size' After the quick-fix is applied: 'fun f(a: Iterable, b: Iterable): Int =\n a.intersect(b.toSet()).size' Inspection ID: ConvertArgumentToSet", + "markdown": "Detects the function calls that could work faster with an argument converted to `Set`.\n\n\nOperations like 'minus' or 'intersect' are more effective when their argument is a set.\nAn explicit conversion of an `Iterable` or an `Array`\ninto a `Set` can often make code more effective.\n\n\nThe quick-fix adds an explicit conversion to the function call.\n\n**Example:**\n\n\n fun f(a: Iterable, b: Iterable): Int =\n a.intersect(b).size\n\nAfter the quick-fix is applied:\n\n\n fun f(a: Iterable, b: Iterable): Int =\n a.intersect(b.toSet()).size\n\nInspection ID: ConvertArgumentToSet" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "ConvertArgumentToSet", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Other problems", + "index": 75, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceGuardClauseWithFunctionCall", + "shortDescription": { + "text": "Guard clause can be replaced with Kotlin's function call" + }, + "fullDescription": { + "text": "Reports guard clauses that can be replaced with a function call. Example: 'fun test(foo: Int?) {\n if (foo == null) throw IllegalArgumentException(\"foo\") // replaceable clause\n }' After the quick-fix is applied: 'fun test(foo: Int?) {\n checkNotNull(foo)\n }' Inspection ID: ReplaceGuardClauseWithFunctionCall", + "markdown": "Reports guard clauses that can be replaced with a function call.\n\n**Example:**\n\n fun test(foo: Int?) {\n if (foo == null) throw IllegalArgumentException(\"foo\") // replaceable clause\n }\n\nAfter the quick-fix is applied:\n\n fun test(foo: Int?) {\n checkNotNull(foo)\n }\n\nInspection ID: ReplaceGuardClauseWithFunctionCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceGuardClauseWithFunctionCall", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceSizeZeroCheckWithIsEmpty", + "shortDescription": { + "text": "Size zero check can be replaced with 'isEmpty()'" + }, + "fullDescription": { + "text": "Reports 'size == 0' checks on 'Collections/Array/String' that should be replaced with 'isEmpty()'. Using 'isEmpty()' makes your code simpler. The quick-fix replaces the size check with 'isEmpty()'. Example: 'fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.size == 0\n }' After the quick-fix is applied: 'fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.isEmpty()\n }' Inspection ID: ReplaceSizeZeroCheckWithIsEmpty", + "markdown": "Reports `size == 0` checks on `Collections/Array/String` that should be replaced with `isEmpty()`.\n\nUsing `isEmpty()` makes your code simpler.\n\nThe quick-fix replaces the size check with `isEmpty()`.\n\n**Example:**\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.size == 0\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.isEmpty()\n }\n\nInspection ID: ReplaceSizeZeroCheckWithIsEmpty" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceSizeZeroCheckWithIsEmpty", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaCollectionWithNullableTypeArgument", + "shortDescription": { + "text": "Nullable type argument in Java collection that doesn't support nulls" + }, + "fullDescription": { + "text": "Reports providing nullable type arguments to Java collections that don't accept nulls. Some Java collections shipped in Java Standard Library do not support null elements, keys, or values. Such collections' type arguments shouldn't be instantiated with nullable types. Example: 'val map = ConcurrentHashMap()' After the quick-fix is applied: 'val map = ConcurrentHashMap()' Inspection ID: JavaCollectionWithNullableTypeArgument", + "markdown": "Reports providing nullable type arguments to Java collections that don't accept nulls.\n\n\nSome Java collections shipped in Java Standard Library do not support null elements, keys, or values.\nSuch collections' type arguments shouldn't be instantiated with nullable types.\n\n**Example:**\n\n\n val map = ConcurrentHashMap()\n\nAfter the quick-fix is applied:\n\n\n val map = ConcurrentHashMap()\n\nInspection ID: JavaCollectionWithNullableTypeArgument" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "JavaCollectionWithNullableTypeArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Java interop issues", + "index": 67, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantEnumConstructorInvocation", + "shortDescription": { + "text": "Redundant enum constructor invocation" + }, + "fullDescription": { + "text": "Reports redundant constructor invocation on an enum entry. Example: 'enum class Baz(i: Int = 0) {\n A(1),\n B(),\n C(),\n }' After the quick-fix is applied: 'enum class Baz(i: Int = 0) {\n A(1),\n B,\n C,\n }' Inspection ID: RedundantEnumConstructorInvocation", + "markdown": "Reports redundant constructor invocation on an enum entry.\n\n**Example:**\n\n\n enum class Baz(i: Int = 0) {\n A(1),\n B(),\n C(),\n }\n\nAfter the quick-fix is applied:\n\n\n enum class Baz(i: Int = 0) {\n A(1),\n B,\n C,\n }\n\nInspection ID: RedundantEnumConstructorInvocation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantEnumConstructorInvocation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinBigDecimalEquals", + "shortDescription": { + "text": "'equals()' called on 'BigDecimal'" + }, + "fullDescription": { + "text": "Reports '==' or 'equals()' calls that compare two 'java.math.BigDecimal' numbers. This is normally a mistake, as two 'java.math.BigDecimal' numbers are only equal if they are equal in both value and scale. Example: '// condition is false\n val condition = BigDecimal(\"2.0\") ==\n BigDecimal(\"2.00\")' After the quick-fix is applied: '// condition is true\n val condition = BigDecimal(\"2.0\").compareTo(\n BigDecimal(\"2.00\")) == 0' Inspection ID: KotlinBigDecimalEquals", + "markdown": "Reports `==` or `equals()` calls that compare two `java.math.BigDecimal` numbers. This is normally a mistake, as two `java.math.BigDecimal` numbers are only equal if they are equal in both value and scale.\n\n**Example:**\n\n\n // condition is false\n val condition = BigDecimal(\"2.0\") ==\n BigDecimal(\"2.00\")\n\nAfter the quick-fix is applied:\n\n\n // condition is true\n val condition = BigDecimal(\"2.0\").compareTo(\n BigDecimal(\"2.00\")) == 0\n\nInspection ID: KotlinBigDecimalEquals" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "KotlinBigDecimalEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Numeric issues", + "index": 80, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ProtectedInFinal", + "shortDescription": { + "text": "'protected' visibility is effectively 'private' in a final class" + }, + "fullDescription": { + "text": "Reports 'protected' visibility used inside of a 'final' class. In such cases 'protected' members are accessible only in the class itself, so they are effectively 'private'. Example: 'class FinalClass {\n protected fun foo() {}\n }' After the quick-fix is applied: 'class FinalClass {\n private fun foo() {}\n }' Inspection ID: ProtectedInFinal", + "markdown": "Reports `protected` visibility used inside of a `final` class. In such cases `protected` members are accessible only in the class itself, so they are effectively `private`.\n\n**Example:**\n\n\n class FinalClass {\n protected fun foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class FinalClass {\n private fun foo() {}\n }\n\nInspection ID: ProtectedInFinal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ProtectedInFinal", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinOptionsToCompilerOptions", + "shortDescription": { + "text": "Use of deprecated 'kotlinOptions' DSL" + }, + "fullDescription": { + "text": "Reports usages of the deprecated 'kotlinOptions' DSL in Gradle '.kts' build scripts. The 'kotlinOptions' DSL was deprecated in Kotlin 2.0. The inspection helps migrate from 'kotlinOptions' to 'compilerOptions'. It also changes the types of several options that use the new types instead of the 'String' type. Example for the 'KotlinCompile' task: 'val compileKotlin: KotlinCompile by tasks\ncompileKotlin.kotlinOptions {\n jvmTarget = \"1.8\"\n freeCompilerArgs = listOf(\"-module-name\", \"my_module_name\")\n apiVersion = \"1.9\"\n}\n\n//OR\n\ntasks.withType {\n kotlinOptions {\n freeCompilerArgs += listOf(\"-module-name\", \"my_module_name\")\n }\n}' The inspection also adds imports for options with changed types: 'import org.jetbrains.kotlin.gradle.dsl.JvmTarget\nimport org.jetbrains.kotlin.gradle.dsl.KotlinVersion\n\n...\n\nval compileKotlin: KotlinCompile by tasks\ncompileKotlin.compilerOptions {\n jvmTarget.set(JvmTarget.JVM_1_8)\n freeCompilerArgs.set(listOf(\"-module-name\", \"my_module_name\"))\n apiVersion.set(KotlinVersion.KOTLIN_1_9)\n}' Example for the 'Kotlin2JsCompile' task: 'val compileKotlin: Kotlin2JsCompile by tasks\ncompileKotlin.kotlinOptions {\n moduleKind = \"commonjs\"\n sourceMapEmbedSources = \"inlining\"\n sourceMapNamesPolicy = \"fully-qualified-names\"\n main = \"noCall\"\n}' After the inspection is applied: 'import org.jetbrains.kotlin.gradle.dsl.JsMainFunctionExecutionMode\nimport org.jetbrains.kotlin.gradle.dsl.JsModuleKind\nimport org.jetbrains.kotlin.gradle.dsl.JsSourceMapEmbedMode\nimport org.jetbrains.kotlin.gradle.dsl.JsSourceMapNamesPolicy\n\n...\n\nval compileKotlin: Kotlin2JsCompile by tasks\ncompileKotlin.compilerOptions {\n moduleKind.set(JsModuleKind.MODULE_COMMONJS)\n sourceMapEmbedSources.set(JsSourceMapEmbedMode.SOURCE_MAP_SOURCE_CONTENT_INLINING)\n sourceMapNamesPolicy.set(JsSourceMapNamesPolicy.SOURCE_MAP_NAMES_POLICY_FQ_NAMES)\n main.set(JsMainFunctionExecutionMode.NO_CALL)\n}' Inspection ID: KotlinOptionsToCompilerOptions", + "markdown": "Reports usages of the deprecated `kotlinOptions` DSL in Gradle `.kts` build scripts.\n\n\nThe `kotlinOptions` DSL was deprecated in Kotlin 2.0.\nThe inspection helps migrate from `kotlinOptions` to `compilerOptions`.\nIt also changes the types of several\n[options that use the new types](https://kotl.in/types-for-kgp-compiler-options) instead of the `String` type.\n\n\nExample for the `KotlinCompile` task:\n\n\n val compileKotlin: KotlinCompile by tasks\n compileKotlin.kotlinOptions {\n jvmTarget = \"1.8\"\n freeCompilerArgs = listOf(\"-module-name\", \"my_module_name\")\n apiVersion = \"1.9\"\n }\n\n //OR\n\n tasks.withType {\n kotlinOptions {\n freeCompilerArgs += listOf(\"-module-name\", \"my_module_name\")\n }\n }\n\nThe inspection also adds imports for options with changed types:\n\n\n import org.jetbrains.kotlin.gradle.dsl.JvmTarget\n import org.jetbrains.kotlin.gradle.dsl.KotlinVersion\n\n ...\n\n val compileKotlin: KotlinCompile by tasks\n compileKotlin.compilerOptions {\n jvmTarget.set(JvmTarget.JVM_1_8)\n freeCompilerArgs.set(listOf(\"-module-name\", \"my_module_name\"))\n apiVersion.set(KotlinVersion.KOTLIN_1_9)\n }\n\n\nExample for the `Kotlin2JsCompile` task:\n\n\n val compileKotlin: Kotlin2JsCompile by tasks\n compileKotlin.kotlinOptions {\n moduleKind = \"commonjs\"\n sourceMapEmbedSources = \"inlining\"\n sourceMapNamesPolicy = \"fully-qualified-names\"\n main = \"noCall\"\n }\n\nAfter the inspection is applied:\n\n\n import org.jetbrains.kotlin.gradle.dsl.JsMainFunctionExecutionMode\n import org.jetbrains.kotlin.gradle.dsl.JsModuleKind\n import org.jetbrains.kotlin.gradle.dsl.JsSourceMapEmbedMode\n import org.jetbrains.kotlin.gradle.dsl.JsSourceMapNamesPolicy\n\n ...\n\n val compileKotlin: Kotlin2JsCompile by tasks\n compileKotlin.compilerOptions {\n moduleKind.set(JsModuleKind.MODULE_COMMONJS)\n sourceMapEmbedSources.set(JsSourceMapEmbedMode.SOURCE_MAP_SOURCE_CONTENT_INLINING)\n sourceMapNamesPolicy.set(JsSourceMapNamesPolicy.SOURCE_MAP_NAMES_POLICY_FQ_NAMES)\n main.set(JsMainFunctionExecutionMode.NO_CALL)\n }\n\nInspection ID: KotlinOptionsToCompilerOptions" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "KotlinOptionsToCompilerOptions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Migration/Gradle", + "index": 86, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WhenWithOnlyElse", + "shortDescription": { + "text": "'when' has only 'else' branch and can be simplified" + }, + "fullDescription": { + "text": "Reports 'when' expressions with only an 'else' branch that can be simplified. Simplify expression quick-fix can be used to amend the code automatically. Example: 'fun redundant() {\n val x = when { // <== redundant, the quick-fix simplifies the when expression to \"val x = 1\"\n else -> 1\n }\n }' Inspection ID: WhenWithOnlyElse", + "markdown": "Reports `when` expressions with only an `else` branch that can be simplified.\n\n**Simplify expression** quick-fix can be used to amend the code automatically.\n\nExample:\n\n\n fun redundant() {\n val x = when { // <== redundant, the quick-fix simplifies the when expression to \"val x = 1\"\n else -> 1\n }\n }\n\nInspection ID: WhenWithOnlyElse" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "WhenWithOnlyElse", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanConvertToMultiDollarString", + "shortDescription": { + "text": "Multi-dollar interpolation can be used in string literals (available since 2.1)" + }, + "fullDescription": { + "text": "Reports that a string can benefit from a conversion to a version with a multi-dollar interpolation prefix. An interpolation prefix may make a string easier to comprehend, since prefixed strings can use dollar literals without additional escaping. Example: 'val jsonSchema: String = \"\"\"\n{\n \"${'$'}id\": \"https://example.com/product.schema.json\",\n}\"\"\"' The quick fix converts all safely replaceable escaped dollar characters to regular dollar characters: 'val jsonSchema: String = $$\"\"\"\n{\n \"$id\": \"https://example.com/product.schema.json\",\n}\"\"\"' Inspection ID: CanConvertToMultiDollarString", + "markdown": "Reports that a string can benefit from a conversion to a version with a multi-dollar interpolation prefix.\n\n\nAn interpolation prefix may make a string easier to comprehend, since prefixed strings can use dollar literals without additional escaping.\n\n**Example:**\n\n\n val jsonSchema: String = \"\"\"\n {\n \"${'$'}id\": \"https://example.com/product.schema.json\",\n }\"\"\"\n\nThe quick fix converts all safely replaceable escaped dollar characters to regular dollar characters:\n\n\n val jsonSchema: String = $$\"\"\"\n {\n \"$id\": \"https://example.com/product.schema.json\",\n }\"\"\"\n\nInspection ID: CanConvertToMultiDollarString" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "CanConvertToMultiDollarString", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Code migration", + "index": 87, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceRangeStartEndInclusiveWithFirstLast", + "shortDescription": { + "text": "Boxed properties should be replaced with unboxed" + }, + "fullDescription": { + "text": "Reports boxed 'Range.start' and 'Range.endInclusive' properties. These properties can be replaced with unboxed 'first' and 'last' properties to avoid redundant calls. The quick-fix replaces 'start' and 'endInclusive' properties with the corresponding 'first' and 'last'. Example: 'fun foo(range: CharRange) {\n val lastElement = range.endInclusive\n }' After the quick-fix is applied: 'fun foo(range: CharRange) {\n val lastElement = range.last\n }' Inspection ID: ReplaceRangeStartEndInclusiveWithFirstLast", + "markdown": "Reports **boxed** `Range.start` and `Range.endInclusive` properties.\n\nThese properties can be replaced with **unboxed** `first` and `last` properties to avoid redundant calls.\n\nThe quick-fix replaces `start` and `endInclusive` properties with the corresponding `first` and `last`.\n\n**Example:**\n\n\n fun foo(range: CharRange) {\n val lastElement = range.endInclusive\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(range: CharRange) {\n val lastElement = range.last\n }\n\nInspection ID: ReplaceRangeStartEndInclusiveWithFirstLast" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceRangeStartEndInclusiveWithFirstLast", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceSizeCheckWithIsNotEmpty", + "shortDescription": { + "text": "Size check can be replaced with 'isNotEmpty()'" + }, + "fullDescription": { + "text": "Reports size checks of 'Collections/Array/String' that should be replaced with 'isNotEmpty()'. Using 'isNotEmpty()' makes your code simpler. The quick-fix replaces the size check with 'isNotEmpty()'. Example: 'fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.size > 0\n }' After the quick-fix is applied: 'fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.isNotEmpty()\n }' Inspection ID: ReplaceSizeCheckWithIsNotEmpty", + "markdown": "Reports size checks of `Collections/Array/String` that should be replaced with `isNotEmpty()`.\n\nUsing `isNotEmpty()` makes your code simpler.\n\nThe quick-fix replaces the size check with `isNotEmpty()`.\n\n**Example:**\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.size > 0\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n val arrayOf = arrayOf(1, 2, 3)\n arrayOf.isNotEmpty()\n }\n\nInspection ID: ReplaceSizeCheckWithIsNotEmpty" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceSizeCheckWithIsNotEmpty", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceMapGetOrDefault", + "shortDescription": { + "text": "'map.getOrDefault()' can be replaced with indexing and elvis operator" + }, + "fullDescription": { + "text": "Replaces 'map.getOrDefault(key, defaultValue)' function calls with an indexing and elvis operator ('map[key] ?: defaultValue'). Example: 'fun test(map: Map) {\n map.getOrDefault(1, \"foo\")\n }' 'fun test(map: Map) {\n map[1] ?: \"foo\"\n }' Inspection ID: ReplaceMapGetOrDefault", + "markdown": "Replaces `map.getOrDefault(key, defaultValue)` function calls with an indexing and elvis operator (`map[key] ?: defaultValue`).\n\nExample:\n\n\n fun test(map: Map) {\n map.getOrDefault(1, \"foo\")\n }\n\n\n fun test(map: Map) {\n map[1] ?: \"foo\"\n }\n\nInspection ID: ReplaceMapGetOrDefault" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceMapGetOrDefault", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantSemicolon", + "shortDescription": { + "text": "Redundant semicolon" + }, + "fullDescription": { + "text": "Reports redundant semicolons (';') that can be safely removed. Kotlin does not require a semicolon at the end of each statement or expression. The quick-fix is suggested to remove redundant semicolons. Example: 'val myMap = mapOf(\"one\" to 1, \"two\" to 2);\n myMap.forEach { (key, value) -> print(\"$key -> $value\")};' After the quick-fix is applied: 'val myMap = mapOf(\"one\" to 1, \"two\" to 2)\n myMap.forEach { (key, value) -> print(\"$key -> $value\")}' There are two cases though where a semicolon is required: Several statements placed on a single line need to be separated with semicolons: 'map.forEach { val (key, value) = it; println(\"$key -> $value\") }' 'enum' classes that also declare properties or functions, require a semicolon after the list of enum constants: 'enum class Mode {\n SILENT, VERBOSE;\n\n fun isSilent(): Boolean = this == SILENT\n }' Inspection ID: RedundantSemicolon", + "markdown": "Reports redundant semicolons (`;`) that can be safely removed.\n\n\nKotlin does not require a semicolon at the end of each statement or expression.\nThe quick-fix is suggested to remove redundant semicolons.\n\n**Example:**\n\n\n val myMap = mapOf(\"one\" to 1, \"two\" to 2);\n myMap.forEach { (key, value) -> print(\"$key -> $value\")};\n\nAfter the quick-fix is applied:\n\n\n val myMap = mapOf(\"one\" to 1, \"two\" to 2)\n myMap.forEach { (key, value) -> print(\"$key -> $value\")}\n\nThere are two cases though where a semicolon is required:\n\n1. Several statements placed on a single line need to be separated with semicolons:\n\n\n map.forEach { val (key, value) = it; println(\"$key -> $value\") }\n\n2. `enum` classes that also declare properties or functions, require a semicolon after the list of enum constants:\n\n\n enum class Mode {\n SILENT, VERBOSE;\n\n fun isSilent(): Boolean = this == SILENT\n }\n \nInspection ID: RedundantSemicolon" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantSemicolon", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InfixCallToOrdinary", + "shortDescription": { + "text": "Infix call may be dot call" + }, + "fullDescription": { + "text": "Reports for infix function calls that can be replaced with dot-qualified function calls. Example: '1 xor 2' '1.xor(2)' Inspection ID: InfixCallToOrdinary", + "markdown": "Reports for infix function calls that can be replaced with dot-qualified function calls.\n\nExample:\n\n\n 1 xor 2\n\n\n 1.xor(2)\n\nInspection ID: InfixCallToOrdinary" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "InfixCallToOrdinary", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Code migration", + "index": 87, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IntroduceWhenSubject", + "shortDescription": { + "text": "'when' that can be simplified by introducing an argument" + }, + "fullDescription": { + "text": "Reports a 'when' expression that can be simplified by introducing a subject argument. Example: 'fun test(obj: Any): String {\n return when {\n obj is String -> \"string\"\n obj is Int -> \"int\"\n else -> \"unknown\"\n }\n }' The quick fix introduces a subject argument: 'fun test(obj: Any): String {\n return when (obj) {\n is String -> \"string\"\n is Int -> \"int\"\n else -> \"unknown\"\n }\n }' Inspection ID: IntroduceWhenSubject", + "markdown": "Reports a `when` expression that can be simplified by introducing a subject argument.\n\n**Example:**\n\n\n fun test(obj: Any): String {\n return when {\n obj is String -> \"string\"\n obj is Int -> \"int\"\n else -> \"unknown\"\n }\n }\n\nThe quick fix introduces a subject argument:\n\n\n fun test(obj: Any): String {\n return when (obj) {\n is String -> \"string\"\n is Int -> \"int\"\n else -> \"unknown\"\n }\n }\n\nInspection ID: IntroduceWhenSubject" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "IntroduceWhenSubject", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinTestJUnit", + "shortDescription": { + "text": "kotlin-test-junit could be used" + }, + "fullDescription": { + "text": "Reports usage of 'kotlin-test' and 'junit' dependency without 'kotlin-test-junit'. It is recommended to use 'kotlin-test-junit' dependency to work with Kotlin and JUnit. Inspection ID: KotlinTestJUnit", + "markdown": "Reports usage of `kotlin-test` and `junit` dependency without `kotlin-test-junit`.\n\nIt is recommended to use `kotlin-test-junit` dependency to work with Kotlin and JUnit.\n\nInspection ID: KotlinTestJUnit" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "KotlinTestJUnit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SafeCastWithReturn", + "shortDescription": { + "text": "Safe cast with 'return' should be replaced with 'if' type check" + }, + "fullDescription": { + "text": "Reports safe cast with 'return' that can be replaced with 'if' type check. Using corresponding functions makes your code simpler. The quick-fix replaces the safe cast with 'if' type check. Example: 'fun test(x: Any) {\n x as? String ?: return\n }' After the quick-fix is applied: 'fun test(x: Any) {\n if (x !is String) return\n }' Inspection ID: SafeCastWithReturn", + "markdown": "Reports safe cast with `return` that can be replaced with `if` type check.\n\nUsing corresponding functions makes your code simpler.\n\nThe quick-fix replaces the safe cast with `if` type check.\n\n**Example:**\n\n\n fun test(x: Any) {\n x as? String ?: return\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(x: Any) {\n if (x !is String) return\n }\n\nInspection ID: SafeCastWithReturn" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SafeCastWithReturn", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceAssertBooleanWithAssertEquality", + "shortDescription": { + "text": "Assert boolean could be replaced with assert equality" + }, + "fullDescription": { + "text": "Reports calls to 'assertTrue()' and 'assertFalse()' that can be replaced with assert equality functions. 'assertEquals()', 'assertSame()', and their negating counterparts (-Not-) provide more informative messages on failure. Example: 'assertTrue(a == b)' After the quick-fix is applied: 'assertEquals(a, b)' Inspection ID: ReplaceAssertBooleanWithAssertEquality", + "markdown": "Reports calls to `assertTrue()` and `assertFalse()` that can be replaced with assert equality functions.\n\n\n`assertEquals()`, `assertSame()`, and their negating counterparts (-Not-) provide more informative messages on\nfailure.\n\n**Example:**\n\n assertTrue(a == b)\n\nAfter the quick-fix is applied:\n\n assertEquals(a, b)\n\nInspection ID: ReplaceAssertBooleanWithAssertEquality" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceAssertBooleanWithAssertEquality", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComplexRedundantLet", + "shortDescription": { + "text": "Redundant argument-based 'let' call" + }, + "fullDescription": { + "text": "Reports a redundant argument-based 'let' call. 'let' is redundant when the lambda parameter is only used as a qualifier in a call expression. If you need to give a name to the qualifying expression, declare a local variable. Example: 'fun splitNumbers() {\n \"1,2,3\".let { it.split(',') }\n }' The quick-fix removes the extra 'let()' call: 'fun example() {\n \"1,2,3\".split(',')\n }' Alternative: 'fun splitNumbers() {\n val numbers = \"1,2,3\"\n numbers.split(',')\n }' Inspection ID: ComplexRedundantLet", + "markdown": "Reports a redundant argument-based `let` call.\n\n`let` is redundant when the lambda parameter is only used as a qualifier in a call expression.\n\nIf you need to give a name to the qualifying expression, declare a local variable.\n\n**Example:**\n\n\n fun splitNumbers() {\n \"1,2,3\".let { it.split(',') }\n }\n\nThe quick-fix removes the extra `let()` call:\n\n\n fun example() {\n \"1,2,3\".split(',')\n }\n\nAlternative:\n\n\n fun splitNumbers() {\n val numbers = \"1,2,3\"\n numbers.split(',')\n }\n\nInspection ID: ComplexRedundantLet" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ComplexRedundantLet", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveRedundantSpreadOperator", + "shortDescription": { + "text": "Redundant spread operator" + }, + "fullDescription": { + "text": "Reports the use of a redundant spread operator for a family of 'arrayOf' function calls. Use the 'Remove redundant spread operator' quick-fix to clean up the code. Examples: 'fun foo(vararg s: String) { }\n\n fun bar(ss: Array) {\n foo(*arrayOf(\"abc\")) // for the both calls of 'foo', array creation\n foo(*arrayOf(*ss, \"zzz\")) // and its subsequent \"spreading\" is redundant\n }' After the quick-fix is applied: 'fun foo(vararg s: String) { }\n\n fun bar(ss: Array) {\n foo(\"abc\")\n foo(*ss, \"zzz\")\n }' Inspection ID: RemoveRedundantSpreadOperator", + "markdown": "Reports the use of a redundant spread operator for a family of `arrayOf` function calls.\n\nUse the 'Remove redundant spread operator' quick-fix to clean up the code.\n\n**Examples:**\n\n\n fun foo(vararg s: String) { }\n\n fun bar(ss: Array) {\n foo(*arrayOf(\"abc\")) // for the both calls of 'foo', array creation\n foo(*arrayOf(*ss, \"zzz\")) // and its subsequent \"spreading\" is redundant\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(vararg s: String) { }\n\n fun bar(ss: Array) {\n foo(\"abc\")\n foo(*ss, \"zzz\")\n }\n\nInspection ID: RemoveRedundantSpreadOperator" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RemoveRedundantSpreadOperator", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectInheritsException", + "shortDescription": { + "text": "Exception should not be an object" + }, + "fullDescription": { + "text": "Reports object inherited from 'Exception' because exceptions are inherently stateful, containing information like the stacktrace. Example: 'object MyEx: Exception()' After the quick-fix is applied: 'class MyEx: Exception()' Inspection ID: ObjectInheritsException", + "markdown": "Reports object inherited from `Exception` because exceptions are inherently stateful, containing information like the stacktrace.\n\n**Example:**\n\n\n object MyEx: Exception()\n\nAfter the quick-fix is applied:\n\n\n class MyEx: Exception()\n\nInspection ID: ObjectInheritsException" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ObjectInheritsException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveSetterParameterType", + "shortDescription": { + "text": "Redundant setter parameter type" + }, + "fullDescription": { + "text": "Reports explicitly specified parameter types in property setters. Setter parameter type always matches the property type, so it's not required to be explicit. The 'Remove explicit type specification' quick-fix allows amending the code accordingly. Examples: 'fun process(x: Int) {}\n\n var x: Int = 0\n set(value: Int) = process(value) // <== 'Int' specification can be safely omitted' After the quick-fix is applied: 'fun process(x: Int) {}\n\n var x: Int = 0\n set(value) = process(value)' Inspection ID: RemoveSetterParameterType", + "markdown": "Reports explicitly specified parameter types in property setters.\n\n\nSetter parameter type always matches the property type, so it's not required to be explicit.\nThe 'Remove explicit type specification' quick-fix allows amending the code accordingly.\n\n**Examples:**\n\n\n fun process(x: Int) {}\n\n var x: Int = 0\n set(value: Int) = process(value) // <== 'Int' specification can be safely omitted\n\nAfter the quick-fix is applied:\n\n\n fun process(x: Int) {}\n\n var x: Int = 0\n set(value) = process(value)\n\nInspection ID: RemoveSetterParameterType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RemoveSetterParameterType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectPrivatePropertyName", + "shortDescription": { + "text": "Object private property naming convention" + }, + "fullDescription": { + "text": "Reports properties that do not follow the naming conventions. The following properties are reported: Private properties in objects and companion objects You can specify the required pattern in the inspection options. Recommended naming conventions: it has to start with an underscore or an uppercase letter, use camel case. Example: 'class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }' Inspection ID: ObjectPrivatePropertyName", + "markdown": "Reports properties that do not follow the naming conventions.\n\nThe following properties are reported:\n\n* Private properties in objects and companion objects\n\nYou can specify the required pattern in the inspection options.\n\n[Recommended naming conventions](https://kotlinlang.org/docs/coding-conventions.html#naming-rules): it has to start with an underscore or an uppercase letter, use camel case.\n\n**Example:**\n\n\n class Person {\n companion object {\n // property in companion object\n private val NO_NAME = Person()\n }\n }\n\nInspection ID: ObjectPrivatePropertyName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ObjectPrivatePropertyName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IfThenToElvis", + "shortDescription": { + "text": "If-Then foldable to '?:'" + }, + "fullDescription": { + "text": "Reports 'if-then' expressions that can be folded into elvis ('?:') expressions. Example: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo' The quick fix converts the 'if-then' expression into an elvis ('?:') expression: 'fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"' Inspection ID: IfThenToElvis", + "markdown": "Reports `if-then` expressions that can be folded into elvis (`?:`) expressions.\n\n**Example:**\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = if (foo == null) \"hello\" else foo\n\nThe quick fix converts the `if-then` expression into an elvis (`?:`) expression:\n\n\n fun maybeFoo(): String? = \"foo\"\n\n var foo = maybeFoo()\n val bar = foo ?: \"hello\"\n\nInspection ID: IfThenToElvis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "IfThenToElvis", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WrapUnaryOperator", + "shortDescription": { + "text": "Ambiguous unary operator use with number constant" + }, + "fullDescription": { + "text": "Reports an unary operator followed by a dot qualifier such as '-1.inc()'. Code like '-1.inc()' can be misleading because '-' has a lower precedence than '.inc()'. As a result, '-1.inc()' evaluates to '-2' and not '0' as it might be expected. Wrap unary operator and value with () quick-fix can be used to amend the code automatically. Inspection ID: WrapUnaryOperator", + "markdown": "Reports an unary operator followed by a dot qualifier such as `-1.inc()`.\n\nCode like `-1.inc()` can be misleading because `-` has a lower precedence than `.inc()`.\nAs a result, `-1.inc()` evaluates to `-2` and not `0` as it might be expected.\n\n**Wrap unary operator and value with ()** quick-fix can be used to amend the code automatically.\n\nInspection ID: WrapUnaryOperator" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "WrapUnaryOperator", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceNotNullAssertionWithElvisReturn", + "shortDescription": { + "text": "Not-null assertion can be replaced with 'return'" + }, + "fullDescription": { + "text": "Reports not-null assertion ('!!') calls that can be replaced with the elvis operator and return ('?: return'). A not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of '!!' is good practice. The quick-fix replaces the not-null assertion with 'return' or 'return null'. Example: 'fun test(number: Int?) {\n val x = number!!\n }' After the quick-fix is applied: 'fun test(number: Int?) {\n val x = number ?: return\n }' Inspection ID: ReplaceNotNullAssertionWithElvisReturn", + "markdown": "Reports not-null assertion (`!!`) calls that can be replaced with the elvis operator and return (`?: return`).\n\nA not-null assertion can lead to NPE (NullPointerException) that is not expected. Avoiding the use of `!!` is good practice.\n\nThe quick-fix replaces the not-null assertion with `return` or `return null`.\n\n**Example:**\n\n\n fun test(number: Int?) {\n val x = number!!\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(number: Int?) {\n val x = number ?: return\n }\n\nInspection ID: ReplaceNotNullAssertionWithElvisReturn" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceNotNullAssertionWithElvisReturn", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceSubstringWithSubstringBefore", + "shortDescription": { + "text": "'substring' call should be replaced with 'substringBefore'" + }, + "fullDescription": { + "text": "Reports calls like 's.substring(0, s.indexOf(x))' that can be replaced with 's.substringBefore(x)'. Using 'substringBefore()' makes your code simpler. The quick-fix replaces the 'substring' call with 'substringBefore'. Example: 'fun foo(s: String) {\n s.substring(0, s.indexOf('x'))\n }' After the quick-fix is applied: 'fun foo(s: String) {\n s.substringBefore('x')\n }' Inspection ID: ReplaceSubstringWithSubstringBefore", + "markdown": "Reports calls like `s.substring(0, s.indexOf(x))` that can be replaced with `s.substringBefore(x)`.\n\nUsing `substringBefore()` makes your code simpler.\n\nThe quick-fix replaces the `substring` call with `substringBefore`.\n\n**Example:**\n\n\n fun foo(s: String) {\n s.substring(0, s.indexOf('x'))\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(s: String) {\n s.substringBefore('x')\n }\n\nInspection ID: ReplaceSubstringWithSubstringBefore" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceSubstringWithSubstringBefore", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceJavaStaticMethodWithKotlinAnalog", + "shortDescription": { + "text": "Java methods should be replaced with Kotlin analog" + }, + "fullDescription": { + "text": "Reports a Java method call that can be replaced with a Kotlin function, for example, 'System.out.println()'. Replacing the code gets rid of the dependency to Java and makes the idiomatic Kotlin code. The quick-fix replaces the Java method calls on the same Kotlin call. Example: 'import java.util.Arrays\n\n fun main() {\n val a = Arrays.asList(1, 3, null)\n }' After the quick-fix is applied: 'fun main() {\n val a = listOf(1, 3, null)\n }' Inspection ID: ReplaceJavaStaticMethodWithKotlinAnalog", + "markdown": "Reports a Java method call that can be replaced with a Kotlin function, for example, `System.out.println()`.\n\nReplacing the code gets rid of the dependency to Java and makes the idiomatic Kotlin code.\n\nThe quick-fix replaces the Java method calls on the same Kotlin call.\n\n**Example:**\n\n\n import java.util.Arrays\n\n fun main() {\n val a = Arrays.asList(1, 3, null)\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val a = listOf(1, 3, null)\n }\n\nInspection ID: ReplaceJavaStaticMethodWithKotlinAnalog" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceJavaStaticMethodWithKotlinAnalog", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MapAwaitOnCollectionOfDeferred", + "shortDescription": { + "text": "'map { it.await() }' call on 'Collection' instead of single 'awaitAll()'" + }, + "fullDescription": { + "text": "Reports 'map { it.await() }' calls on collections of 'Deferred'. This can be replaced by a more concise and potentially more efficient 'awaitAll()' call. See the documentation for 'kotlinx.coroutines.awaitAll' for more details. Example: 'suspend fun waitForResult(results: List>): List {\n return results.map { it.await() }\n }' After the quick-fix is applied: 'suspend fun waitForResult(results: List>): List {\n return results.awaitAll()\n }' Inspection ID: MapAwaitOnCollectionOfDeferred", + "markdown": "Reports `map { it.await() }` calls on collections of `Deferred`.\n\n\nThis can be replaced by a more concise and potentially more efficient `awaitAll()` call.\n\n\nSee the documentation for `kotlinx.coroutines.awaitAll` for more details.\n\n**Example:**\n\n\n suspend fun waitForResult(results: List>): List {\n return results.map { it.await() }\n }\n\nAfter the quick-fix is applied:\n\n\n suspend fun waitForResult(results: List>): List {\n return results.awaitAll()\n }\n\nInspection ID: MapAwaitOnCollectionOfDeferred" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MapAwaitOnCollectionOfDeferred", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Coroutine inspections", + "index": 99, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ContextParametersMigration", + "shortDescription": { + "text": "Outdated context receivers used" + }, + "fullDescription": { + "text": "Reports context receivers which should be migrated to context parameters. Context receivers are superseded by context parameters starting from Kotlin 2.2.0. This inspection helps to migrate from context receivers to context parameters for projects that have enabled context receivers but have not yet migrated to context parameters syntax. Example: 'context(MutableList, C)\nprivate fun foo() {\n add(\"new\")\n bar()\n baz()\n}\n\nclass C {\n fun bar() {}\n}\n\nfun C.baz() {}' After the migration: 'context(strings: MutableList, c: C)\nprivate fun foo() {\n strings.add(\"new\")\n c.bar()\n c.baz()\n}\n\nclass C {\n fun bar() {}\n}\n\nfun C.baz() {}' Inspection ID: ContextParametersMigration", + "markdown": "Reports context receivers which should be migrated to context parameters.\n\n\nContext receivers are superseded by context parameters starting from Kotlin 2.2.0.\nThis inspection helps to migrate from context receivers to context parameters for projects\nthat have enabled context receivers but have not yet migrated to context parameters syntax.\n\n\nExample:\n\n\n context(MutableList, C)\n private fun foo() {\n add(\"new\")\n bar()\n baz()\n }\n\n class C {\n fun bar() {}\n }\n\n fun C.baz() {}\n\nAfter the migration:\n\n\n context(strings: MutableList, c: C)\n private fun foo() {\n strings.add(\"new\")\n c.bar()\n c.baz()\n }\n\n class C {\n fun bar() {}\n }\n\n fun C.baz() {}\n\nInspection ID: ContextParametersMigration" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "ContextParametersMigration", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Code migration", + "index": 87, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveEmptyParenthesesFromLambdaCall", + "shortDescription": { + "text": "Unnecessary parentheses in function call with lambda" + }, + "fullDescription": { + "text": "Reports redundant empty parentheses of function calls where the only parameter is a lambda that's outside the parentheses. Use the 'Remove unnecessary parentheses from function call with lambda' quick-fix to clean up the code. Examples: 'fun foo() {\n listOf(1).forEach() { }\n }' After the quick-fix is applied: 'fun foo() {\n listOf(1).forEach { }\n }' Inspection ID: RemoveEmptyParenthesesFromLambdaCall", + "markdown": "Reports redundant empty parentheses of function calls where the only parameter is a lambda that's outside the parentheses.\n\nUse the 'Remove unnecessary parentheses from function call with lambda' quick-fix to clean up the code.\n\n**Examples:**\n\n\n fun foo() {\n listOf(1).forEach() { }\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n listOf(1).forEach { }\n }\n\nInspection ID: RemoveEmptyParenthesesFromLambdaCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveEmptyParenthesesFromLambdaCall", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithOperatorAssignment", + "shortDescription": { + "text": "Assignment can be replaced with operator assignment" + }, + "fullDescription": { + "text": "Reports modifications of variables with a simple assignment (such as 'y = y + x') that can be replaced with an operator assignment. The quick-fix replaces the assignment with an assignment operator. Example: 'fun foo() {\n val list = mutableListOf(1, 2, 3)\n list = list + 4\n }' After the quick-fix is applied: 'fun foo() {\n val list = mutableListOf(1, 2, 3)\n list += 4\n }' Inspection ID: ReplaceWithOperatorAssignment", + "markdown": "Reports modifications of variables with a simple assignment (such as `y = y + x`) that can be replaced with an operator assignment.\n\nThe quick-fix replaces the assignment with an assignment operator.\n\n**Example:**\n\n\n fun foo() {\n val list = mutableListOf(1, 2, 3)\n list = list + 4\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n val list = mutableListOf(1, 2, 3)\n list += 4\n }\n\nInspection ID: ReplaceWithOperatorAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithOperatorAssignment", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveExplicitSuperQualifier", + "shortDescription": { + "text": "Unnecessary supertype qualification" + }, + "fullDescription": { + "text": "Reports 'super' member calls with redundant supertype qualification. Code in a derived class can call its superclass functions and property accessors implementations using the 'super' keyword. To specify the supertype from which the inherited implementation is taken, 'super' can be qualified by the supertype name in angle brackets, e.g. 'super'. Sometimes this qualification is redundant and can be omitted. Use the 'Remove explicit supertype qualification' quick-fix to clean up the code. Examples: 'open class B {\n open fun foo(){}\n }\n\n class A : B() {\n override fun foo() {\n super.foo() // <== redundant because 'B' is the only supertype\n }\n }\n\n interface I {\n fun foo() {}\n }\n\n class C : B(), I {\n override fun foo() {\n super.foo() // <== here qualifier is needed to distinguish 'B.foo()' from 'I.foo()'\n }\n }' After the quick-fix is applied: 'open class B {\n open fun foo(){}\n }\n\n class A : B() {\n override fun foo() {\n super.foo() // <== Updated\n }\n }\n\n interface I {\n fun foo() {}\n }\n\n class C : B(), I {\n override fun foo() {\n super.foo()\n }\n }' Inspection ID: RemoveExplicitSuperQualifier", + "markdown": "Reports `super` member calls with redundant supertype qualification.\n\n\nCode in a derived class can call its superclass functions and property accessors implementations using the `super` keyword.\nTo specify the supertype from which the inherited implementation is taken, `super` can be qualified by the supertype name in\nangle brackets, e.g. `super`. Sometimes this qualification is redundant and can be omitted.\nUse the 'Remove explicit supertype qualification' quick-fix to clean up the code.\n\n**Examples:**\n\n\n open class B {\n open fun foo(){}\n }\n\n class A : B() {\n override fun foo() {\n super.foo() // <== redundant because 'B' is the only supertype\n }\n }\n\n interface I {\n fun foo() {}\n }\n\n class C : B(), I {\n override fun foo() {\n super.foo() // <== here qualifier is needed to distinguish 'B.foo()' from 'I.foo()'\n }\n }\n\nAfter the quick-fix is applied:\n\n\n open class B {\n open fun foo(){}\n }\n\n class A : B() {\n override fun foo() {\n super.foo() // <== Updated\n }\n }\n\n interface I {\n fun foo() {}\n }\n\n class C : B(), I {\n override fun foo() {\n super.foo()\n }\n }\n\nInspection ID: RemoveExplicitSuperQualifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveExplicitSuperQualifier", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceContains", + "shortDescription": { + "text": "Replace 'contains' call with 'in' operator" + }, + "fullDescription": { + "text": "Replaces 'contains' member calls with an 'in' operator. Example: 'a.contains(b)' After the quick-fix is applied: 'b in a' Inspection ID: ReplaceContains", + "markdown": "Replaces `contains` member calls with an `in` operator.\n\n**Example:**\n\n a.contains(b)\n\nAfter the quick-fix is applied:\n\n b in a\n\nInspection ID: ReplaceContains" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceContains", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantExplicitType", + "shortDescription": { + "text": "Obvious explicit type" + }, + "fullDescription": { + "text": "Reports local variables' explicitly given types which are obvious and thus redundant, like 'val f: Foo = Foo()'. Example: 'class Point(val x: Int, val y: Int)\n\n fun foo() {\n val t: Boolean = true\n val p: Point = Point(1, 2)\n val i: Int = 42\n }' After the quick-fix is applied: 'class Point(val x: Int, val y: Int)\n\n fun foo() {\n val t = true\n val p = Point(1, 2)\n val i = 42\n }' Inspection ID: RedundantExplicitType", + "markdown": "Reports local variables' explicitly given types which are obvious and thus redundant, like `val f: Foo = Foo()`.\n\n**Example:**\n\n\n class Point(val x: Int, val y: Int)\n\n fun foo() {\n val t: Boolean = true\n val p: Point = Point(1, 2)\n val i: Int = 42\n }\n\nAfter the quick-fix is applied:\n\n\n class Point(val x: Int, val y: Int)\n\n fun foo() {\n val t = true\n val p = Point(1, 2)\n val i = 42\n }\n\nInspection ID: RedundantExplicitType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantExplicitType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedSymbol", + "shortDescription": { + "text": "Unused symbol" + }, + "fullDescription": { + "text": "Reports symbols that are not used or not reachable from entry points. Inspection ID: UnusedSymbol", + "markdown": "Reports symbols that are not used or not reachable from entry points.\n\nInspection ID: UnusedSymbol" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "unused", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousVarProperty", + "shortDescription": { + "text": "Suspicious 'var' property: its setter does not influence its getter result" + }, + "fullDescription": { + "text": "Reports 'var' properties with default setter and getter that do not reference backing field. Such properties do not affect calling its setter; therefore, it will be clearer to change such property to 'val' and delete the initializer. Change to val and delete initializer quick-fix can be used to amend the code automatically. Example: '// This property always returns '1' and it doesn't important that the property is a 'var'\n var foo: Int = 0\n get() = 1' Inspection ID: SuspiciousVarProperty", + "markdown": "Reports `var` properties with default setter and getter that do not reference backing field.\n\n\nSuch properties do not affect calling its setter; therefore, it will be clearer to change such property to `val` and delete the initializer.\n\n**Change to val and delete initializer** quick-fix can be used to amend the code automatically.\n\nExample:\n\n\n // This property always returns '1' and it doesn't important that the property is a 'var'\n var foo: Int = 0\n get() = 1\n\nInspection ID: SuspiciousVarProperty" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousVarProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedExpression", + "shortDescription": { + "text": "Unused expression" + }, + "fullDescription": { + "text": "Reports unused expressions, which often indicate incomplete code or a missing 'return' statement. If the unused expression is the last statement in a function and its type matches the function's return type, a quick fix is available to automatically add the 'return' keyword. Example: 'fun example(): Int {\n val x = 10\n x // Warning: Expression is unused\n}' After the quick-fix is applied: 'fun example(): Int {\n val x = 10\n return x\n}' Inspection ID: UnusedExpression", + "markdown": "Reports unused expressions, which often indicate incomplete code or a missing `return` statement.\n\n\nIf the unused expression is the last statement in a function and its type matches the function's return type,\na quick fix is available to automatically add the `return` keyword.\n\n**Example:**\n\n\n fun example(): Int {\n val x = 10\n x // Warning: Expression is unused\n }\n\nAfter the quick-fix is applied:\n\n\n fun example(): Int {\n val x = 10\n return x\n }\n\nInspection ID: UnusedExpression" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceCollectionCountWithSize", + "shortDescription": { + "text": "Collection count can be converted to size" + }, + "fullDescription": { + "text": "Reports calls to 'Collection.count()'. This function call can be replaced with '.size'. '.size' form ensures that the operation is O(1) and won't allocate extra objects, whereas 'count()' could be confused with 'Iterable.count()', which is O(n) and allocating. Example: 'fun foo() {\n var list = listOf(1,2,3)\n list.count() // replaceable 'count()'\n }' After the quick-fix is applied: 'fun foo() {\n var list = listOf(1,2,3)\n list.size\n }' Inspection ID: ReplaceCollectionCountWithSize", + "markdown": "Reports calls to `Collection.count()`.\n\n\nThis function call can be replaced with `.size`.\n\n\n`.size` form ensures that the operation is O(1) and won't allocate extra objects, whereas\n`count()` could be confused with `Iterable.count()`, which is O(n) and allocating.\n\n\n**Example:**\n\n fun foo() {\n var list = listOf(1,2,3)\n list.count() // replaceable 'count()'\n }\n\nAfter the quick-fix is applied:\n\n fun foo() {\n var list = listOf(1,2,3)\n list.size\n }\n\nInspection ID: ReplaceCollectionCountWithSize" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceCollectionCountWithSize", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceArrayEqualityOpWithArraysEquals", + "shortDescription": { + "text": "Arrays comparison via '==' and '!='" + }, + "fullDescription": { + "text": "Reports usages of '==' or '!=' operator for arrays that should be replaced with 'contentEquals()'. The '==' and '!='operators compare array references instead of their content. Examples: 'fun test() {\n val a = arrayOf(1, 2, 3)\n val b = arrayOf(1, 2, 3)\n println(a == b) // references comparison\n }' After the quick-fix is applied: 'fun test() {\n val a = arrayOf(1, 2, 3)\n val b = arrayOf(1, 2, 3)\n println(a.contentEquals(b))\n }' Inspection ID: ReplaceArrayEqualityOpWithArraysEquals", + "markdown": "Reports usages of `==` or `!=` operator for arrays that should be replaced with `contentEquals()`.\n\n\nThe `==` and `!=`operators compare array references instead of their content.\n\n**Examples:**\n\n fun test() {\n val a = arrayOf(1, 2, 3)\n val b = arrayOf(1, 2, 3)\n println(a == b) // references comparison\n }\n\nAfter the quick-fix is applied:\n\n fun test() {\n val a = arrayOf(1, 2, 3)\n val b = arrayOf(1, 2, 3)\n println(a.contentEquals(b))\n }\n\nInspection ID: ReplaceArrayEqualityOpWithArraysEquals" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ReplaceArrayEqualityOpWithArraysEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MoveVariableDeclarationIntoWhen", + "shortDescription": { + "text": "Variable declaration could be moved into 'when'" + }, + "fullDescription": { + "text": "Reports variable declarations that can be moved inside a 'when' expression. Example: 'fun someCalc(x: Int) = x * 42\n\nfun foo(x: Int): Int {\n val a = someCalc(x)\n return when (a) {\n 1 -> a\n 2 -> 2 * a\n else -> 24\n }\n}' After the quick-fix is applied: 'fun foo(x: Int): Int {\n return when (val a = someCalc(x)) {\n 1 -> a\n 2 -> 2 * a\n else -> 24\n }\n}' Inspection ID: MoveVariableDeclarationIntoWhen", + "markdown": "Reports variable declarations that can be moved inside a `when` expression.\n\n**Example:**\n\n\n fun someCalc(x: Int) = x * 42\n\n fun foo(x: Int): Int {\n val a = someCalc(x)\n return when (a) {\n 1 -> a\n 2 -> 2 * a\n else -> 24\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(x: Int): Int {\n return when (val a = someCalc(x)) {\n 1 -> a\n 2 -> 2 * a\n else -> 24\n }\n }\n\nInspection ID: MoveVariableDeclarationIntoWhen" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MoveVariableDeclarationIntoWhen", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DeprecatedGradleDependency", + "shortDescription": { + "text": "Deprecated library is used in Gradle" + }, + "fullDescription": { + "text": "Reports deprecated dependencies in Gradle build scripts. Example: 'dependencies {\n compile \"org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.0\"\n }' After the quick-fix applied: 'dependencies {\n compile \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.0\"\n }' Inspection ID: DeprecatedGradleDependency", + "markdown": "Reports deprecated dependencies in Gradle build scripts.\n\n**Example:**\n\n\n dependencies {\n compile \"org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.0\"\n }\n\nAfter the quick-fix applied:\n\n\n dependencies {\n compile \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.0\"\n }\n\nInspection ID: DeprecatedGradleDependency" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DeprecatedGradleDependency", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantLabel", + "shortDescription": { + "text": "Redundant label" + }, + "fullDescription": { + "text": "Reports redundant labels that cannot be referenced from 'break', 'continue' or 'return' statements. Such labels can be safely removed. Example: 'fun foo(c: Boolean) {\n b@ while (true) a@ {\n while (true) {\n break@b\n }\n }\n}' After the quick fix is applied: 'fun foo(c: Boolean) {\n b@ while (true) {\n while (true) {\n break@b\n }\n }\n}' Inspection ID: RedundantLabel", + "markdown": "Reports redundant labels that cannot be referenced from 'break', 'continue' or 'return' statements.\n\n\nSuch labels can be safely removed.\n\n**Example:**\n\n\n fun foo(c: Boolean) {\n b@ while (true) a@ {\n while (true) {\n break@b\n }\n }\n }\n\nAfter the quick fix is applied:\n\n\n fun foo(c: Boolean) {\n b@ while (true) {\n while (true) {\n break@b\n }\n }\n }\n\nInspection ID: RedundantLabel" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantLabel", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveEmptyParenthesesFromAnnotationEntry", + "shortDescription": { + "text": "Redundant parentheses in annotation" + }, + "fullDescription": { + "text": "Reports redundant empty parentheses in annotation entries. Use the 'Remove unnecessary parentheses' quick-fix to clean up the code. Examples: 'annotation class MyAnnotationA\n annotation class MyAnnotationB(val x: Int)\n annotation class MyAnnotationC(val x: Int = 10) // default value is present\n\n @MyAnnotationA() // <== parentheses are redundant\n fun testA() {\n }\n\n @MyAnnotationB() // <== missing argument, parentheses are required\n fun testB() {\n }\n\n @MyAnnotationC() // <== parentheses are redundant\n fun testC() {\n }' Inspection ID: RemoveEmptyParenthesesFromAnnotationEntry", + "markdown": "Reports redundant empty parentheses in annotation entries.\n\nUse the 'Remove unnecessary parentheses' quick-fix to clean up the code.\n\n**Examples:**\n\n\n annotation class MyAnnotationA\n annotation class MyAnnotationB(val x: Int)\n annotation class MyAnnotationC(val x: Int = 10) // default value is present\n\n @MyAnnotationA() // <== parentheses are redundant\n fun testA() {\n }\n\n @MyAnnotationB() // <== missing argument, parentheses are required\n fun testB() {\n }\n\n @MyAnnotationC() // <== parentheses are redundant\n fun testC() {\n }\n\nInspection ID: RemoveEmptyParenthesesFromAnnotationEntry" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveEmptyParenthesesFromAnnotationEntry", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForEachJoinOnCollectionOfJob", + "shortDescription": { + "text": "'forEach { it.join() }' call on 'Collection' instead of single 'joinAll()'" + }, + "fullDescription": { + "text": "Reports 'forEach { it.join() }' calls on collections of 'Job'. This can be replaced by a more concise and fully equivalent 'joinAll()' call. See the documentation for 'kotlinx.coroutines.joinAll' for more details. Example: 'suspend fun waitForJobs(jobs: List) {\n jobs.forEach { it.join() }\n }' After the quick-fix is applied: 'suspend fun waitForJobs(jobs: List) {\n jobs.joinAll()\n }' Inspection ID: ForEachJoinOnCollectionOfJob", + "markdown": "Reports `forEach { it.join() }` calls on collections of `Job`.\n\n\nThis can be replaced by a more concise and fully equivalent `joinAll()` call.\n\n\nSee the documentation for `kotlinx.coroutines.joinAll` for more details.\n\n**Example:**\n\n\n suspend fun waitForJobs(jobs: List) {\n jobs.forEach { it.join() }\n }\n\nAfter the quick-fix is applied:\n\n\n suspend fun waitForJobs(jobs: List) {\n jobs.joinAll()\n }\n\nInspection ID: ForEachJoinOnCollectionOfJob" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ForEachJoinOnCollectionOfJob", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Coroutine inspections", + "index": 99, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifiableCallChain", + "shortDescription": { + "text": "Call chain on collection type can be simplified" + }, + "fullDescription": { + "text": "Reports two-call chains replaceable by a single call. It can help you to avoid redundant code execution. The quick-fix replaces the call chain with a single call. Example: 'fun main() {\n listOf(1, 2, 3).filter { it > 1 }.count()\n }' After the quick-fix is applied: 'fun main() {\n listOf(1, 2, 3).count { it > 1 }\n }' Inspection ID: SimplifiableCallChain", + "markdown": "Reports two-call chains replaceable by a single call.\n\nIt can help you to avoid redundant code execution.\n\nThe quick-fix replaces the call chain with a single call.\n\n**Example:**\n\n\n fun main() {\n listOf(1, 2, 3).filter { it > 1 }.count()\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n listOf(1, 2, 3).count { it > 1 }\n }\n\nInspection ID: SimplifiableCallChain" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SimplifiableCallChain", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceCallWithBinaryOperator", + "shortDescription": { + "text": "Can be replaced with binary operator" + }, + "fullDescription": { + "text": "Reports function calls that can be replaced with binary operators, in particular comparison-related ones. Example: 'fun test(): Boolean {\n return 2.compareTo(1) > 0 // replaceable 'compareTo()'\n }' After the quick-fix is applied: 'fun test(): Boolean {\n return 2 > 1\n }' Inspection ID: ReplaceCallWithBinaryOperator", + "markdown": "Reports function calls that can be replaced with binary operators, in particular comparison-related ones.\n\n**Example:**\n\n fun test(): Boolean {\n return 2.compareTo(1) > 0 // replaceable 'compareTo()'\n }\n\nAfter the quick-fix is applied:\n\n fun test(): Boolean {\n return 2 > 1\n }\n\nInspection ID: ReplaceCallWithBinaryOperator" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceCallWithBinaryOperator", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplacePrintlnWithLogging", + "shortDescription": { + "text": "Call to 'print()' or 'println()'" + }, + "fullDescription": { + "text": "Reports usages of 'print' or 'println'. Such statements are often used for temporary debugging and should be either removed from the production code, or replaced by a more robust logging facility. Inspection ID: ReplacePrintlnWithLogging", + "markdown": "Reports usages of `print` or `println`.\n\nSuch statements are often used for temporary debugging and should be either removed from the production code, or replaced by a more robust\nlogging facility.\n\nInspection ID: ReplacePrintlnWithLogging" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReplacePrintlnWithLogging", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Other problems", + "index": 75, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedUnaryOperator", + "shortDescription": { + "text": "Unused unary operator" + }, + "fullDescription": { + "text": "Reports unary operators for number types on unused expressions. Unary operators break previous expression if they are used without braces. As a result, mathematical expressions spanning multi lines can be misleading. Example: 'fun main() {\n val result = 1 + 2 * 3\n + 3 // <== note that '+ 3' doesn't belong to the 'result' variable, it is unused\n println(\"Result = $result\") // The result is '7' and not '10' as it might be expected\n }' Inspection ID: UnusedUnaryOperator", + "markdown": "Reports unary operators for number types on unused expressions.\n\nUnary operators break previous expression if they are used without braces.\nAs a result, mathematical expressions spanning multi lines can be misleading.\n\nExample:\n\n\n fun main() {\n val result = 1 + 2 * 3\n + 3 // <== note that '+ 3' doesn't belong to the 'result' variable, it is unused\n println(\"Result = $result\") // The result is '7' and not '10' as it might be expected\n }\n\nInspection ID: UnusedUnaryOperator" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedUnaryOperator", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VariableNeverRead", + "shortDescription": { + "text": "Variable is never read" + }, + "fullDescription": { + "text": "Reports local variables that are defined but never used afterward in the code. Example: 'fun example() {\n var local = 42 // Variable 'local' is never read\n local = 0\n }' Inspection ID: VariableNeverRead", + "markdown": "Reports local variables that are defined but never used afterward in the code.\n\n**Example:**\n\n\n fun example() {\n var local = 42 // Variable 'local' is never read\n local = 0\n }\n\nInspection ID: VariableNeverRead" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "VariableNeverRead", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LateinitVarOverridesLateinitVar", + "shortDescription": { + "text": "'lateinit var' property overrides 'lateinit var' property" + }, + "fullDescription": { + "text": "Reports 'lateinit var' properties that override other 'lateinit var' properties. A subclass instance will have two fields for a single property, and the one from the superclass will remain effectively unused. Example: 'open class BaseClass {\n open lateinit var name: String\n }\n\n class RealClass : BaseClass() {\n override lateinit var name: String\n }' Inspection ID: LateinitVarOverridesLateinitVar", + "markdown": "Reports `lateinit var` properties that override other `lateinit var` properties.\n\nA subclass instance will have two fields for a single property, and the one from the superclass will remain effectively unused.\n\n**Example:**\n\n\n open class BaseClass {\n open lateinit var name: String\n }\n\n class RealClass : BaseClass() {\n override lateinit var name: String\n }\n\nInspection ID: LateinitVarOverridesLateinitVar" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "LateinitVarOverridesLateinitVar", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantInterpolationPrefix", + "shortDescription": { + "text": "Redundant interpolation prefix" + }, + "fullDescription": { + "text": "Reports redundant dollar prefixes in string template expressions. Such prefixes can be safely removed. Example: 'fun example() {\n $\"Example: prefix of length one is always redundant\"\n $$\"Example: string contains no interpolated values\"\n $$\"Example: $$ dollars are plain characters here $$\"\n}' After the quick fixes are applied: 'fun example() {\n \"Example: prefix of length one is always redundant\"\n \"Example: string contains no interpolated values\"\n \"Example: $$ dollars are plain characters here $$\"\n}' Inspection ID: RedundantInterpolationPrefix", + "markdown": "Reports redundant dollar prefixes in string template expressions.\n\n\nSuch prefixes can be safely removed.\n\n\nExample:\n\n\n fun example() {\n $\"Example: prefix of length one is always redundant\"\n $$\"Example: string contains no interpolated values\"\n $$\"Example: $$ dollars are plain characters here $$\"\n }\n\nAfter the quick fixes are applied:\n\n\n fun example() {\n \"Example: prefix of length one is always redundant\"\n \"Example: string contains no interpolated values\"\n \"Example: $$ dollars are plain characters here $$\"\n }\n\nInspection ID: RedundantInterpolationPrefix" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantInterpolationPrefix", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassName", + "shortDescription": { + "text": "Class naming convention" + }, + "fullDescription": { + "text": "Reports class names that do not follow the recommended naming conventions. Consistent naming allows for easier code reading and understanding. According to the Kotlin official style guide, class names should start with an uppercase letter and use camel case. It is possible to introduce other naming rules by changing the \"Pattern\" regular expression. Example: 'class user(val name: String)' The quick-fix renames the class according to the Kotlin naming conventions: 'class User(val name: String)' Inspection ID: ClassName", + "markdown": "Reports class names that do not follow the recommended naming conventions.\n\n\nConsistent naming allows for easier code reading and understanding.\nAccording to the [Kotlin official style guide](https://kotlinlang.org/docs/coding-conventions.html#naming-rules),\nclass names should start with an uppercase letter and use camel case.\n\nIt is possible to introduce other naming rules by changing the \"Pattern\" regular expression.\n\n**Example:**\n\n\n class user(val name: String)\n\nThe quick-fix renames the class according to the Kotlin naming conventions:\n\n\n class User(val name: String)\n\nInspection ID: ClassName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ClassName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveEmptySecondaryConstructorBody", + "shortDescription": { + "text": "Redundant constructor body" + }, + "fullDescription": { + "text": "Reports empty bodies of secondary constructors. Inspection ID: RemoveEmptySecondaryConstructorBody", + "markdown": "Reports empty bodies of secondary constructors.\n\nInspection ID: RemoveEmptySecondaryConstructorBody" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveEmptySecondaryConstructorBody", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FloatingPointLiteralPrecision", + "shortDescription": { + "text": "Floating-point literal exceeds the available precision" + }, + "fullDescription": { + "text": "Reports floating-point literals that cannot be represented with the required precision using IEEE 754 'Float' and 'Double' types. For example, '1.9999999999999999999' has too many significant digits, so its representation as a 'Double' will be rounded to '2.0'. Specifying excess digits may be misleading as it hides the fact that computations use rounded values instead. The quick-fix replaces the literal with a rounded value that matches the actual representation of the constant. Example: 'val x: Float = 3.14159265359f' After the quick-fix is applied: 'val x: Float = 3.1415927f' Inspection ID: FloatingPointLiteralPrecision", + "markdown": "Reports floating-point literals that cannot be represented with the required precision using [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754) `Float` and `Double` types.\n\n\nFor example, `1.9999999999999999999` has too many significant digits,\nso its representation as a `Double` will be rounded to `2.0`.\nSpecifying excess digits may be misleading as it hides the fact that computations\nuse rounded values instead.\n\n\nThe quick-fix replaces the literal with a rounded value that matches the actual representation\nof the constant.\n\n**Example:**\n\n\n val x: Float = 3.14159265359f\n\nAfter the quick-fix is applied:\n\n\n val x: Float = 3.1415927f\n\nInspection ID: FloatingPointLiteralPrecision" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "FloatingPointLiteralPrecision", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Other problems", + "index": 75, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DifferentKotlinGradleVersion", + "shortDescription": { + "text": "Kotlin Gradle and IDE plugins versions are different" + }, + "fullDescription": { + "text": "Reports that Gradle plugin version isn't properly supported in the current IDE plugin. This can cause inconsistencies between IDE and Gradle builds in error reporting or code behavior. Example: 'dependencies {\n classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:0.0.1\"\n }' To fix the problem, change the Kotlin Gradle plugin version to match the version of Kotlin that is bundled into the IDE plugin. Inspection ID: DifferentKotlinGradleVersion", + "markdown": "Reports that Gradle plugin version isn't properly supported in the current IDE plugin.\n\nThis can cause inconsistencies between IDE and Gradle builds in error reporting or code behavior.\n\n**Example:**\n\n\n dependencies {\n classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:0.0.1\"\n }\n\nTo fix the problem, change the Kotlin Gradle plugin version to match the version of Kotlin that is bundled into the IDE plugin.\n\nInspection ID: DifferentKotlinGradleVersion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DifferentKotlinGradleVersion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertPairConstructorToToFunction", + "shortDescription": { + "text": "Convert Pair constructor to 'to' function" + }, + "fullDescription": { + "text": "Reports a 'Pair' constructor invocation that can be replaced with a 'to()' infix function call. Explicit constructor invocations may add verbosity, especially if they are used multiple times. Replacing constructor calls with 'to()' makes code easier to read and maintain. Example: 'val countries = mapOf(\n Pair(\"France\", \"Paris\"),\n Pair(\"Spain\", \"Madrid\"),\n Pair(\"Germany\", \"Berlin\")\n )' After the quick-fix is applied: 'val countries = mapOf(\n \"France\" to \"Paris\",\n \"Spain\" to \"Madrid\",\n \"Germany\" to \"Berlin\"\n )' Inspection ID: ConvertPairConstructorToToFunction", + "markdown": "Reports a `Pair` constructor invocation that can be replaced with a `to()` infix function call.\n\n\nExplicit constructor invocations may add verbosity, especially if they are used multiple times.\nReplacing constructor calls with `to()` makes code easier to read and maintain.\n\n**Example:**\n\n\n val countries = mapOf(\n Pair(\"France\", \"Paris\"),\n Pair(\"Spain\", \"Madrid\"),\n Pair(\"Germany\", \"Berlin\")\n )\n\nAfter the quick-fix is applied:\n\n\n val countries = mapOf(\n \"France\" to \"Paris\",\n \"Spain\" to \"Madrid\",\n \"Germany\" to \"Berlin\"\n )\n\nInspection ID: ConvertPairConstructorToToFunction" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertPairConstructorToToFunction", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantGetter", + "shortDescription": { + "text": "Redundant property getter" + }, + "fullDescription": { + "text": "Reports redundant property getters. Example: 'class Test {\n val a = 1\n get\n val b = 1\n get() = field\n }' After the quick-fix is applied: 'class Test {\n val a = 1\n val b = 1\n }' Inspection ID: RedundantGetter", + "markdown": "Reports redundant property getters.\n\n**Example:**\n\n\n class Test {\n val a = 1\n get\n val b = 1\n get() = field\n }\n\nAfter the quick-fix is applied:\n\n\n class Test {\n val a = 1\n val b = 1\n }\n\nInspection ID: RedundantGetter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantGetter", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantIf", + "shortDescription": { + "text": "Redundant 'if' statement" + }, + "fullDescription": { + "text": "Reports 'if' statements which can be simplified to a single statement. Example: 'fun test(): Boolean {\n if (foo()) {\n return true\n } else {\n return false\n }\n }' After the quick-fix is applied: 'fun test(): Boolean {\n return foo()\n }' Inspection ID: RedundantIf", + "markdown": "Reports `if` statements which can be simplified to a single statement.\n\n**Example:**\n\n\n fun test(): Boolean {\n if (foo()) {\n return true\n } else {\n return false\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(): Boolean {\n return foo()\n }\n\nInspection ID: RedundantIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantIf", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PreferCurrentCoroutineContextToCoroutineContext", + "shortDescription": { + "text": "Potentially ambiguous 'kotlin.coroutine.coroutineContext' usage" + }, + "fullDescription": { + "text": "Reports usages of 'kotlin.coroutine.coroutineContext' property in code that has a dependency on 'kotlinx.coroutines' library. When both 'kotlin.coroutine.coroutineContext' and 'kotlinx.coroutines.CoroutineScope.coroutineContext' can be present in the code, it can lead to confusion and potential bugs. The 'kotlinx.coroutines' library provides 'currentCoroutineContext()' function as a clearer alternative that should be preferred even when there is no explicit clash. See the documentation for 'kotlin.coroutine.coroutineContext' and 'kotlinx.coroutines.currentCoroutineContext' for more details. Example: 'suspend fun getCurrentJob(): Job? {\n return coroutineContext[Job]\n }' After the quick-fix is applied: 'suspend fun getCurrentJob(): Job? {\n return currentCoroutineContext()[Job]\n }' Inspection ID: PreferCurrentCoroutineContextToCoroutineContext", + "markdown": "Reports usages of `kotlin.coroutine.coroutineContext` property in code that has a dependency on `kotlinx.coroutines` library.\n\n\nWhen both `kotlin.coroutine.coroutineContext` and `kotlinx.coroutines.CoroutineScope.coroutineContext`\ncan be present in the code, it can lead to confusion and potential bugs.\n\n\nThe `kotlinx.coroutines` library provides `currentCoroutineContext()` function\nas a clearer alternative that should be preferred even when there is no explicit clash.\n\n\nSee the documentation for `kotlin.coroutine.coroutineContext`\nand `kotlinx.coroutines.currentCoroutineContext` for more details.\n\n**Example:**\n\n\n suspend fun getCurrentJob(): Job? {\n return coroutineContext[Job]\n }\n\nAfter the quick-fix is applied:\n\n\n suspend fun getCurrentJob(): Job? {\n return currentCoroutineContext()[Job]\n }\n\nInspection ID: PreferCurrentCoroutineContextToCoroutineContext" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PreferCurrentCoroutineContextToCoroutineContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Coroutine inspections", + "index": 99, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JoinDeclarationAndAssignment", + "shortDescription": { + "text": "If-Then foldable to '?.'" + }, + "fullDescription": { + "text": "Reports property declarations that can be joined with the following assignment. Example: 'val x: String\n x = System.getProperty(\"\")' The quick fix joins the declaration with the assignment: 'val x = System.getProperty(\"\")' Configure the inspection: You can disable the option Report with complex initialization of member properties to skip properties with complex initialization. This covers two cases: The property initializer is complex (it is a multiline or a compound/control-flow expression) The property is first initialized and then immediately used in subsequent code (for example, to call additional initialization methods) Inspection ID: JoinDeclarationAndAssignment", + "markdown": "Reports property declarations that can be joined with the following assignment.\n\n**Example:**\n\n\n val x: String\n x = System.getProperty(\"\")\n\nThe quick fix joins the declaration with the assignment:\n\n\n val x = System.getProperty(\"\")\n\nConfigure the inspection:\n\nYou can disable the option **Report with complex initialization of member properties** to skip properties with complex initialization. This covers two cases:\n\n1. The property initializer is complex (it is a multiline or a compound/control-flow expression)\n2. The property is first initialized and then immediately used in subsequent code (for example, to call additional initialization methods)\n\nInspection ID: JoinDeclarationAndAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JoinDeclarationAndAssignment", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinEqualsBetweenInconvertibleTypes", + "shortDescription": { + "text": "'equals()' between objects of inconvertible types" + }, + "fullDescription": { + "text": "Reports calls to 'equals()' where the receiver and the argument are of incompatible primitive, enum, or string types. While such a call might theoretically be useful, most likely it represents a bug. Example: '5.equals(\"\");' Inspection ID: KotlinEqualsBetweenInconvertibleTypes", + "markdown": "Reports calls to `equals()` where the receiver and the argument are of incompatible primitive, enum, or string types.\n\nWhile such a call might theoretically be useful, most likely it represents a bug.\n\n**Example:**\n\n 5.equals(\"\");\n\nInspection ID: KotlinEqualsBetweenInconvertibleTypes" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EqualsBetweenInconvertibleTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveExplicitTypeArguments", + "shortDescription": { + "text": "Unnecessary type argument" + }, + "fullDescription": { + "text": "Reports function calls with type arguments that can be automatically inferred. Such type arguments are redundant and can be safely omitted. Use the 'Remove explicit type arguments' quick-fix to clean up the code. Examples: '// 'String' type can be inferred here\n fun foo(): MutableList = mutableListOf()\n\n // Here 'String' cannot be inferred, type argument is required.\n fun bar() = mutableListOf()' After the quick-fix is applied: 'fun foo(): MutableList = mutableListOf() <== Updated\n\n fun bar() = mutableListOf()' Inspection ID: RemoveExplicitTypeArguments", + "markdown": "Reports function calls with type arguments that can be automatically inferred. Such type arguments are redundant and can be safely omitted.\n\nUse the 'Remove explicit type arguments' quick-fix to clean up the code.\n\n**Examples:**\n\n\n // 'String' type can be inferred here\n fun foo(): MutableList = mutableListOf()\n\n // Here 'String' cannot be inferred, type argument is required.\n fun bar() = mutableListOf()\n\nAfter the quick-fix is applied:\n\n\n fun foo(): MutableList = mutableListOf() <== Updated\n\n fun bar() = mutableListOf()\n\nInspection ID: RemoveExplicitTypeArguments" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveExplicitTypeArguments", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HasPlatformType", + "shortDescription": { + "text": "Function or property has platform type" + }, + "fullDescription": { + "text": "Reports functions and properties that have a platform type. To prevent unexpected errors, the type should be declared explicitly. Example: 'fun foo() = java.lang.String.valueOf(1)' The quick fix allows you to specify the return type: 'fun foo(): String = java.lang.String.valueOf(1)' Inspection ID: HasPlatformType", + "markdown": "Reports functions and properties that have a platform type.\n\nTo prevent unexpected errors, the type should be declared explicitly.\n\n**Example:**\n\n\n fun foo() = java.lang.String.valueOf(1)\n\nThe quick fix allows you to specify the return type:\n\n\n fun foo(): String = java.lang.String.valueOf(1)\n\nInspection ID: HasPlatformType" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "HasPlatformType", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Java interop issues", + "index": 67, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantVisibilityModifier", + "shortDescription": { + "text": "Redundant visibility modifier" + }, + "fullDescription": { + "text": "Reports visibility modifiers that match the default visibility of an element ('public' for most elements, 'protected' for members that override a protected member). Inspection ID: RedundantVisibilityModifier", + "markdown": "Reports visibility modifiers that match the default visibility of an element (`public` for most elements, `protected` for members that override a protected member).\n\nInspection ID: RedundantVisibilityModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantVisibilityModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EnumValuesSoftDeprecateInJava", + "shortDescription": { + "text": "'Enum.values()' is recommended to be replaced by 'Enum.getEntries()' since Kotlin 1.9" + }, + "fullDescription": { + "text": "Reports calls from Java to 'values()' method of Kotlin enum classes that can be replaced with 'getEntries()'. Use of 'Enum.getEntries()' may improve performance of your code. More details: KT-48872 Provide modern and performant replacement for Enum.values() Inspection ID: EnumValuesSoftDeprecateInJava", + "markdown": "Reports calls from Java to `values()` method of Kotlin enum classes that can be replaced with `getEntries()`.\n\n\nUse of `Enum.getEntries()` may improve performance of your code.\n\n\n**More details:** [KT-48872 Provide modern and performant replacement for Enum.values()](https://youtrack.jetbrains.com/issue/KT-48872)\n\nInspection ID: EnumValuesSoftDeprecateInJava" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EnumValuesSoftDeprecateInJava", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Other problems", + "index": 75, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertFromMultiDollarToRegularString", + "shortDescription": { + "text": "Removable multi-dollar interpolation prefix" + }, + "fullDescription": { + "text": "Reports all strings with an interpolation prefix. The quick for the inspection fix removes the interpolation prefix, updates interpolation entries and escapes unsafe dollar characters. Example: 'val foo = $$\"\"\"\n{\n \"foo\": $ref,\n \"bar\": {\n \"baz\": \"$20\"\n \"boo\": \"$${100 + 200}\"\n }\n}\n\"\"\"' After the quick fix is applied: 'val foo = \"\"\"\n{\n \"foo\": ${'$'}ref,\n \"bar\": {\n \"baz\": \"$20\"\n \"boo\": \"${100 + 200}\"\n }\n}\n\"\"\"' Inspection ID: ConvertFromMultiDollarToRegularString", + "markdown": "Reports all strings with an interpolation prefix.\n\n\nThe quick for the inspection fix removes the interpolation prefix, updates interpolation entries and escapes unsafe dollar characters.\n\n**Example:**\n\n\n val foo = $$\"\"\"\n {\n \"foo\": $ref,\n \"bar\": {\n \"baz\": \"$20\"\n \"boo\": \"$${100 + 200}\"\n }\n }\n \"\"\"\n\n**After the quick fix is applied:**\n\n\n val foo = \"\"\"\n {\n \"foo\": ${'$'}ref,\n \"bar\": {\n \"baz\": \"$20\"\n \"boo\": \"${100 + 200}\"\n }\n }\n \"\"\"\n\nInspection ID: ConvertFromMultiDollarToRegularString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertFromMultiDollarToRegularString", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Code migration", + "index": 87, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinUnreachableCode", + "shortDescription": { + "text": "Unreachable code" + }, + "fullDescription": { + "text": "Reports code statements are unreachable for execution. The quick-fix removes unreachable code. Example: 'fun value(): Int {\n return 42\n print(\"Hello, world !\")\n }' After the quick-fix is applied: 'fun value(): Int {\n return 42\n }' Inspection ID: KotlinUnreachableCode", + "markdown": "Reports code statements are unreachable for execution.\n\n\nThe quick-fix removes unreachable code.\n\n**Example:**\n\n\n fun value(): Int {\n return 42\n print(\"Hello, world !\")\n }\n\nAfter the quick-fix is applied:\n\n\n fun value(): Int {\n return 42\n }\n\nInspection ID: KotlinUnreachableCode" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "KotlinUnreachableCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UsePropertyAccessSyntax", + "shortDescription": { + "text": "Accessor call that can be replaced with property access syntax" + }, + "fullDescription": { + "text": "Reports Java 'get' and 'set' method calls that can be replaced with the Kotlin synthetic properties. Use property access syntax quick-fix can be used to amend the code automatically. Example: '// Java:\n public class JavaClassWithGetter {\n private final String expr = \"result\";\n\n // ...\n\n public String getExpr() {\n return expr;\n }\n }' '// Kotlin:\n fun test(j: JavaClassWithGetter) {\n // ...\n j.getExpr() // <== The quick-fix simplifies the expression to 'j.expr'\n }' Inspection ID: UsePropertyAccessSyntax", + "markdown": "Reports Java `get` and `set` method calls that can be replaced with the Kotlin synthetic properties.\n\n**Use property access syntax** quick-fix can be used to amend the code automatically.\n\nExample:\n\n\n // Java:\n public class JavaClassWithGetter {\n private final String expr = \"result\";\n\n // ...\n\n public String getExpr() {\n return expr;\n }\n }\n\n\n // Kotlin:\n fun test(j: JavaClassWithGetter) {\n // ...\n j.getExpr() // <== The quick-fix simplifies the expression to 'j.expr'\n }\n\nInspection ID: UsePropertyAccessSyntax" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UsePropertyAccessSyntax", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseExpressionBody", + "shortDescription": { + "text": "Expression body syntax is preferable here" + }, + "fullDescription": { + "text": "Reports 'return' expressions (one-liners or 'when') that can be replaced with expression body syntax. Expression body syntax is recommended by the style guide. Convert to expression body quick-fix can be used to amend the code automatically. Example: 'fun sign(x: Int): Int {\n return when { // <== can be simplified\n x < 0 -> -1\n x > 0 -> 1\n else -> 0\n }\n }' After the quick-fix is applied: 'fun sign(x: Int): Int = when {\n x < 0 -> -1\n x > 0 -> 1\n else -> 0\n }' Inspection ID: UseExpressionBody", + "markdown": "Reports `return` expressions (one-liners or `when`) that can be replaced with expression body syntax.\n\nExpression body syntax is recommended by the [style guide](https://kotlinlang.org/docs/coding-conventions.html#functions).\n\n**Convert to expression body** quick-fix can be used to amend the code automatically.\n\nExample:\n\n\n fun sign(x: Int): Int {\n return when { // <== can be simplified\n x < 0 -> -1\n x > 0 -> 1\n else -> 0\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun sign(x: Int): Int = when {\n x < 0 -> -1\n x > 0 -> 1\n else -> 0\n }\n\nInspection ID: UseExpressionBody" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseExpressionBody", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DataClassPrivateConstructor", + "shortDescription": { + "text": "Private data class constructor is exposed via the 'copy' method" + }, + "fullDescription": { + "text": "Reports the 'private' primary constructor in data classes. 'data' classes have a 'copy()' factory method that can be used similarly to a constructor. A constructor should not be marked as 'private' to provide enough safety. Example: 'data class User private constructor(val name: String)' The quick-fix changes the constructor visibility modifier to 'public': 'data class User(val name: String)' Inspection ID: DataClassPrivateConstructor", + "markdown": "Reports the `private` primary constructor in data classes.\n\n\n`data` classes have a `copy()` factory method that can be used similarly to a constructor.\nA constructor should not be marked as `private` to provide enough safety.\n\n**Example:**\n\n\n data class User private constructor(val name: String)\n\nThe quick-fix changes the constructor visibility modifier to `public`:\n\n\n data class User(val name: String)\n\nInspection ID: DataClassPrivateConstructor" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DataClassPrivateConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantInnerClassModifier", + "shortDescription": { + "text": "Redundant 'inner' modifier" + }, + "fullDescription": { + "text": "Reports the 'inner' modifier on a class as redundant if it doesn't reference members of its outer class. Example: 'class Foo {\n inner class InnerClass { // redundant `inner` modifier\n fun hello() {\n println(\"Hi!\")\n }\n }\n }\n\n class List {\n val objects = Array(42) { Any() }\n\n inner class Iterator { // Not redundant `inner` modifier\n fun next(): Any {\n return objects[0]\n }\n }\n }' After the quick-fix is applied: 'class Foo {\n class InnerClass { // redundant `inner` modifier\n fun hello() {\n println(\"Hi!\")\n }\n }\n }\n\n class List {\n val objects = Array(42) { Any() }\n\n inner class Iterator { // Not redundant `inner` modifier\n fun next(): Any {\n return objects[0]\n }\n }\n }' Inspection ID: RedundantInnerClassModifier", + "markdown": "Reports the `inner` modifier on a class as redundant if it doesn't reference members of its outer class.\n\n**Example:**\n\n\n class Foo {\n inner class InnerClass { // redundant `inner` modifier\n fun hello() {\n println(\"Hi!\")\n }\n }\n }\n\n class List {\n val objects = Array(42) { Any() }\n\n inner class Iterator { // Not redundant `inner` modifier\n fun next(): Any {\n return objects[0]\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n class InnerClass { // redundant `inner` modifier\n fun hello() {\n println(\"Hi!\")\n }\n }\n }\n\n class List {\n val objects = Array(42) { Any() }\n\n inner class Iterator { // Not redundant `inner` modifier\n fun next(): Any {\n return objects[0]\n }\n }\n }\n\nInspection ID: RedundantInnerClassModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantInnerClassModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MapGetWithNotNullAssertionOperator", + "shortDescription": { + "text": "'map.get()' with not-null assertion operator (!!)" + }, + "fullDescription": { + "text": "Reports 'map.get()!!' that can be replaced with 'map.getValue()', 'map.getOrElse()', and so on. Example: 'fun test(map: Map): String = map.get(0)!!' After the quick-fix is applied: 'fun test(map: Map): String = map.getValue(0)' Inspection ID: MapGetWithNotNullAssertionOperator", + "markdown": "Reports `map.get()!!` that can be replaced with `map.getValue()`, `map.getOrElse()`, and so on.\n\n**Example:**\n\n\n fun test(map: Map): String = map.get(0)!!\n\nAfter the quick-fix is applied:\n\n\n fun test(map: Map): String = map.getValue(0)\n\nInspection ID: MapGetWithNotNullAssertionOperator" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MapGetWithNotNullAssertionOperator", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SortModifiers", + "shortDescription": { + "text": "Non-canonical modifier order" + }, + "fullDescription": { + "text": "Reports modifiers that do not follow the order recommended by the style guide. Sort modifiers quick-fix can be used to amend the code automatically. Examples: 'private inline fun correctOrder(f: () -> Unit) {} // <== Ok\n\n infix private fun Int.wrongOrder(expr: Int) {} // <== wrong order, quick-fix amends the modifiers to \"private infix\"' Inspection ID: SortModifiers", + "markdown": "Reports modifiers that do not follow the order recommended by the [style guide](https://kotlinlang.org/docs/coding-conventions.html#modifiers-order).\n\n**Sort modifiers** quick-fix can be used to amend the code automatically.\n\nExamples:\n\n\n private inline fun correctOrder(f: () -> Unit) {} // <== Ok\n\n infix private fun Int.wrongOrder(expr: Int) {} // <== wrong order, quick-fix amends the modifiers to \"private infix\"\n\nInspection ID: SortModifiers" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SortModifiers", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MavenCoroutinesDeprecation", + "shortDescription": { + "text": "Incompatible kotlinx.coroutines dependency is used with Kotlin 1.3+ in Maven" + }, + "fullDescription": { + "text": "Reports kotlinx.coroutines library dependencies in Maven that should be updated in order to be compatible with Kotlin 1.3 and later. Inspection ID: MavenCoroutinesDeprecation", + "markdown": "Reports **kotlinx.coroutines** library dependencies in Maven that should be updated in order to be compatible with Kotlin 1.3 and later.\n\nInspection ID: MavenCoroutinesDeprecation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MavenCoroutinesDeprecation", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Migration/Maven", + "index": 114, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NullableBooleanElvis", + "shortDescription": { + "text": "Equality check can be used instead of elvis for nullable boolean check" + }, + "fullDescription": { + "text": "Reports cases when an equality check should be used instead of the elvis operator. Example: 'fun check(a: Boolean? = null) {\n if (a ?: false) throw IllegalStateException()\n}' After the quick-fix is applied: 'fun check(a: Boolean? = null) {\n if (a == true) throw IllegalStateException()\n}' Inspection ID: NullableBooleanElvis", + "markdown": "Reports cases when an equality check should be used instead of the elvis operator.\n\n**Example:**\n\n\n fun check(a: Boolean? = null) {\n if (a ?: false) throw IllegalStateException()\n }\n\nAfter the quick-fix is applied:\n\n\n fun check(a: Boolean? = null) {\n if (a == true) throw IllegalStateException()\n }\n\nInspection ID: NullableBooleanElvis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "NullableBooleanElvis", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DeprecatedMavenDependency", + "shortDescription": { + "text": "Deprecated library is used in Maven" + }, + "fullDescription": { + "text": "Reports deprecated maven dependency. Example: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n ' The quick fix changes the deprecated dependency to a maintained one: '\n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n ' Inspection ID: DeprecatedMavenDependency", + "markdown": "Reports deprecated maven dependency.\n\n**Example:**\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jre7\n ${kotlin.version}\n \n \n\nThe quick fix changes the deprecated dependency to a maintained one:\n\n\n \n \n org.jetbrains.kotlin\n kotlin-stdlib-jdk7\n ${kotlin.version}\n \n \n\nInspection ID: DeprecatedMavenDependency" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DeprecatedMavenDependency", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryVariable", + "shortDescription": { + "text": "Unnecessary local variable" + }, + "fullDescription": { + "text": "Reports local variables that are used only in the very next 'return' statement or are exact copies of other variables. Such variables can be safely inlined to make the code more clear. Example: 'fun sum(a: Int, b: Int): Int {\n val c = a + b\n return c\n }' After the quick-fix is applied: 'fun sum(a: Int, b: Int): Int {\n return a + b\n }' Configure the inspection: Use the Report immediately returned variables option to report immediately returned variables. When given descriptive names, such variables may improve the code readability in some cases, that's why this option is disabled by default. Inspection ID: UnnecessaryVariable", + "markdown": "Reports local variables that are used only in the very next `return` statement or are exact copies of other variables.\n\nSuch variables can be safely inlined to make the code more clear.\n\n**Example:**\n\n\n fun sum(a: Int, b: Int): Int {\n val c = a + b\n return c\n }\n\nAfter the quick-fix is applied:\n\n\n fun sum(a: Int, b: Int): Int {\n return a + b\n }\n\nConfigure the inspection:\n\nUse the **Report immediately returned variables** option to report immediately returned variables.\nWhen given descriptive names, such variables may improve the code readability in some cases, that's why this option is disabled by default.\n\nInspection ID: UnnecessaryVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UnnecessaryVariable", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EnumEntryName", + "shortDescription": { + "text": "Enum entry naming convention" + }, + "fullDescription": { + "text": "Reports enum entry names that do not follow the recommended naming conventions. Example: 'enum class Foo {\n _Foo,\n foo\n }' To fix the problem rename enum entries to match the recommended naming conventions. Inspection ID: EnumEntryName", + "markdown": "Reports enum entry names that do not follow the recommended naming conventions.\n\n**Example:**\n\n\n enum class Foo {\n _Foo,\n foo\n }\n\nTo fix the problem rename enum entries to match the recommended naming conventions.\n\nInspection ID: EnumEntryName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EnumEntryName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceSubstringWithDropLast", + "shortDescription": { + "text": "'substring' call should be replaced with 'dropLast' call" + }, + "fullDescription": { + "text": "Reports calls like 's.substring(0, s.length - x)' that can be replaced with 's.dropLast(x)'. Using corresponding functions makes your code simpler. The quick-fix replaces the 'substring' call with 'dropLast'. Example: 'fun foo(s: String) {\n s.substring(0, s.length - 5)\n }' After the quick-fix is applied: 'fun foo(s: String) {\n s.dropLast(5)\n }' Inspection ID: ReplaceSubstringWithDropLast", + "markdown": "Reports calls like `s.substring(0, s.length - x)` that can be replaced with `s.dropLast(x)`.\n\nUsing corresponding functions makes your code simpler.\n\nThe quick-fix replaces the `substring` call with `dropLast`.\n\n**Example:**\n\n\n fun foo(s: String) {\n s.substring(0, s.length - 5)\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(s: String) {\n s.dropLast(5)\n }\n\nInspection ID: ReplaceSubstringWithDropLast" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceSubstringWithDropLast", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CopyWithoutNamedArguments", + "shortDescription": { + "text": "'copy' method of data class is called without named arguments" + }, + "fullDescription": { + "text": "Reports calls to a data class' 'copy()' method without named arguments. As all arguments of the 'copy()' function are optional, it might be hard to understand what properties are modified. Providing parameter names explicitly makes code easy to understand without navigating to the 'data class' declaration. Example: 'data class User(val name: String, val age: Int)\n\n fun copyUser(user: User): User {\n return user.copy(\"John\")\n }' The quick-fix provides parameter names to all 'copy()' arguments: 'data class User(val name: String, val age: Int)\n\n fun copyUser(user: User): User {\n return user.copy(name = \"John\")\n }' Inspection ID: CopyWithoutNamedArguments", + "markdown": "Reports calls to a data class' `copy()` method without named arguments.\n\n\nAs all arguments of the `copy()` function are optional, it might be hard to understand what properties are modified.\nProviding parameter names explicitly makes code easy to understand without navigating to the `data class` declaration.\n\n**Example:**\n\n\n data class User(val name: String, val age: Int)\n\n fun copyUser(user: User): User {\n return user.copy(\"John\")\n }\n\nThe quick-fix provides parameter names to all `copy()` arguments:\n\n\n data class User(val name: String, val age: Int)\n\n fun copyUser(user: User): User {\n return user.copy(name = \"John\")\n }\n\nInspection ID: CopyWithoutNamedArguments" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CopyWithoutNamedArguments", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantConstructorKeyword", + "shortDescription": { + "text": "Redundant 'constructor' keyword" + }, + "fullDescription": { + "text": "Reports a redundant 'constructor' keyword on primary constructors. Example: 'class Foo constructor(x: Int, y: Int)' After the quick-fix is applied: 'class Foo(x: Int, y: Int)' Inspection ID: RedundantConstructorKeyword", + "markdown": "Reports a redundant 'constructor' keyword on primary constructors.\n\n**Example:**\n\n\n class Foo constructor(x: Int, y: Int)\n\nAfter the quick-fix is applied:\n\n\n class Foo(x: Int, y: Int)\n\nInspection ID: RedundantConstructorKeyword" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantConstructorKeyword", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantEmptyInitializerBlock", + "shortDescription": { + "text": "Redundant empty initializer block" + }, + "fullDescription": { + "text": "Reports redundant empty initializer blocks. Example: 'class Foo {\n init {\n // Empty init block\n }\n }' After the quick-fix is applied: 'class Foo {\n }' Inspection ID: RedundantEmptyInitializerBlock", + "markdown": "Reports redundant empty initializer blocks.\n\n**Example:**\n\n\n class Foo {\n init {\n // Empty init block\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n }\n\nInspection ID: RedundantEmptyInitializerBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantEmptyInitializerBlock", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceSubstringWithTake", + "shortDescription": { + "text": "'substring' call should be replaced with 'take' call" + }, + "fullDescription": { + "text": "Reports calls like 's.substring(0, x)' that can be replaced with 's.take(x)'. Using 'take()' makes your code simpler. The quick-fix replaces the 'substring' call with 'take()'. Example: 'fun foo(s: String) {\n s.substring(0, 10)\n }' After the quick-fix is applied: 'fun foo(s: String) {\n s.take(10)\n }' Inspection ID: ReplaceSubstringWithTake", + "markdown": "Reports calls like `s.substring(0, x)` that can be replaced with `s.take(x)`.\n\nUsing `take()` makes your code simpler.\n\nThe quick-fix replaces the `substring` call with `take()`.\n\n**Example:**\n\n\n fun foo(s: String) {\n s.substring(0, 10)\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(s: String) {\n s.take(10)\n }\n\nInspection ID: ReplaceSubstringWithTake" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceSubstringWithTake", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceRangeToWithRangeUntil", + "shortDescription": { + "text": "'rangeTo' or the '..' call should be replaced with '..<'" + }, + "fullDescription": { + "text": "Reports calls to 'rangeTo' or the '..' operator instead of calls to '..<'. Using corresponding functions makes your code simpler. The quick-fix replaces 'rangeTo' or the '..' call with '..<'. Example: 'fun foo(a: Int) {\n for (i in 0..a - 1) {\n\n }\n }' After the quick-fix is applied: 'fun foo(a: Int) {\n for (i in 0..): List {\n return if (list.isEmpty()) {\n println()\n foo()\n } else {\n list\n }\n }' After the quick-fix is applied: 'fun test(list: List): List {\n return list.ifEmpty {\n println()\n foo()\n }\n }' This inspection only reports if the Kotlin language version of the project or module is 1.3 or higher. Inspection ID: ReplaceIsEmptyWithIfEmpty", + "markdown": "Reports `isEmpty`, `isBlank`, `isNotEmpty`, or `isNotBlank` calls in an `if` statement to assign a default value.\n\nThe quick-fix replaces the `if` condition with `ifEmpty` or `ifBlank` calls.\n\n**Example:**\n\n\n fun test(list: List): List {\n return if (list.isEmpty()) {\n println()\n foo()\n } else {\n list\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(list: List): List {\n return list.ifEmpty {\n println()\n foo()\n }\n }\n\nThis inspection only reports if the Kotlin language version of the project or module is 1.3 or higher.\n\nInspection ID: ReplaceIsEmptyWithIfEmpty" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceIsEmptyWithIfEmpty", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DelegationToVarProperty", + "shortDescription": { + "text": "Delegating to 'var' property" + }, + "fullDescription": { + "text": "Reports interface delegation to a 'var' property. Only initial value of a property is used for delegation, any later assignments do not affect it. Example: 'class Example(var text: CharSequence): CharSequence by text' The quick-fix replaces a property with immutable one: 'class Example(val text: CharSequence): CharSequence by text' Alternative way, if you rely on mutability for some reason: 'class Example(text: CharSequence): CharSequence by text {\n var text = text\n }' Inspection ID: DelegationToVarProperty", + "markdown": "Reports interface delegation to a `var` property.\n\nOnly initial value of a property is used for delegation, any later assignments do not affect it.\n\n**Example:**\n\n\n class Example(var text: CharSequence): CharSequence by text\n\nThe quick-fix replaces a property with immutable one:\n\n\n class Example(val text: CharSequence): CharSequence by text\n\nAlternative way, if you rely on mutability for some reason:\n\n\n class Example(text: CharSequence): CharSequence by text {\n var text = text\n }\n\nInspection ID: DelegationToVarProperty" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DelegationToVarProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantConditionIf", + "shortDescription": { + "text": "Condition of 'if' expression is constant" + }, + "fullDescription": { + "text": "Reports 'if' expressions that have 'true' or 'false' constant literal condition and can be simplified. While occasionally intended, this construction is confusing and often the result of a typo or previous refactoring. Example: 'fun example() {\n if (true) {\n throw IllegalStateException(\"Unexpected state\")\n }\n }' The quick-fix removes the 'if' condition: 'fun example() {\n throw IllegalStateException(\"Unexpected state\")\n }' Inspection ID: ConstantConditionIf", + "markdown": "Reports `if` expressions that have `true` or `false` constant literal condition and can be simplified.\n\nWhile occasionally intended, this construction is confusing and often the result of a typo\nor previous refactoring.\n\n**Example:**\n\n\n fun example() {\n if (true) {\n throw IllegalStateException(\"Unexpected state\")\n }\n }\n\nThe quick-fix removes the `if` condition:\n\n\n fun example() {\n throw IllegalStateException(\"Unexpected state\")\n }\n\nInspection ID: ConstantConditionIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConstantConditionIf", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantLambdaArrow", + "shortDescription": { + "text": "Redundant lambda arrow" + }, + "fullDescription": { + "text": "Reports redundant lambda arrows in lambdas without parameters. Example: 'fun foo(f: () -> Unit) = f()\n\n fun bar() {\n foo { -> println(\"Hi!\") }\n }' After the quick-fix is applied: 'fun foo(f: () -> Unit) = f()\n\n fun bar() {\n foo { println(\"Hi!\") }\n }' Inspection ID: RedundantLambdaArrow", + "markdown": "Reports redundant lambda arrows in lambdas without parameters.\n\n**Example:**\n\n\n fun foo(f: () -> Unit) = f()\n\n fun bar() {\n foo { -> println(\"Hi!\") }\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(f: () -> Unit) = f()\n\n fun bar() {\n foo { println(\"Hi!\") }\n }\n\nInspection ID: RedundantLambdaArrow" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantLambdaArrow", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyBooleanWithConstants", + "shortDescription": { + "text": "Boolean expression can be simplified" + }, + "fullDescription": { + "text": "Reports boolean expression parts that can be reduced to constants. The quick-fix simplifies the condition. Example: 'fun use(arg: Boolean) {\n if (false == arg) {\n\n }\n }' After the quick-fix is applied: 'fun use(arg: Boolean) {\n if (!arg) {\n\n }\n }' Inspection ID: SimplifyBooleanWithConstants", + "markdown": "Reports boolean expression parts that can be reduced to constants.\n\nThe quick-fix simplifies the condition.\n\n**Example:**\n\n\n fun use(arg: Boolean) {\n if (false == arg) {\n\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun use(arg: Boolean) {\n if (!arg) {\n\n }\n }\n\nInspection ID: SimplifyBooleanWithConstants" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifyBooleanWithConstants", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantValueArgument", + "shortDescription": { + "text": "Redundant value argument" + }, + "fullDescription": { + "text": "Reports arguments that are equal to the default values of the corresponding parameters. Example: 'fun foo(x: Int, y: Int = 2) {}\n\nfun bar() {\n foo(1, 2)\n}' After the quick-fix is applied: 'fun bar() {\n foo(1)\n}' Inspection ID: RedundantValueArgument", + "markdown": "Reports arguments that are equal to the default values of the corresponding parameters.\n\n**Example:**\n\n\n fun foo(x: Int, y: Int = 2) {}\n\n fun bar() {\n foo(1, 2)\n }\n\nAfter the quick-fix is applied:\n\n\n fun bar() {\n foo(1)\n }\n\nInspection ID: RedundantValueArgument" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantValueArgument", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantModalityModifier", + "shortDescription": { + "text": "Redundant modality modifier" + }, + "fullDescription": { + "text": "Reports the modality modifiers that match the default modality of an element ('final' for most elements, 'open' for members with an 'override'). Example: 'final class Foo\n\n open class Bar : Comparable {\n open override fun compareTo(other: Bar): Int = 0\n }' After the quick-fix is applied: 'class Foo\n\n open class Bar : Comparable {\n override fun compareTo(other: Bar): Int = 0\n }' Inspection ID: RedundantModalityModifier", + "markdown": "Reports the modality modifiers that match the default modality of an element (`final` for most elements, `open` for members with an `override`).\n\n**Example:**\n\n\n final class Foo\n\n open class Bar : Comparable {\n open override fun compareTo(other: Bar): Int = 0\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo\n\n open class Bar : Comparable {\n override fun compareTo(other: Bar): Int = 0\n }\n\nInspection ID: RedundantModalityModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantModalityModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyAssertNotNull", + "shortDescription": { + "text": "'assert' call can be replaced with '!!' or '?:'" + }, + "fullDescription": { + "text": "Reports 'assert' calls that check a not null value of the declared variable. Using '!!' or '?:' makes your code simpler. The quick-fix replaces 'assert' with '!!' or '?:' operator in the variable initializer. Example: 'fun foo(p: Array) {\n val v = p[0]\n assert(v != null, { \"Should be not null\" })\n }' After the quick-fix is applied: 'fun foo(p: Array) {\n val v = p[0] ?: error(\"Should be not null\")\n }' Inspection ID: SimplifyAssertNotNull", + "markdown": "Reports `assert` calls that check a not null value of the declared variable.\n\nUsing `!!` or `?:` makes your code simpler.\n\nThe quick-fix replaces `assert` with `!!` or `?:` operator in the variable initializer.\n\n**Example:**\n\n\n fun foo(p: Array) {\n val v = p[0]\n assert(v != null, { \"Should be not null\" })\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(p: Array) {\n val v = p[0] ?: error(\"Should be not null\")\n }\n\nInspection ID: SimplifyAssertNotNull" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifyAssertNotNull", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertNaNEquality", + "shortDescription": { + "text": "Convert equality check with 'NaN' to 'isNaN' call" + }, + "fullDescription": { + "text": "Reports an equality check with 'Float.NaN' or 'Double.NaN' that should be replaced with an 'isNaN()' check. According to IEEE 754, equality check against NaN always returns 'false', even for 'NaN == NaN'. Therefore, such a check is likely to be a mistake. The quick-fix replaces comparison with 'isNaN()' check that uses a different comparison technique and handles 'NaN' values correctly. Example: 'fun check(value: Double): Boolean {\n return Double.NaN == value\n }' After the fix is applied: 'fun check(value: Double): Boolean {\n return value.isNaN()\n }' Inspection ID: ConvertNaNEquality", + "markdown": "Reports an equality check with `Float.NaN` or `Double.NaN` that should be replaced with an `isNaN()` check.\n\n\nAccording to IEEE 754, equality check against NaN always returns `false`, even for `NaN == NaN`.\nTherefore, such a check is likely to be a mistake.\n\nThe quick-fix replaces comparison with `isNaN()` check that uses a different comparison technique and handles `NaN` values correctly.\n\n**Example:**\n\n\n fun check(value: Double): Boolean {\n return Double.NaN == value\n }\n\nAfter the fix is applied:\n\n\n fun check(value: Double): Boolean {\n return value.isNaN()\n }\n\nInspection ID: ConvertNaNEquality" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ConvertNaNEquality", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedVariable", + "shortDescription": { + "text": "Unused variable" + }, + "fullDescription": { + "text": "This inspection reports variables that are not used. Inspection ID: UnusedVariable", + "markdown": "This inspection reports variables that are not used.\n\nInspection ID: UnusedVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ImplicitThis", + "shortDescription": { + "text": "Implicit 'this'" + }, + "fullDescription": { + "text": "Reports usages of implicit this. Example: 'class Foo {\n fun s() = \"\"\n\n fun test() {\n s()\n }\n }' The quick fix specifies this explicitly: 'class Foo {\n fun s() = \"\"\n\n fun test() {\n this.s()\n }\n }' Inspection ID: ImplicitThis", + "markdown": "Reports usages of implicit **this** .\n\n**Example:**\n\n\n class Foo {\n fun s() = \"\"\n\n fun test() {\n s()\n }\n }\n\nThe quick fix specifies **this** explicitly:\n\n\n class Foo {\n fun s() = \"\"\n\n fun test() {\n this.s()\n }\n }\n\nInspection ID: ImplicitThis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ImplicitThis", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FilterIsInstanceResultIsAlwaysEmpty", + "shortDescription": { + "text": "The result of 'filterIsInstance' call is always empty" + }, + "fullDescription": { + "text": "The inspection detects calls to Kotlin standard library functions 'filterIsInstance'/'filterIsInstanceTo', whose target type is not a subtype of the element type the filtering is called on. Example: 'val list = listOf(1, 2, 3)\n val filteredList = list.filterIsInstance() // Empty result' Inspection ID: FilterIsInstanceResultIsAlwaysEmpty", + "markdown": "The inspection detects calls to Kotlin standard library functions `filterIsInstance`/`filterIsInstanceTo`,\nwhose target type is not a subtype of the element type the filtering is called on.\n\nExample:\n\n\n val list = listOf(1, 2, 3)\n val filteredList = list.filterIsInstance() // Empty result\n\nInspection ID: FilterIsInstanceResultIsAlwaysEmpty" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "FilterIsInstanceResultIsAlwaysEmpty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveToStringInStringTemplate", + "shortDescription": { + "text": "Redundant call to 'toString()' in string template" + }, + "fullDescription": { + "text": "Reports calls to 'toString()' in string templates that can be safely removed. Example: 'fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4).toString()}\" // 'toString()' is redundant\n }' After the quick-fix is applied: 'fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4)}\"\n }' Inspection ID: RemoveToStringInStringTemplate", + "markdown": "Reports calls to `toString()` in string templates that can be safely removed.\n\n**Example:**\n\n fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4).toString()}\" // 'toString()' is redundant\n }\n\nAfter the quick-fix is applied:\n\n fun foo(a: Int, b: Int) = a + b\n\n fun test(): String {\n return \"Foo: ${foo(0, 4)}\"\n }\n\nInspection ID: RemoveToStringInStringTemplate" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveToStringInStringTemplate", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantAsSequence", + "shortDescription": { + "text": "Redundant 'asSequence' call" + }, + "fullDescription": { + "text": "Reports redundant 'asSequence()' call that can never have a positive performance effect. 'asSequence()' speeds up collection processing that includes multiple operations because it performs operations lazily and doesn't create intermediate collections. However, if a terminal operation (such as 'toList()') is used right after 'asSequence()', this doesn't give you any positive performance effect. Example: 'fun test(list: List) {\n list.asSequence().last()\n }' After the quick-fix is applied: 'fun test(list: List) {\n list.last()\n }' Inspection ID: RedundantAsSequence", + "markdown": "Reports redundant `asSequence()` call that can never have a positive performance effect.\n\n\n`asSequence()` speeds up collection processing that includes multiple operations because it performs operations lazily\nand doesn't create intermediate collections.\n\n\nHowever, if a terminal operation (such as `toList()`) is used right after `asSequence()`, this doesn't give\nyou any positive performance effect.\n\n**Example:**\n\n\n fun test(list: List) {\n list.asSequence().last()\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(list: List) {\n list.last()\n }\n\nInspection ID: RedundantAsSequence" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantAsSequence", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RunBlockingInSuspendFunction", + "shortDescription": { + "text": "'runBlocking' inside suspend function" + }, + "fullDescription": { + "text": "Reports 'runBlocking' calls inside 'suspend' functions. Using 'runBlocking' within a 'suspend' function blocks the calling thread and defeats the purpose of asynchronous programming. The quick-fix replaces the 'runBlocking' call with one of the following alternatives, depending on the context: A 'run' call. A 'withContext' call when a specific 'CoroutineContext' is used. Directly inlined code without the 'runBlocking' wrapper. Example: 'suspend fun something() {\n runBlocking {\n code() // The thread is blocked here\n }\n}' After the quick-fix is applied: 'suspend fun something() {\n code() // Runs asynchronously\n}' Inspection ID: RunBlockingInSuspendFunction New in 2025.1", + "markdown": "Reports `runBlocking` calls inside `suspend` functions.\n\nUsing `runBlocking` within a `suspend` function blocks the calling thread and defeats the purpose of asynchronous programming.\n\nThe quick-fix replaces the `runBlocking` call with one of the following alternatives, depending on the context:\n\n* A `run` call.\n* A `withContext` call when a specific `CoroutineContext` is used.\n* Directly inlined code without the `runBlocking` wrapper.\n\nExample:\n\n\n suspend fun something() {\n runBlocking {\n code() // The thread is blocked here\n }\n }\n\nAfter the quick-fix is applied:\n\n\n suspend fun something() {\n code() // Runs asynchronously\n }\n\nInspection ID: RunBlockingInSuspendFunction\n\nNew in 2025.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RunBlockingInSuspendFunction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DifferentStdlibGradleVersion", + "shortDescription": { + "text": "Kotlin library and Gradle plugin versions are different" + }, + "fullDescription": { + "text": "Reports different Kotlin stdlib and compiler versions. Example: 'dependencies {\n classpath \"org.jetbrains.kotlin:kotlin-stdlib:0.0.1\"\n }' To fix the problem change the kotlin stdlib version to match the kotlin compiler version. Inspection ID: DifferentStdlibGradleVersion", + "markdown": "Reports different Kotlin stdlib and compiler versions.\n\n**Example:**\n\n\n dependencies {\n classpath \"org.jetbrains.kotlin:kotlin-stdlib:0.0.1\"\n }\n\nTo fix the problem change the kotlin stdlib version to match the kotlin compiler version.\n\nInspection ID: DifferentStdlibGradleVersion" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DifferentStdlibGradleVersion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinUnusedImport", + "shortDescription": { + "text": "Unused import directive" + }, + "fullDescription": { + "text": "Reports redundant 'import' statements. Default and unused imports can be safely removed. Example: 'import kotlin.*\n import kotlin.collections.*\n import kotlin.comparisons.*\n import kotlin.io.*\n import kotlin.ranges.*\n import kotlin.sequences.*\n import kotlin.text.*\n\n // jvm specific\n import java.lang.*\n import kotlin.jvm.*\n\n // js specific\n import kotlin.js.*\n\n import java.io.* // this import is unused and could be removed\n import java.util.*\n\n fun foo(list: ArrayList) {\n list.add(\"\")\n }' Inspection ID: KotlinUnusedImport", + "markdown": "Reports redundant `import` statements.\n\nDefault and unused imports can be safely removed.\n\n**Example:**\n\n\n import kotlin.*\n import kotlin.collections.*\n import kotlin.comparisons.*\n import kotlin.io.*\n import kotlin.ranges.*\n import kotlin.sequences.*\n import kotlin.text.*\n\n // jvm specific\n import java.lang.*\n import kotlin.jvm.*\n\n // js specific\n import kotlin.js.*\n\n import java.io.* // this import is unused and could be removed\n import java.util.*\n\n fun foo(list: ArrayList) {\n list.add(\"\")\n }\n\nInspection ID: KotlinUnusedImport" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedImport", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanBePrimaryConstructorProperty", + "shortDescription": { + "text": "Property is explicitly assigned to constructor parameter" + }, + "fullDescription": { + "text": "Reports properties that are explicitly assigned to primary constructor parameters. Properties can be declared directly in the primary constructor, reducing the amount of code and increasing code readability. Example: 'class User(name: String) {\n val name = name\n }' The quick-fix joins the parameter and property declaration into a primary constructor parameter: 'class User(val name: String) {\n }' Inspection ID: CanBePrimaryConstructorProperty", + "markdown": "Reports properties that are explicitly assigned to primary constructor parameters.\n\nProperties can be declared directly in the primary constructor, reducing the amount of code and increasing code readability.\n\n**Example:**\n\n\n class User(name: String) {\n val name = name\n }\n\nThe quick-fix joins the parameter and property declaration into a primary constructor parameter:\n\n\n class User(val name: String) {\n }\n\nInspection ID: CanBePrimaryConstructorProperty" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CanBePrimaryConstructorProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanBeVal", + "shortDescription": { + "text": "Local 'var' is never modified and can be declared as 'val'" + }, + "fullDescription": { + "text": "Reports local variables declared with the 'var' keyword that are never modified. Kotlin encourages to declare practically immutable variables using the 'val' keyword, ensuring that their value will never change. Example: 'fun example() {\n var primeNumbers = listOf(1, 2, 3, 5, 7, 11, 13)\n var fibonacciNumbers = listOf(1, 1, 2, 3, 5, 8, 13)\n print(\"Same numbers: \" + primeNumbers.intersect(fibonacciNumbers))\n }' The quick-fix replaces the 'var' keyword with 'val': 'fun example() {\n val primeNumbers = listOf(1, 2, 3, 5, 7, 11, 13)\n val fibonacciNumbers = listOf(1, 1, 2, 3, 5, 8, 13)\n print(\"Same numbers: \" + primeNumbers.intersect(fibonacciNumbers))\n }' Inspection ID: CanBeVal", + "markdown": "Reports local variables declared with the `var` keyword that are never modified.\n\nKotlin encourages to declare practically immutable variables using the `val` keyword, ensuring that their value will never change.\n\n**Example:**\n\n\n fun example() {\n var primeNumbers = listOf(1, 2, 3, 5, 7, 11, 13)\n var fibonacciNumbers = listOf(1, 1, 2, 3, 5, 8, 13)\n print(\"Same numbers: \" + primeNumbers.intersect(fibonacciNumbers))\n }\n\nThe quick-fix replaces the `var` keyword with `val`:\n\n\n fun example() {\n val primeNumbers = listOf(1, 2, 3, 5, 7, 11, 13)\n val fibonacciNumbers = listOf(1, 1, 2, 3, 5, 8, 13)\n print(\"Same numbers: \" + primeNumbers.intersect(fibonacciNumbers))\n }\n\nInspection ID: CanBeVal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CanBeVal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaDefaultMethodsNotOverriddenByDelegation", + "shortDescription": { + "text": "Java default methods are not overridden by delegation" + }, + "fullDescription": { + "text": "Reports delegation when the delegate object is an instance of a class that overrides (in the case of 'final' and 'sealed' classes) or may override (in the case of 'open' and 'abstract' classes) Java default methods. By design, Kotlin delegation does not override Java default methods, which can lead to subtle bugs, especially in cases of deep inheritance hierarchies. Example: '// Base.java:\npublic interface Base {\n default void print() {\n System.out.println(\"Base\");\n }\n}' '// BaseImpl.kt:\nclass BaseImpl : Base {\n override fun print() {\n println(\"BaseImpl\")\n }\n}' '// Main.kt:\nfun main() {\n val inherited = BaseImpl()\n val delegated = object : Base by inherited {}\n inherited.print() // Outputs: BaseImpl\n delegated.print() // Outputs: Base\n}' Developers typically expect that all methods, including default methods overridden in the delegate, are forwarded. Instead, Java default methods are called, which can lead to unexpected results. One quick-fix overrides Java default methods by delegating their implementation to the delegate object: '// Main.kt:\nfun main() {\n val inherited = BaseImpl()\n val delegated = object : Base by inherited {\n override fun print() {\n inherited.print()\n }\n }\n inherited.print() // Outputs: BaseImpl\n delegated.print() // Outputs: BaseImpl\n}' Another quick-fix overrides Java default methods by explicitly delegating their implementation to the superclass: '// Main.kt:\nfun main() {\n val inherited = BaseImpl()\n val delegated = object : Base by inherited {\n override fun print() {\n super.print()\n }\n }\n inherited.print() // Outputs: BaseImpl\n delegated.print() // Outputs: Base\n}' Inspection ID: JavaDefaultMethodsNotOverriddenByDelegation New in 2025.1", + "markdown": "Reports delegation when the delegate object is an instance of a class that overrides (in the case of\n`final` and `sealed` classes) or may override (in the case of `open`\nand `abstract` classes) Java default methods.\n\n\nBy design, Kotlin delegation does not override Java default methods, which can lead to subtle bugs,\nespecially in cases of deep inheritance hierarchies.\n\n**Example:**\n\n\n // Base.java:\n public interface Base {\n default void print() {\n System.out.println(\"Base\");\n }\n }\n\n\n // BaseImpl.kt:\n class BaseImpl : Base {\n override fun print() {\n println(\"BaseImpl\")\n }\n }\n\n\n // Main.kt:\n fun main() {\n val inherited = BaseImpl()\n val delegated = object : Base by inherited {}\n inherited.print() // Outputs: BaseImpl\n delegated.print() // Outputs: Base\n }\n\n\nDevelopers typically expect that all methods, including default methods overridden in the delegate, are\nforwarded. Instead, Java default methods are called, which can lead to unexpected results.\n\n\nOne quick-fix overrides Java default methods by delegating their implementation to the delegate object:\n\n\n // Main.kt:\n fun main() {\n val inherited = BaseImpl()\n val delegated = object : Base by inherited {\n override fun print() {\n inherited.print()\n }\n }\n inherited.print() // Outputs: BaseImpl\n delegated.print() // Outputs: BaseImpl\n }\n\n\nAnother quick-fix overrides Java default methods by explicitly delegating their implementation to the\nsuperclass:\n\n\n // Main.kt:\n fun main() {\n val inherited = BaseImpl()\n val delegated = object : Base by inherited {\n override fun print() {\n super.print()\n }\n }\n inherited.print() // Outputs: BaseImpl\n delegated.print() // Outputs: Base\n }\n\nInspection ID: JavaDefaultMethodsNotOverriddenByDelegation\n\nNew in 2025.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "JavaDefaultMethodsNotOverriddenByDelegation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Java interop issues", + "index": 67, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaMapForEach", + "shortDescription": { + "text": "Java Map.forEach method call should be replaced with Kotlin's forEach" + }, + "fullDescription": { + "text": "Reports a Java Map.'forEach' method call that can be replaced with Kotlin's forEach. Example: 'fun test(map: HashMap) {\n map.forEach { key, value ->\n foo(key, value)\n }\n }\n\n fun foo(i: Int, s: String) {}' The quick-fix adds parentheses: 'fun test(map: HashMap) {\n map.forEach { (key, value) ->\n foo(key, value)\n }\n }\n\n fun foo(i: Int, s: String) {}' Inspection ID: JavaMapForEach", + "markdown": "Reports a Java Map.`forEach` method call that can be replaced with Kotlin's **forEach** .\n\n**Example:**\n\n\n fun test(map: HashMap) {\n map.forEach { key, value ->\n foo(key, value)\n }\n }\n\n fun foo(i: Int, s: String) {}\n\nThe quick-fix adds parentheses:\n\n\n fun test(map: HashMap) {\n map.forEach { (key, value) ->\n foo(key, value)\n }\n }\n\n fun foo(i: Int, s: String) {}\n\nInspection ID: JavaMapForEach" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JavaMapForEach", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantObjectTypeCheck", + "shortDescription": { + "text": "Non-idiomatic 'is' type check for an object" + }, + "fullDescription": { + "text": "Reports non-idiomatic 'is' type checks for an object. It's recommended to replace such checks with reference comparison. Example: 'object Foo\n\n fun foo(arg: Any) = when {\n arg is Foo -> ...\n arg !is Foo -> ...\n }' After the quick-fix is applied: 'object Foo\n\n fun foo(arg: Any) = when {\n arg === Foo -> ...\n arg !== Foo -> ...\n }' Inspection ID: RedundantObjectTypeCheck", + "markdown": "Reports non-idiomatic `is` type checks for an object.\n\nIt's recommended to replace such checks with reference comparison.\n\n**Example:**\n\n\n object Foo\n\n fun foo(arg: Any) = when {\n arg is Foo -> ...\n arg !is Foo -> ...\n }\n\nAfter the quick-fix is applied:\n\n\n object Foo\n\n fun foo(arg: Any) = when {\n arg === Foo -> ...\n arg !== Foo -> ...\n }\n\nInspection ID: RedundantObjectTypeCheck" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantObjectTypeCheck", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinAmbiguousActuals", + "shortDescription": { + "text": "Ambiguous actuals" + }, + "fullDescription": { + "text": "Reports 'expect' declarations that have ambiguous 'actual' declarations in implementing multi-platform modules. For example: '// common.kt\nexpect class Foo\n// middle.kt\nactual class Foo\n// bottom.kt\nactual class Foo' Inspection ID: KotlinAmbiguousActuals", + "markdown": "Reports `expect` declarations that have ambiguous `actual` declarations in implementing multi-platform modules.\n\n\nFor example:\n\n\n // common.kt\n expect class Foo\n // middle.kt\n actual class Foo\n // bottom.kt\n actual class Foo\n\nInspection ID: KotlinAmbiguousActuals" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "KotlinAmbiguousActuals", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Other problems", + "index": 75, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithIgnoreCaseEquals", + "shortDescription": { + "text": "Should be replaced with 'equals(..., ignoreCase = true)'" + }, + "fullDescription": { + "text": "Reports case-insensitive comparisons that can be replaced with 'equals(..., ignoreCase = true)'. By using 'equals()' you don't have to allocate extra strings with 'toLowerCase()' or 'toUpperCase()' to compare strings. The quick-fix replaces the case-insensitive comparison that uses 'toLowerCase()' or 'toUpperCase()' with 'equals(..., ignoreCase = true)'. Note: May change semantics for some locales. Example: 'fun main() {\n val a = \"KoTliN\"\n val b = \"KOTLIN\"\n println(a.toLowerCase() == b.toLowerCase())\n }' After the quick-fix is applied: 'fun main() {\n val a = \"KoTliN\"\n val b = \"KOTLIN\"\n println(a.equals(b, ignoreCase = true))\n }' Inspection ID: ReplaceWithIgnoreCaseEquals", + "markdown": "Reports case-insensitive comparisons that can be replaced with `equals(..., ignoreCase = true)`.\n\nBy using `equals()` you don't have to allocate extra strings with `toLowerCase()` or `toUpperCase()` to compare strings.\n\nThe quick-fix replaces the case-insensitive comparison that uses `toLowerCase()` or `toUpperCase()` with `equals(..., ignoreCase = true)`.\n\n**Note:** May change semantics for some locales.\n\n**Example:**\n\n\n fun main() {\n val a = \"KoTliN\"\n val b = \"KOTLIN\"\n println(a.toLowerCase() == b.toLowerCase())\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n val a = \"KoTliN\"\n val b = \"KOTLIN\"\n println(a.equals(b, ignoreCase = true))\n }\n\nInspection ID: ReplaceWithIgnoreCaseEquals" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithIgnoreCaseEquals", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DifferentMavenStdlibVersion", + "shortDescription": { + "text": "Library and maven plugin versions are different" + }, + "fullDescription": { + "text": "Reports different Kotlin stdlib and compiler versions. Using different versions of the Kotlin compiler and the standard library can lead to unpredictable runtime problems and should be avoided. Inspection ID: DifferentMavenStdlibVersion", + "markdown": "Reports different Kotlin stdlib and compiler versions.\n\nUsing different versions of the Kotlin compiler and the standard library can lead to unpredictable\nruntime problems and should be avoided.\n\nInspection ID: DifferentMavenStdlibVersion" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DifferentMavenStdlibVersion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceSubstringWithSubstringAfter", + "shortDescription": { + "text": "'substring' call should be replaced with 'substringAfter'" + }, + "fullDescription": { + "text": "Reports calls like 's.substring(s.indexOf(x))' that can be replaced with 's.substringAfter(x)'. Using 's.substringAfter(x)' makes your code simpler. The quick-fix replaces the 'substring' call with 'substringAfter'. Example: 'fun foo(s: String) {\n s.substring(s.indexOf('x'))\n }' After the quick-fix is applied: 'fun foo(s: String) {\n s.substringAfter('x')\n }' Inspection ID: ReplaceSubstringWithSubstringAfter", + "markdown": "Reports calls like `s.substring(s.indexOf(x))` that can be replaced with `s.substringAfter(x)`.\n\nUsing `s.substringAfter(x)` makes your code simpler.\n\nThe quick-fix replaces the `substring` call with `substringAfter`.\n\n**Example:**\n\n\n fun foo(s: String) {\n s.substring(s.indexOf('x'))\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(s: String) {\n s.substringAfter('x')\n }\n\nInspection ID: ReplaceSubstringWithSubstringAfter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceSubstringWithSubstringAfter", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantCompanionReference", + "shortDescription": { + "text": "Redundant 'Companion' reference" + }, + "fullDescription": { + "text": "Reports redundant 'Companion' reference. Example: 'class A {\n companion object {\n fun create() = A()\n }\n }\n fun test() {\n val s = A.Companion.create()\n }' After the quick-fix is applied: 'class A {\n companion object {\n fun create() = A()\n }\n }\n fun test() {\n val s = A.create()\n }' Inspection ID: RedundantCompanionReference", + "markdown": "Reports redundant `Companion` reference.\n\n**Example:**\n\n\n class A {\n companion object {\n fun create() = A()\n }\n }\n fun test() {\n val s = A.Companion.create()\n }\n\nAfter the quick-fix is applied:\n\n\n class A {\n companion object {\n fun create() = A()\n }\n }\n fun test() {\n val s = A.create()\n }\n\nInspection ID: RedundantCompanionReference" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantCompanionReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceAssociateFunction", + "shortDescription": { + "text": "'associate' can be replaced with 'associateBy' or 'associateWith'" + }, + "fullDescription": { + "text": "Reports calls to 'associate()' and 'associateTo()' that can be replaced with 'associateBy()' or 'associateWith()'. Both functions accept a transformer function applied to elements of a given sequence or collection (as a receiver). The pairs are then used to build the resulting 'Map'. Given the transformer refers to 'it', the 'associate[To]()' call can be replaced with more performant 'associateBy()' or 'associateWith()'. Examples: 'fun getKey(i: Int) = 1L\n fun getValue(i: Int) = 1L\n\n fun test() {\n arrayOf(1).associate { getKey(it) to it } // replaceable 'associate()'\n listOf(1).associate { it to getValue(it) } // replaceable 'associate()'\n }' After the quick-fix is applied: 'fun getKey(i: Int) = 1L\n fun getValue(i: Int) = 1L\n\n fun test() {\n arrayOf(1).associateBy { getKey(it) }\n listOf(1).associateWith { getValue(it) }\n }' Inspection ID: ReplaceAssociateFunction", + "markdown": "Reports calls to `associate()` and `associateTo()` that can be replaced with `associateBy()` or `associateWith()`.\n\n\nBoth functions accept a transformer function applied to elements of a given sequence or collection (as a receiver).\nThe pairs are then used to build the resulting `Map`.\n\n\nGiven the transformer refers to `it`, the `associate[To]()` call can be replaced with more performant `associateBy()`\nor `associateWith()`.\n\n**Examples:**\n\n fun getKey(i: Int) = 1L\n fun getValue(i: Int) = 1L\n\n fun test() {\n arrayOf(1).associate { getKey(it) to it } // replaceable 'associate()'\n listOf(1).associate { it to getValue(it) } // replaceable 'associate()'\n }\n\nAfter the quick-fix is applied:\n\n fun getKey(i: Int) = 1L\n fun getValue(i: Int) = 1L\n\n fun test() {\n arrayOf(1).associateBy { getKey(it) }\n listOf(1).associateWith { getValue(it) }\n }\n\nInspection ID: ReplaceAssociateFunction" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceAssociateFunction", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KDocUnresolvedReference", + "shortDescription": { + "text": "Unresolved reference in KDoc" + }, + "fullDescription": { + "text": "Reports unresolved references in KDoc comments. Example: '/**\n * [unresolvedLink]\n */\n fun foo() {}' To fix the problem make the link valid. Inspection ID: KDocUnresolvedReference", + "markdown": "Reports unresolved references in KDoc comments.\n\n**Example:**\n\n\n /**\n * [unresolvedLink]\n */\n fun foo() {}\n\nTo fix the problem make the link valid.\n\nInspection ID: KDocUnresolvedReference" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "KDocUnresolvedReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LiftReturnOrAssignment", + "shortDescription": { + "text": "Return or assignment can be lifted out" + }, + "fullDescription": { + "text": "Reports 'if', 'when', and 'try' statements that can be converted to expressions by lifting the 'return' statement or an assignment out. Example: 'fun foo(arg: Int): String {\n when (arg) {\n 0 -> return \"Zero\"\n 1 -> return \"One\"\n else -> return \"Multiple\"\n }\n }' After the quick-fix is applied: 'fun foo(arg: Int): String {\n return when (arg) {\n 0 -> \"Zero\"\n 1 -> \"One\"\n else -> \"Multiple\"\n }\n }' If you would like this inspection to highlight more complex code with multi-statement branches, uncheck the option \"Report only if each branch is a single statement\". Inspection ID: LiftReturnOrAssignment", + "markdown": "Reports `if`, `when`, and `try` statements that can be converted to expressions by lifting the `return` statement or an assignment out.\n\n**Example:**\n\n\n fun foo(arg: Int): String {\n when (arg) {\n 0 -> return \"Zero\"\n 1 -> return \"One\"\n else -> return \"Multiple\"\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(arg: Int): String {\n return when (arg) {\n 0 -> \"Zero\"\n 1 -> \"One\"\n else -> \"Multiple\"\n }\n }\n\nIf you would like this inspection to highlight more complex code with multi-statement branches, uncheck the option \"Report only if each branch is a single statement\".\n\nInspection ID: LiftReturnOrAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LiftReturnOrAssignment", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedLambdaShadowedImplicitParameter", + "shortDescription": { + "text": "Nested lambda has shadowed implicit parameter" + }, + "fullDescription": { + "text": "Reports nested lambdas with shadowed implicit parameters. Example: 'fun foo(listOfLists: List>) {\n listOfLists.forEach {\n it.forEach {\n println(it)\n }\n }\n}' After the quick-fix is applied: 'fun foo(listOfLists: List>) {\n listOfLists.forEach {\n it.forEach { it1 ->\n println(it1)\n }\n }\n}' Inspection ID: NestedLambdaShadowedImplicitParameter", + "markdown": "Reports nested lambdas with shadowed implicit parameters.\n\n**Example:**\n\n\n fun foo(listOfLists: List>) {\n listOfLists.forEach {\n it.forEach {\n println(it)\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(listOfLists: List>) {\n listOfLists.forEach {\n it.forEach { it1 ->\n println(it1)\n }\n }\n }\n\nInspection ID: NestedLambdaShadowedImplicitParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "NestedLambdaShadowedImplicitParameter", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyWhenWithBooleanConstantCondition", + "shortDescription": { + "text": "Simplifiable 'when'" + }, + "fullDescription": { + "text": "Reports 'when' expressions with the constant 'true' or 'false' branches. Simplify \"when\" quick-fix can be used to amend the code automatically. Examples: 'fun redundant() {\n when { // <== redundant, quick-fix simplifies the when expression to \"println(\"true\")\"\n true -> println(\"true\")\n else -> println(\"false\")\n }\n }' Inspection ID: SimplifyWhenWithBooleanConstantCondition", + "markdown": "Reports `when` expressions with the constant `true` or `false` branches.\n\n**Simplify \"when\"** quick-fix can be used to amend the code automatically.\n\nExamples:\n\n\n fun redundant() {\n when { // <== redundant, quick-fix simplifies the when expression to \"println(\"true\")\"\n true -> println(\"true\")\n else -> println(\"false\")\n }\n }\n\nInspection ID: SimplifyWhenWithBooleanConstantCondition" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifyWhenWithBooleanConstantCondition", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantSamConstructor", + "shortDescription": { + "text": "Redundant SAM constructor" + }, + "fullDescription": { + "text": "Reports SAM (Single Abstract Method) constructor usages which can be replaced with lambdas. Example: 'fun main() {\n foo(Runnable { println(\"Hi!\") })\n }\n\n fun foo(other: Runnable) {}' After the quick-fix is applied: 'fun main() {\n foo( { println(\"Hi!\") })\n }\n\n fun foo(other: Runnable) {}' Inspection ID: RedundantSamConstructor", + "markdown": "Reports SAM (Single Abstract Method) constructor usages which can be replaced with lambdas.\n\n**Example:**\n\n\n fun main() {\n foo(Runnable { println(\"Hi!\") })\n }\n\n fun foo(other: Runnable) {}\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n foo( { println(\"Hi!\") })\n }\n\n fun foo(other: Runnable) {}\n\nInspection ID: RedundantSamConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantSamConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinConstantConditions", + "shortDescription": { + "text": "Constant conditions" + }, + "fullDescription": { + "text": "Reports non-trivial conditions and values that are statically known to be always true, false, null or zero. While sometimes intended, often this is a sign of logical error in the program. Additionally, reports never reachable 'when' branches and some expressions that are statically known to fail always. Examples: 'fun process(x: Int?) {\n val isNull = x == null\n if (!isNull) {\n if (x != null) {} // condition is always true\n require(x!! < 0 && x > 10) // condition is always false\n } else {\n println(x!!) // !! operator will always fail\n }\n}\nfun process(v: Any) {\n when(v) {\n is CharSequence -> println(v as Int) // cast will always fail\n is String -> println(v) // branch is unreachable\n }\n}' Uncheck the \"Warn when constant is stored in variable\" option to avoid reporting of variables having constant values not in conditions. Inspection ID: KotlinConstantConditions New in 2021.3", + "markdown": "Reports non-trivial conditions and values that are statically known to be always true, false, null or zero. While sometimes intended, often this is a sign of logical error in the program. Additionally, reports never reachable `when` branches and some expressions that are statically known to fail always.\n\nExamples:\n\n\n fun process(x: Int?) {\n val isNull = x == null\n if (!isNull) {\n if (x != null) {} // condition is always true\n require(x!! < 0 && x > 10) // condition is always false\n } else {\n println(x!!) // !! operator will always fail\n }\n }\n fun process(v: Any) {\n when(v) {\n is CharSequence -> println(v as Int) // cast will always fail\n is String -> println(v) // branch is unreachable\n }\n }\n\n\nUncheck the \"Warn when constant is stored in variable\" option to avoid reporting of variables having constant values not in conditions.\n\nInspection ID: KotlinConstantConditions\n\nNew in 2021.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "KotlinConstantConditions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InconsistentCommentForJavaParameter", + "shortDescription": { + "text": "Inconsistent comment for Java parameter" + }, + "fullDescription": { + "text": "Reports inconsistent parameter names for Java method calls specified in a comment block. Examples: '// Java\n public class JavaService {\n public void invoke(String command) {}\n }' '// Kotlin\n fun main() {\n JavaService().invoke(/* name = */ \"fix\")\n }' The quick fix corrects the parameter name in the comment block: 'fun main() {\n JavaService().invoke(/* command = */ \"fix\")\n }' Inspection ID: InconsistentCommentForJavaParameter", + "markdown": "Reports inconsistent parameter names for **Java** method calls specified in a comment block.\n\n**Examples:**\n\n\n // Java\n public class JavaService {\n public void invoke(String command) {}\n }\n\n\n // Kotlin\n fun main() {\n JavaService().invoke(/* name = */ \"fix\")\n }\n\nThe quick fix corrects the parameter name in the comment block:\n\n\n fun main() {\n JavaService().invoke(/* command = */ \"fix\")\n }\n\nInspection ID: InconsistentCommentForJavaParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InconsistentCommentForJavaParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedFlow", + "shortDescription": { + "text": "Unused flow" + }, + "fullDescription": { + "text": "Reports Kotlinx Coroutines Flows that are created but never consumed or passed to other functions. The code defining a Flow does not run unless the Flow is collected by using a terminal operator. Example: 'fun foo() {\n flowOf(1).onEach { println(it) }\n}' See some examples of terminal operators. Inspection ID: UnusedFlow", + "markdown": "Reports Kotlinx Coroutines Flows that are created but never consumed or passed to other functions.\n\nThe code defining a Flow does not run unless the Flow is collected by using a terminal operator.\n\n**Example:**\n\n\n fun foo() {\n flowOf(1).onEach { println(it) }\n }\n\nSee [some examples](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/) of terminal operators.\n\nInspection ID: UnusedFlow" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedFlow", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForEachParameterNotUsed", + "shortDescription": { + "text": "Iterated elements are not used in forEach" + }, + "fullDescription": { + "text": "Reports 'forEach' loops that do not use iterable values. Example: 'listOf(1, 2, 3).forEach { }' The quick fix introduces anonymous parameter in the 'forEach' section: 'listOf(1, 2, 3).forEach { _ -> }' Inspection ID: ForEachParameterNotUsed", + "markdown": "Reports `forEach` loops that do not use iterable values.\n\n**Example:**\n\n\n listOf(1, 2, 3).forEach { }\n\nThe quick fix introduces anonymous parameter in the `forEach` section:\n\n\n listOf(1, 2, 3).forEach { _ -> }\n\nInspection ID: ForEachParameterNotUsed" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "ForEachParameterNotUsed", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveRedundantCallsOfConversionMethods", + "shortDescription": { + "text": "Redundant call of the conversion method" + }, + "fullDescription": { + "text": "Reports redundant calls to conversion methods (for example, 'toString()' on a 'String' or 'toDouble()' on a 'Double'). Use the 'Remove redundant calls of the conversion method' quick-fix to clean up the code. Inspection ID: RemoveRedundantCallsOfConversionMethods", + "markdown": "Reports redundant calls to conversion methods (for example, `toString()` on a `String` or `toDouble()` on a `Double`).\n\nUse the 'Remove redundant calls of the conversion method' quick-fix to clean up the code.\n\nInspection ID: RemoveRedundantCallsOfConversionMethods" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RemoveRedundantCallsOfConversionMethods", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AddExplicitTargetToParameterAnnotation", + "shortDescription": { + "text": "Redundant interpolation prefix" + }, + "fullDescription": { + "text": "Reports value parameter annotation usages without an explicit target for which the default target might be unexpected and undesirable. The value parameter annotations without an explicit target are applied only to the parameter itself until Kotlin 2.1.20. For annotations applicable to both parameters and fields or properties, this behavior might be unintended when the annotation is used on a 'val' or 'var' constructor parameter. Example: 'class Example(\n @Param val foo: String,\n @ParamField val bar: String, // the field is not annotated, only the parameter is\n @ParamProperty val baz: String, // the property is not annotated, only the parameter is\n @ParamProperty boo: String,\n)\n\n@Target(AnnotationTarget.VALUE_PARAMETER)\nannotation class Param\n@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD)\nannotation class ParamField\n@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY)\nannotation class ParamProperty' After the quick-fix is applied: 'class Example(\n @Param val foo: String,\n @field:ParamField val bar: String,\n @property:ParamProperty val baz: String,\n @ParamProperty boo: String,\n)\n\n@Target(AnnotationTarget.VALUE_PARAMETER)\nannotation class Param\n@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD)\nannotation class ParamField\n@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY)\nannotation class ParamProperty' Inspection ID: AddExplicitTargetToParameterAnnotation", + "markdown": "Reports value parameter annotation usages without an explicit target for which the default target might be unexpected and undesirable.\n\n\nThe value parameter annotations without an explicit target are applied only to the parameter itself until Kotlin 2.1.20.\nFor annotations applicable to both parameters and fields or properties, this behavior might\nbe unintended when the annotation is used on a `val` or `var` constructor parameter.\n\n\nExample:\n\n\n class Example(\n @Param val foo: String,\n @ParamField val bar: String, // the field is not annotated, only the parameter is\n @ParamProperty val baz: String, // the property is not annotated, only the parameter is\n @ParamProperty boo: String,\n )\n\n @Target(AnnotationTarget.VALUE_PARAMETER)\n annotation class Param\n @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD)\n annotation class ParamField\n @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY)\n annotation class ParamProperty\n\nAfter the quick-fix is applied:\n\n\n class Example(\n @Param val foo: String,\n @field:ParamField val bar: String,\n @property:ParamProperty val baz: String,\n @ParamProperty boo: String,\n )\n\n @Target(AnnotationTarget.VALUE_PARAMETER)\n annotation class Param\n @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD)\n annotation class ParamField\n @Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY)\n annotation class ParamProperty\n\nInspection ID: AddExplicitTargetToParameterAnnotation" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "AddExplicitTargetToParameterAnnotation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousCascadingIf", + "shortDescription": { + "text": "Suspicious cascading 'if' expression" + }, + "fullDescription": { + "text": "Reports cascading 'if' expressions where the last 'else' branch is part of a dot-qualified or binary expression. This can lead to unexpected behavior because only the innermost 'if-else' expression becomes the receiver or left operand of the outer expression, which may not align with the intended logic. Example: 'fun printNumberSign(num: Int) {\n if (num > 0) {\n \"positive\"\n } else if (num < 0) {\n \"negative\"\n } else {\n \"zero\"\n }.let { print(it) }\n}\n\nfun main() {\n printNumberSign(1) // Nothing is printed because the receiver of 'let' is only the inner 'if-else' expression\n}' After applying the first quick-fix (converting to 'when'): 'fun printNumberSign(num: Int) {\n when {\n num > 0 -> {\n \"positive\"\n }\n\n num < 0 -> {\n \"negative\"\n }\n\n else -> {\n \"zero\"\n }\n }.let { print(it) }\n}\n\nfun main() {\n printNumberSign(1) // Prints \"positive\"\n}' Alternatively, the second quick-fix adds clarifying braces to preserve the original semantics while making the nested 'else' branch explicit: 'fun printNumberSign(num: Int) {\n if (num > 0) {\n \"positive\"\n } else {\n if (num < 0) {\n \"negative\"\n } else {\n \"zero\"\n }.let { print(it) }\n }\n}\n\nfun main() {\n printNumberSign(1) // Nothing is printed, but the code is clearer\n}' Inspection ID: SuspiciousCascadingIf", + "markdown": "Reports cascading `if` expressions where the last `else` branch is part of a dot-qualified or binary expression.\n\nThis can lead to unexpected behavior because only the innermost `if-else` expression becomes the receiver or left operand of\nthe outer expression, which may not align with the intended logic.\n\n**Example:**\n\n\n fun printNumberSign(num: Int) {\n if (num > 0) {\n \"positive\"\n } else if (num < 0) {\n \"negative\"\n } else {\n \"zero\"\n }.let { print(it) }\n }\n\n fun main() {\n printNumberSign(1) // Nothing is printed because the receiver of 'let' is only the inner 'if-else' expression\n }\n\nAfter applying the first quick-fix (converting to `when`):\n\n\n fun printNumberSign(num: Int) {\n when {\n num > 0 -> {\n \"positive\"\n }\n\n num < 0 -> {\n \"negative\"\n }\n\n else -> {\n \"zero\"\n }\n }.let { print(it) }\n }\n\n fun main() {\n printNumberSign(1) // Prints \"positive\"\n }\n\nAlternatively, the second quick-fix adds clarifying braces to preserve the original semantics while making the nested `else`\nbranch explicit:\n\n\n fun printNumberSign(num: Int) {\n if (num > 0) {\n \"positive\"\n } else {\n if (num < 0) {\n \"negative\"\n } else {\n \"zero\"\n }.let { print(it) }\n }\n }\n\n fun main() {\n printNumberSign(1) // Nothing is printed, but the code is clearer\n }\n\nInspection ID: SuspiciousCascadingIf" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousCascadingIf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyNegatedBinaryExpression", + "shortDescription": { + "text": "Negated boolean expression can be simplified" + }, + "fullDescription": { + "text": "Reports negated boolean expressions that can be simplified. The quick-fix simplifies the boolean expression. Example: 'fun test(n: Int) {\n !(0 == 1)\n }' After the quick-fix is applied: 'fun test(n: Int) {\n 0 != 1\n }' Please note that this action may change code semantics if IEEE-754 NaN values are involved: 'fun main() {\n println(!(Double.NaN >= 0)) // true\n }' After the quick-fix is applied: 'fun main() {\n println(Double.NaN < 0) // false\n }' Inspection ID: SimplifyNegatedBinaryExpression", + "markdown": "Reports negated boolean expressions that can be simplified.\n\nThe quick-fix simplifies the boolean expression.\n\n**Example:**\n\n\n fun test(n: Int) {\n !(0 == 1)\n }\n\nAfter the quick-fix is applied:\n\n\n fun test(n: Int) {\n 0 != 1\n }\n\nPlease note that this action may change code semantics if IEEE-754 NaN values are involved:\n\n\n fun main() {\n println(!(Double.NaN >= 0)) // true\n }\n\nAfter the quick-fix is applied:\n\n\n fun main() {\n println(Double.NaN < 0) // false\n }\n\nInspection ID: SimplifyNegatedBinaryExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifyNegatedBinaryExpression", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MemberVisibilityCanBePrivate", + "shortDescription": { + "text": "Class member can have 'private' visibility" + }, + "fullDescription": { + "text": "Reports declarations that can be made 'private' to follow the encapsulation principle. Example: 'class Service(val url: String) {\n fun connect(): URLConnection = URL(url).openConnection()\n}' After the quick-fix is applied (considering there are no usages of 'url' outside of 'Service' class): 'class Service(private val url: String) {\n fun connect(): URLConnection = URL(url).openConnection()\n}' Inspection ID: MemberVisibilityCanBePrivate", + "markdown": "Reports declarations that can be made `private` to follow the encapsulation principle.\n\n**Example:**\n\n\n class Service(val url: String) {\n fun connect(): URLConnection = URL(url).openConnection()\n }\n\nAfter the quick-fix is applied (considering there are no usages of `url` outside of `Service` class):\n\n\n class Service(private val url: String) {\n fun connect(): URLConnection = URL(url).openConnection()\n }\n\nInspection ID: MemberVisibilityCanBePrivate" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MemberVisibilityCanBePrivate", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinNoActualForExpect", + "shortDescription": { + "text": "No actual for expect declaration" + }, + "fullDescription": { + "text": "Reports 'expect' declarations that do not have a corresponding 'actual' declaration in an implementing multi-platform module. Inspection ID: KotlinNoActualForExpect", + "markdown": "Reports `expect` declarations that do not have a corresponding `actual` declaration in an implementing multi-platform module.\n\nInspection ID: KotlinNoActualForExpect" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "KotlinNoActualForExpect", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Other problems", + "index": 75, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantSuspendModifier", + "shortDescription": { + "text": "Redundant 'suspend' modifier" + }, + "fullDescription": { + "text": "Reports 'suspend' modifier as redundant if no other suspending functions are called inside. Inspection ID: RedundantSuspendModifier", + "markdown": "Reports `suspend` modifier as redundant if no other suspending functions are called inside.\n\nInspection ID: RedundantSuspendModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantSuspendModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FilterIsInstanceCallWithClassLiteralArgument", + "shortDescription": { + "text": "'filterIsInstance' call with a class literal argument" + }, + "fullDescription": { + "text": "Reports calls of the Kotlin standard library function 'filterIsInstance' with a class literal argument. It is more idiomatic to use a version of this function with a reified type parameter, to avoid the '::class.java' syntax. Note: inspection is not reported for generic class literals because the 'Class<*, *>' syntax in the type argument list may be undesirable. Example: 'fun foo(list: List<*>) {\n list.filterIsInstance(Int::class.java)\n }' After the quick-fix is applied: 'fun foo(list: List<*>) {\n list.filterIsInstance()\n }' Inspection ID: FilterIsInstanceCallWithClassLiteralArgument", + "markdown": "Reports calls of the Kotlin standard library function `filterIsInstance` with a class literal argument. It is more idiomatic to use a version of this function with a reified type parameter, to avoid the `::class.java` syntax.\n\nNote: inspection is not reported for generic class literals because the `Class<*, *>` syntax in the type argument list may be undesirable.\n\nExample:\n\n\n fun foo(list: List<*>) {\n list.filterIsInstance(Int::class.java)\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(list: List<*>) {\n list.filterIsInstance()\n }\n\nInspection ID: FilterIsInstanceCallWithClassLiteralArgument" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "FilterIsInstanceCallWithClassLiteralArgument", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveRedundantBackticks", + "shortDescription": { + "text": "Redundant backticks" + }, + "fullDescription": { + "text": "Reports redundant backticks in references. Some of the Kotlin keywords are valid identifiers in Java, for example: 'in', 'object', 'is'. If a Java library uses a Kotlin keyword for a method, you can still call the method escaping it with the backtick character ('`'), for example, 'foo.`is`(bar)'. Sometimes this escaping is redundant and can be safely omitted. The inspection discovers and reports such cases and is paired with the 'Remove redundant backticks' quick-fix, which allows you to amend the highlighted code. Examples: 'fun `is`(x: String) {}\n fun foo() {\n `is`(\"bar\") // 'is' is a keyword, backticks are required\n }\n\n fun `test that smth works as designed`() {} // OK, complex identifier for readability improvement\n\n val `a` = 1 // no need for backticks' Inspection ID: RemoveRedundantBackticks", + "markdown": "Reports redundant backticks in references.\n\n\nSome of the Kotlin keywords are valid identifiers in Java, for example: `in`, `object`, `is`.\nIf a Java library uses a Kotlin keyword for a method, you can still call the method escaping it\nwith the backtick character (`````), for example, ``foo.`is`(bar)``.\nSometimes this escaping is redundant and can be safely omitted. The inspection discovers and reports such cases and is\npaired with the 'Remove redundant backticks' quick-fix, which allows you to amend the highlighted code.\n\n**Examples:**\n\n\n fun `is`(x: String) {}\n fun foo() {\n `is`(\"bar\") // 'is' is a keyword, backticks are required\n }\n\n fun `test that smth works as designed`() {} // OK, complex identifier for readability improvement\n\n val `a` = 1 // no need for backticks\n\nInspection ID: RemoveRedundantBackticks" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RemoveRedundantBackticks", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceReadLineWithReadln", + "shortDescription": { + "text": "'readLine' can be replaced with 'readln' or 'readlnOrNull'" + }, + "fullDescription": { + "text": "Reports calls to 'readLine()' that can be replaced with 'readln()' or 'readlnOrNull()'. Using corresponding functions makes your code simpler. The quick-fix replaces 'readLine()!!' with 'readln()' and 'readLine()' with 'readlnOrNull()'. Examples: 'val x = readLine()!!\n val y = readLine()?.length' After the quick-fix is applied: 'val x = readln()\n val y = readlnOrNull()?.length' Inspection ID: ReplaceReadLineWithReadln", + "markdown": "Reports calls to `readLine()` that can be replaced with `readln()` or `readlnOrNull()`.\n\n\nUsing corresponding functions makes your code simpler.\n\n\nThe quick-fix replaces `readLine()!!` with `readln()` and `readLine()` with `readlnOrNull()`.\n\n**Examples:**\n\n\n val x = readLine()!!\n val y = readLine()?.length\n\nAfter the quick-fix is applied:\n\n\n val x = readln()\n val y = readlnOrNull()?.length\n\nInspection ID: ReplaceReadLineWithReadln" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceReadLineWithReadln", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SelfAssignment", + "shortDescription": { + "text": "Redundant assignment" + }, + "fullDescription": { + "text": "Reports assignments of a variable to itself. The quick-fix removes the redundant assignment. Example: 'fun test() {\n var bar = 1\n bar = bar\n }' After the quick-fix is applied: 'fun test() {\n var bar = 1\n }' Inspection ID: SelfAssignment", + "markdown": "Reports assignments of a variable to itself.\n\nThe quick-fix removes the redundant assignment.\n\n**Example:**\n\n\n fun test() {\n var bar = 1\n bar = bar\n }\n\nAfter the quick-fix is applied:\n\n\n fun test() {\n var bar = 1\n }\n\nInspection ID: SelfAssignment" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SelfAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicApiImplicitType", + "shortDescription": { + "text": "Public API declaration with implicit return type" + }, + "fullDescription": { + "text": "Reports 'public' and 'protected' functions and properties that have an implicit return type. For API stability reasons, it's recommended to specify such types explicitly. Example: 'fun publicFunctionWhichAbusesTypeInference() =\n otherFunctionWithNotObviousReturnType() ?: yetAnotherFunctionWithNotObviousReturnType()' After the quick-fix is applied: 'fun publicFunctionWhichAbusesTypeInference(): Api =\n otherFunctionWithNotObviousReturnType() ?: yetAnotherFunctionWithNotObviousReturnType()' Inspection ID: PublicApiImplicitType", + "markdown": "Reports `public` and `protected` functions and properties that have an implicit return type.\nFor API stability reasons, it's recommended to specify such types explicitly.\n\n**Example:**\n\n\n fun publicFunctionWhichAbusesTypeInference() =\n otherFunctionWithNotObviousReturnType() ?: yetAnotherFunctionWithNotObviousReturnType()\n\nAfter the quick-fix is applied:\n\n\n fun publicFunctionWhichAbusesTypeInference(): Api =\n otherFunctionWithNotObviousReturnType() ?: yetAnotherFunctionWithNotObviousReturnType()\n\nInspection ID: PublicApiImplicitType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "PublicApiImplicitType", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Other problems", + "index": 75, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ControlFlowWithEmptyBody", + "shortDescription": { + "text": "Control flow with empty body" + }, + "fullDescription": { + "text": "Reports 'if', 'while', 'do' or 'for' statements with empty bodies. While occasionally intended, this construction is confusing and often the result of a typo. The quick-fix removes a statement. Example: 'if (a > b) {}' Inspection ID: ControlFlowWithEmptyBody", + "markdown": "Reports `if`, `while`, `do` or `for` statements with empty bodies.\n\nWhile occasionally intended, this construction is confusing and often the result of a typo.\n\nThe quick-fix removes a statement.\n\n**Example:**\n\n\n if (a > b) {}\n\nInspection ID: ControlFlowWithEmptyBody" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ControlFlowWithEmptyBody", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExplicitThis", + "shortDescription": { + "text": "Redundant explicit 'this'" + }, + "fullDescription": { + "text": "Reports an explicit 'this' when it can be omitted. Example: 'class C {\n private val i = 1\n fun f() = this.i\n }' The quick-fix removes the redundant 'this': 'class C {\n private val i = 1\n fun f() = i\n }' Inspection ID: ExplicitThis", + "markdown": "Reports an explicit `this` when it can be omitted.\n\n**Example:**\n\n\n class C {\n private val i = 1\n fun f() = this.i\n }\n\nThe quick-fix removes the redundant `this`:\n\n\n class C {\n private val i = 1\n fun f() = i\n }\n\nInspection ID: ExplicitThis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ExplicitThis", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignedValueIsNeverRead", + "shortDescription": { + "text": "Assigned value is never read" + }, + "fullDescription": { + "text": "Reports assignments where a value is assigned but never used later in the code. Example: 'fun foo(): Int = 42\n\n fun example() {\n var local = 0\n print(local)\n local = 42 // Assigned value is never read\n }' After the quick fix, the assignment is deleted: 'fun foo(): Int = 42\n\n fun example() {\n var local = 0\n print(local)\n }' If the right-hand side (RHS) expression may have side effects, the quick fix will also suggest keeping the RHS expression to preserve those side effects: 'fun foo(): Int = 42\n\n fun example() {\n var local = 0\n print(local)\n foo() // The function call is kept for its side effects\n }' Inspection ID: AssignedValueIsNeverRead", + "markdown": "Reports assignments where a value is assigned but never used later in the code.\n\n**Example:**\n\n\n fun foo(): Int = 42\n\n fun example() {\n var local = 0\n print(local)\n local = 42 // Assigned value is never read\n }\n\n* After the quick fix, the assignment is deleted:\n\n\n fun foo(): Int = 42\n\n fun example() {\n var local = 0\n print(local)\n }\n\n* If the right-hand side (RHS) expression may have side effects, the quick fix will also suggest keeping the RHS expression to preserve those side effects:\n\n\n fun foo(): Int = 42\n\n fun example() {\n var local = 0\n print(local)\n foo() // The function call is kept for its side effects\n }\n\nInspection ID: AssignedValueIsNeverRead" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AssignedValueIsNeverRead", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveEmptyClassBody", + "shortDescription": { + "text": "Replace empty class body" + }, + "fullDescription": { + "text": "Reports declarations of classes and objects with an empty body. Use the 'Remove redundant empty class body' quick-fix to clean up the code. Examples: 'class EmptyA() {} // <== empty body\n\n class EmptyB {\n companion object {} // <== empty body\n }\n\n fun emptyC() {\n object {} // <== anonymous object, it's ok (not reported)\n }' After the quick fix is applied: 'class EmptyA()\n\n class EmptyB {\n companion object\n }\n\n fun emptyC() {\n object {}\n }' Inspection ID: RemoveEmptyClassBody", + "markdown": "Reports declarations of classes and objects with an empty body.\n\nUse the 'Remove redundant empty class body' quick-fix to clean up the code.\n\n**Examples:**\n\n\n class EmptyA() {} // <== empty body\n\n class EmptyB {\n companion object {} // <== empty body\n }\n\n fun emptyC() {\n object {} // <== anonymous object, it's ok (not reported)\n }\n\nAfter the quick fix is applied:\n\n\n class EmptyA()\n\n class EmptyB {\n companion object\n }\n\n fun emptyC() {\n object {}\n }\n\nInspection ID: RemoveEmptyClassBody" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveEmptyClassBody", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanBeParameter", + "shortDescription": { + "text": "Constructor parameter is never used as a property" + }, + "fullDescription": { + "text": "Reports primary constructor parameters that can have 'val' or 'var' removed. Class properties declared in the constructor increase memory consumption. If the parameter value is only used in the constructor, you can omit them. Note that the referenced object might be garbage-collected earlier. Example: 'class Task(val name: String) {\n init {\n print(\"Task created: $name\")\n }\n }' The quick-fix removes the extra 'val' or 'var' keyword: 'class Task(name: String) {\n init {\n print(\"Task created: $name\")\n }\n }' Inspection ID: CanBeParameter", + "markdown": "Reports primary constructor parameters that can have `val` or `var` removed.\n\n\nClass properties declared in the constructor increase memory consumption.\nIf the parameter value is only used in the constructor, you can omit them.\n\nNote that the referenced object might be garbage-collected earlier.\n\n**Example:**\n\n\n class Task(val name: String) {\n init {\n print(\"Task created: $name\")\n }\n }\n\nThe quick-fix removes the extra `val` or `var` keyword:\n\n\n class Task(name: String) {\n init {\n print(\"Task created: $name\")\n }\n }\n\nInspection ID: CanBeParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CanBeParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantReturnLabel", + "shortDescription": { + "text": "Redundant 'return' label" + }, + "fullDescription": { + "text": "Reports redundant return labels outside of lambda expressions. Example: 'fun test() {\n return@test\n }' After the quick-fix is applied: 'fun test() {\n return\n }' Inspection ID: RedundantReturnLabel", + "markdown": "Reports redundant return labels outside of lambda expressions.\n\n**Example:**\n\n\n fun test() {\n return@test\n }\n\nAfter the quick-fix is applied:\n\n\n fun test() {\n return\n }\n\nInspection ID: RedundantReturnLabel" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantReturnLabel", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageName", + "shortDescription": { + "text": "Package naming convention" + }, + "fullDescription": { + "text": "Reports package names that do not follow the naming conventions. You can specify the required pattern in the inspection options. Recommended naming conventions: names of packages are always lowercase and should not contain underscores. Example: 'org.example.project' Using multi-word names is generally discouraged, but if you do need to use multiple words, you can either just concatenate them together or use camel case Example: 'org.example.myProject' Inspection ID: PackageName", + "markdown": "Reports package names that do not follow the naming conventions.\n\nYou can specify the required pattern in the inspection options.\n\n[Recommended naming conventions](https://kotlinlang.org/docs/coding-conventions.html#naming-rules): names of packages are always lowercase and should not contain underscores.\n\n**Example:**\n`org.example.project`\n\nUsing multi-word names is generally discouraged, but if you do need to use multiple words, you can either just concatenate them together or use camel case\n\n**Example:**\n`org.example.myProject`\n\nInspection ID: PackageName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "PackageName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrayInDataClass", + "shortDescription": { + "text": "Array property in data class" + }, + "fullDescription": { + "text": "Reports properties with an 'Array' type in a 'data' class without overridden 'equals()' or 'hashCode()'. Array parameters are compared by reference equality, which is likely an unexpected behavior. It is strongly recommended to override 'equals()' and 'hashCode()' in such cases. Example: 'data class Text(val lines: Array)' The quick-fix generates missing 'equals()' and 'hashCode()' implementations: 'data class Text(val lines: Array) {\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (javaClass != other?.javaClass) return false\n\n other as Text\n\n if (!lines.contentEquals(other.lines)) return false\n\n return true\n }\n\n override fun hashCode(): Int {\n return lines.contentHashCode()\n }\n }' Inspection ID: ArrayInDataClass", + "markdown": "Reports properties with an `Array` type in a `data` class without overridden `equals()` or `hashCode()`.\n\n\nArray parameters are compared by reference equality, which is likely an unexpected behavior.\nIt is strongly recommended to override `equals()` and `hashCode()` in such cases.\n\n**Example:**\n\n\n data class Text(val lines: Array)\n\nThe quick-fix generates missing `equals()` and `hashCode()` implementations:\n\n\n data class Text(val lines: Array) {\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (javaClass != other?.javaClass) return false\n\n other as Text\n\n if (!lines.contentEquals(other.lines)) return false\n\n return true\n }\n\n override fun hashCode(): Int {\n return lines.contentHashCode()\n }\n }\n\nInspection ID: ArrayInDataClass" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ArrayInDataClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertTwoComparisonsToRangeCheck", + "shortDescription": { + "text": "Two comparisons should be converted to a range check" + }, + "fullDescription": { + "text": "Reports two consecutive comparisons that can be converted to a range check. Checking against a range makes code simpler by removing test subject duplication. Example: 'fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }' The quick-fix replaces the comparison-based check with a range one: 'fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }' Inspection ID: ConvertTwoComparisonsToRangeCheck", + "markdown": "Reports two consecutive comparisons that can be converted to a range check.\n\nChecking against a range makes code simpler by removing test subject duplication.\n\n**Example:**\n\n\n fun checkMonth(month: Int): Boolean {\n return month >= 1 && month <= 12\n }\n\nThe quick-fix replaces the comparison-based check with a range one:\n\n\n fun checkMonth(month: Int): Boolean {\n return month in 1..12\n }\n\nInspection ID: ConvertTwoComparisonsToRangeCheck" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertTwoComparisonsToRangeCheck", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LocalVariableName", + "shortDescription": { + "text": "Local variable naming convention" + }, + "fullDescription": { + "text": "Reports local variables that do not follow the naming conventions. You can specify the required pattern in the inspection options. Recommended naming conventions: it has to start with a lowercase letter, use camel case and no underscores. Example: 'fun fibonacciNumber(index: Int): Long = when(index) {\n 0 -> 0\n else -> {\n // does not follow naming conventions: contains underscore symbol (`_`)\n var number_one: Long = 0\n // does not follow naming conventions: starts with an uppercase letter\n var NUMBER_TWO: Long = 1\n // follow naming conventions: starts with a lowercase letter, use camel case and no underscores.\n var numberThree: Long = number_one + NUMBER_TWO\n\n for(currentIndex in 2..index) {\n numberThree = number_one + NUMBER_TWO\n number_one = NUMBER_TWO\n NUMBER_TWO = numberThree\n }\n numberThree\n }\n }' Inspection ID: LocalVariableName", + "markdown": "Reports local variables that do not follow the naming conventions.\n\nYou can specify the required pattern in the inspection options.\n\n[Recommended naming conventions](https://kotlinlang.org/docs/coding-conventions.html#function-names): it has to start with a lowercase letter, use camel case and no underscores.\n\n**Example:**\n\n\n fun fibonacciNumber(index: Int): Long = when(index) {\n 0 -> 0\n else -> {\n // does not follow naming conventions: contains underscore symbol (`_`)\n var number_one: Long = 0\n // does not follow naming conventions: starts with an uppercase letter\n var NUMBER_TWO: Long = 1\n // follow naming conventions: starts with a lowercase letter, use camel case and no underscores.\n var numberThree: Long = number_one + NUMBER_TWO\n\n for(currentIndex in 2..index) {\n numberThree = number_one + NUMBER_TWO\n number_one = NUMBER_TWO\n NUMBER_TWO = numberThree\n }\n numberThree\n }\n }\n\nInspection ID: LocalVariableName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LocalVariableName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EnumValuesSoftDeprecate", + "shortDescription": { + "text": "'Enum.values()' is recommended to be replaced by 'Enum.entries' since 1.9" + }, + "fullDescription": { + "text": "Reports calls from Kotlin to 'values()' method in enum classes that can be replaced with 'entries' property read. Use of 'Enum.entries' may improve performance of your code. The quick-fix replaces 'values()' with 'entries'. More details: KT-48872 Provide modern and performant replacement for Enum.values() Note: 'entries' property type is different from the return type of 'values()' method ('EnumEntries' which inherits from 'List' instead of 'Array'). Due to this in some cases quick fix inserts extra '.toTypedArray()' conversion to not break the code, but for most common cases replacement will be done without it (e.g. in 'for' loop). Example: 'enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())' After the quick-fix is applied: 'enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())' Inspection ID: EnumValuesSoftDeprecate", + "markdown": "Reports calls from Kotlin to `values()` method in enum classes that can be replaced with `entries` property read.\n\n\nUse of `Enum.entries` may improve performance of your code.\n\n\nThe quick-fix replaces `values()` with `entries`.\n\n\n**More details:** [KT-48872 Provide modern and performant replacement for Enum.values()](https://youtrack.jetbrains.com/issue/KT-48872)\n\n\n**Note:** `entries` property type is different from the return type of `values()` method\n(`EnumEntries` which inherits from `List` instead of `Array`).\nDue to this in some cases quick fix inserts extra `.toTypedArray()` conversion to not break the code, but\nfor most common cases replacement will be done without it (e.g. in `for` loop).\n\n**Example:**\n\n\n enum class Version {\n V1, V2\n }\n\n Version.values().forEach { /* .. */ }\n val firstVersion = Version.values()[0]\n functionExpectingArray(Version.values())\n\nAfter the quick-fix is applied:\n\n\n enum class Version {\n V1, V2\n }\n\n Version.entries.forEach { /* .. */ }\n val firstVersion = Version.entries[0]\n functionExpectingArray(Version.entries.toTypedArray())\n\nInspection ID: EnumValuesSoftDeprecate" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EnumValuesSoftDeprecate", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Other problems", + "index": 75, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveRedundantQualifierName", + "shortDescription": { + "text": "Redundant qualifier name" + }, + "fullDescription": { + "text": "Reports redundant qualifiers (or their parts) on class names, functions, and properties. A fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to. In the contexts where the name can be shortened, the inspection informs on the opportunity and the associated 'Remove redundant qualifier name' quick-fix allows amending the code. Examples: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }' After the quick-fix is applied: 'package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }' Inspection ID: RemoveRedundantQualifierName", + "markdown": "Reports redundant qualifiers (or their parts) on class names, functions, and properties.\n\n\nA fully qualified name is an unambiguous identifier that specifies which object, function, or property a call refers to.\nIn the contexts where the name can be shortened, the inspection informs on the opportunity and the associated\n'Remove redundant qualifier name' quick-fix allows amending the code.\n\n**Examples:**\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = my.simple.name.Foo() // 'Foo' resides in the declared 'my.simple.name' package, qualifier is redundant\n val b = kotlin.Int.MAX_VALUE // Can be replaced with 'MAX_VALUE' since it's imported\n val c = kotlin.Double.MAX_VALUE // Can be replaced with 'Double.MAX_VALUE' since built-in types are imported automatically\n }\n\nAfter the quick-fix is applied:\n\n\n package my.simple.name\n import kotlin.Int.Companion.MAX_VALUE\n\n class Foo\n\n fun main() {\n val a = Foo()\n val b = MAX_VALUE\n val c = Double.MAX_VALUE\n }\n\nInspection ID: RemoveRedundantQualifierName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RemoveRedundantQualifierName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveCurlyBracesFromTemplate", + "shortDescription": { + "text": "Redundant curly braces in string template" + }, + "fullDescription": { + "text": "Reports usages of curly braces in string templates around simple identifiers. Use the 'Remove curly braces' quick-fix to remove the redundant braces. Examples: 'fun redundant() {\n val x = 4\n val y = \"${x}\" // <== redundant\n }\n\n fun correctUsage() {\n val x = \"x\"\n val y = \"${x.length}\" // <== Ok\n }' After the quick-fix is applied: 'fun redundant() {\n val x = 4\n val y = \"$x\"\n }\n\n fun correctUsage() {\n val x = \"x\" <== Updated\n val y = \"${x.length}\"\n }' Inspection ID: RemoveCurlyBracesFromTemplate", + "markdown": "Reports usages of curly braces in string templates around simple identifiers.\n\nUse the 'Remove curly braces' quick-fix to remove the redundant braces.\n\n**Examples:**\n\n\n fun redundant() {\n val x = 4\n val y = \"${x}\" // <== redundant\n }\n\n fun correctUsage() {\n val x = \"x\"\n val y = \"${x.length}\" // <== Ok\n }\n\nAfter the quick-fix is applied:\n\n\n fun redundant() {\n val x = 4\n val y = \"$x\"\n }\n\n fun correctUsage() {\n val x = \"x\" <== Updated\n val y = \"${x.length}\"\n }\n\nInspection ID: RemoveCurlyBracesFromTemplate" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveCurlyBracesFromTemplate", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceSubstringWithIndexingOperation", + "shortDescription": { + "text": "'substring' call should be replaced with indexing operator" + }, + "fullDescription": { + "text": "Reports calls like '\"abc\".substring(0, 1)' that can be replaced with '\"abc\"[0]'. Obtaining the element by index makes your code simpler. The quick-fix replaces the 'substring' call with the indexing operator. Example: 'fun foo() {\n \"abc\".substring(0, 1)\n }' After the quick-fix is applied: 'fun foo() {\n \"abc\"[0]\n }' Inspection ID: ReplaceSubstringWithIndexingOperation", + "markdown": "Reports calls like `\"abc\".substring(0, 1)` that can be replaced with `\"abc\"[0]`.\n\nObtaining the element by index makes your code simpler.\n\nThe quick-fix replaces the `substring` call with the indexing operator.\n\n**Example:**\n\n\n fun foo() {\n \"abc\".substring(0, 1)\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n \"abc\"[0]\n }\n\nInspection ID: ReplaceSubstringWithIndexingOperation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceSubstringWithIndexingOperation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousCollectionReassignment", + "shortDescription": { + "text": "Augmented assignment creates a new collection under the hood" + }, + "fullDescription": { + "text": "Reports augmented assignment ('+=') expressions on a read-only 'Collection'. Augmented assignment ('+=') expression on a read-only 'Collection' temporarily allocates a new collection, which may hurt performance. Change type to mutable quick-fix can be used to amend the code automatically. Example: 'fun test() {\n var list = listOf(0)\n list += 42 // A new list is allocated here, equivalent to list = list + 42\n }' After the quick-fix is applied: 'fun test() {\n val list = mutableListOf(0)\n list += 42\n }' Inspection ID: SuspiciousCollectionReassignment", + "markdown": "Reports augmented assignment (`+=`) expressions on a read-only `Collection`.\n\nAugmented assignment (`+=`) expression on a read-only `Collection` temporarily allocates a new collection,\nwhich may hurt performance.\n\n**Change type to mutable** quick-fix can be used to amend the code automatically.\n\nExample:\n\n\n fun test() {\n var list = listOf(0)\n list += 42 // A new list is allocated here, equivalent to list = list + 42\n }\n\nAfter the quick-fix is applied:\n\n\n fun test() {\n val list = mutableListOf(0)\n list += 42\n }\n\nInspection ID: SuspiciousCollectionReassignment" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "SuspiciousCollectionReassignment", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MoveLambdaOutsideParentheses", + "shortDescription": { + "text": "Lambda argument inside parentheses" + }, + "fullDescription": { + "text": "Reports lambda expressions in parentheses which can be moved outside. Example: 'fun square(a: Int, b: (Int) -> Int) {\n b(a * a)\n}\n\nfun foo() {\n square(2, { it })\n}' After the quick-fix is applied: 'fun foo() {\n square(2){ it }\n}' Inspection ID: MoveLambdaOutsideParentheses", + "markdown": "Reports lambda expressions in parentheses which can be moved outside.\n\n**Example:**\n\n\n fun square(a: Int, b: (Int) -> Int) {\n b(a * a)\n }\n\n fun foo() {\n square(2, { it })\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo() {\n square(2){ it }\n }\n\nInspection ID: MoveLambdaOutsideParentheses" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MoveLambdaOutsideParentheses", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantElvisReturnNull", + "shortDescription": { + "text": "Redundant '?: return null'" + }, + "fullDescription": { + "text": "Reports redundant '?: return null' Example: 'fun foo(): Int? {\n ...\n }\n\n fun test() : Int? {\n return foo() ?: return null\n }' After the quick-fix is applied: 'fun foo(): Int? {\n ...\n }\n\n fun test() : Int? {\n return foo()\n }' Inspection ID: RedundantElvisReturnNull", + "markdown": "Reports redundant `?: return null`\n\n**Example:**\n\n\n fun foo(): Int? {\n ...\n }\n\n fun test() : Int? {\n return foo() ?: return null\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(): Int? {\n ...\n }\n\n fun test() : Int? {\n return foo()\n }\n\nInspection ID: RedundantElvisReturnNull" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantElvisReturnNull", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PrivatePropertyName", + "shortDescription": { + "text": "Private property naming convention" + }, + "fullDescription": { + "text": "Reports private property names that do not follow the recommended naming conventions. Consistent naming allows for easier code reading and understanding. According to the Kotlin official style guide, private property names should start with a lowercase letter and use camel case. Optionally, underscore prefix is allowed but only for private properties. It is possible to introduce other naming rules by changing the \"Pattern\" regular expression. Example: 'val _My_Cool_Property = \"\"' The quick-fix renames the class according to the Kotlin naming conventions: 'val _myCoolProperty = \"\"' Inspection ID: PrivatePropertyName", + "markdown": "Reports private property names that do not follow the recommended naming conventions.\n\n\nConsistent naming allows for easier code reading and understanding.\nAccording to the [Kotlin official style guide](https://kotlinlang.org/docs/coding-conventions.html#naming-rules),\nprivate property names should start with a lowercase letter and use camel case.\nOptionally, underscore prefix is allowed but only for **private** properties.\n\nIt is possible to introduce other naming rules by changing the \"Pattern\" regular expression.\n\n**Example:**\n\n\n val _My_Cool_Property = \"\"\n\nThe quick-fix renames the class according to the Kotlin naming conventions:\n\n\n val _myCoolProperty = \"\"\n\nInspection ID: PrivatePropertyName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "PrivatePropertyName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedLambdaExpression", + "shortDescription": { + "text": "Unused lambda expression" + }, + "fullDescription": { + "text": "Reports lambda expressions that are neither invoked nor assigned. A lambda expression that is neither invoked nor assigned to a variable has no effect on program execution and is likely unintentional. Example: 'fun foo() {\n {} // Warning: Lambda expression is never invoked\n }' After the quick fix is applied: 'fun foo() {\n run {} // Lambda is now invoked via the 'run' function\n }' Inspection ID: UnusedLambdaExpression", + "markdown": "Reports lambda expressions that are neither invoked nor assigned.\n\n\nA lambda expression that is neither invoked nor assigned to a variable has no effect on program execution and is likely unintentional.\n\n**Example:**\n\n\n fun foo() {\n {} // Warning: Lambda expression is never invoked\n }\n\nAfter the quick fix is applied:\n\n\n fun foo() {\n run {} // Lambda is now invoked via the 'run' function\n }\n\nInspection ID: UnusedLambdaExpression" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedLambdaExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CascadeIf", + "shortDescription": { + "text": "Cascade 'if' can be replaced with 'when'" + }, + "fullDescription": { + "text": "Reports 'if' statements with three or more branches that can be replaced with the 'when' expression with a subject. Example: 'fun translateNumber(n: Int): String {\n return if (n == 1) {\n \"one\"\n } else if (n == 2) {\n \"two\"\n } else {\n \"???\"\n }\n }' The quick-fix converts the 'if' expression to 'when': 'fun translateNumber(n: Int): String {\n return when (n) {\n 1 -> {\n \"one\"\n }\n 2 -> {\n \"two\"\n }\n else -> {\n \"???\"\n }\n }\n }' Inspection ID: CascadeIf", + "markdown": "Reports `if` statements with three or more branches that can be replaced with the `when` expression with a subject.\n\n**Example:**\n\n\n fun translateNumber(n: Int): String {\n return if (n == 1) {\n \"one\"\n } else if (n == 2) {\n \"two\"\n } else {\n \"???\"\n }\n }\n\nThe quick-fix converts the `if` expression to `when`:\n\n\n fun translateNumber(n: Int): String {\n return when (n) {\n 1 -> {\n \"one\"\n }\n 2 -> {\n \"two\"\n }\n else -> {\n \"???\"\n }\n }\n }\n\nInspection ID: CascadeIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CascadeIf", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TestFunctionName", + "shortDescription": { + "text": "Test function naming convention" + }, + "fullDescription": { + "text": "Reports test function names that do not follow the recommended naming conventions. Inspection ID: TestFunctionName", + "markdown": "Reports test function names that do not follow the [recommended naming conventions](https://kotlinlang.org/docs/coding-conventions.html#names-for-test-methods).\n\nInspection ID: TestFunctionName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TestFunctionName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RecursivePropertyAccessor", + "shortDescription": { + "text": "Recursive property accessor" + }, + "fullDescription": { + "text": "Reports recursive property accessor calls which can end up with a 'StackOverflowError'. Such calls are usually confused with backing field access. Example: 'var counter: Int = 0\n set(value) {\n counter = if (value < 0) 0 else value\n }' After the quick-fix is applied: 'var counter: Int = 0\n set(value) {\n field = if (value < 0) 0 else value\n }' Inspection ID: RecursivePropertyAccessor", + "markdown": "Reports recursive property accessor calls which can end up with a `StackOverflowError`.\nSuch calls are usually confused with backing field access.\n\n**Example:**\n\n\n var counter: Int = 0\n set(value) {\n counter = if (value < 0) 0 else value\n }\n\nAfter the quick-fix is applied:\n\n\n var counter: Int = 0\n set(value) {\n field = if (value < 0) 0 else value\n }\n\nInspection ID: RecursivePropertyAccessor" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RecursivePropertyAccessor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DestructuringWrongName", + "shortDescription": { + "text": "Variable in destructuring declaration uses name of a wrong data class property" + }, + "fullDescription": { + "text": "Reports entries of destructuring declarations that match the name of a different property of the destructured data class. Example: 'data class Foo(val a: String, val b: Int, val c: String)\n\n fun bar(f: Foo) {\n val (a, c) = f\n }' The quick-fix changes variable's name to match the name of the corresponding class field: 'data class Foo(val a: String, val b: Int, val c: String)\n\n fun bar(f: Foo) {\n val (a, b) = f\n }' Inspection ID: DestructuringWrongName", + "markdown": "Reports entries of destructuring declarations that match the name of a different property of the destructured data class.\n\n**Example:**\n\n\n data class Foo(val a: String, val b: Int, val c: String)\n\n fun bar(f: Foo) {\n val (a, c) = f\n }\n\nThe quick-fix changes variable's name to match the name of the corresponding class field:\n\n\n data class Foo(val a: String, val b: Int, val c: String)\n\n fun bar(f: Foo) {\n val (a, b) = f\n }\n\nInspection ID: DestructuringWrongName" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DestructuringWrongName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IfThenToSafeAccess", + "shortDescription": { + "text": "Can be joined with assignment" + }, + "fullDescription": { + "text": "Reports 'if-then' expressions that can be folded into safe-access ('?.') expressions. Example: 'fun bar(x: String) = \"\"\n\n fun foo(a: String?) {\n if (a != null) bar(a) else null\n }' The quick fix converts the 'if-then' expression into a safe-access ('?.') expression: 'fun bar(x: String) = \"\"\n\n fun foo(a: String?) {\n a?.let { bar(it) }\n }' Inspection ID: IfThenToSafeAccess", + "markdown": "Reports `if-then` expressions that can be folded into safe-access (`?.`) expressions.\n\n**Example:**\n\n\n fun bar(x: String) = \"\"\n\n fun foo(a: String?) {\n if (a != null) bar(a) else null\n }\n\nThe quick fix converts the `if-then` expression into a safe-access (`?.`) expression:\n\n\n fun bar(x: String) = \"\"\n\n fun foo(a: String?) {\n a?.let { bar(it) }\n }\n\nInspection ID: IfThenToSafeAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "IfThenToSafeAccess", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantUnitExpression", + "shortDescription": { + "text": "Redundant 'Unit'" + }, + "fullDescription": { + "text": "Reports redundant 'Unit' expressions. 'Unit' in Kotlin can be used as the return type of functions that do not return anything meaningful. The 'Unit' type has only one possible value, which is the 'Unit' object. Examples: 'fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }' Inspection ID: RedundantUnitExpression", + "markdown": "Reports redundant `Unit` expressions.\n\n\n`Unit` in Kotlin can be used as the return type of functions that do not return anything meaningful.\nThe `Unit` type has only one possible value, which is the `Unit` object.\n\n**Examples:**\n\n\n fun redundantA(): Unit {\n return Unit // redundant, 'Unit' is returned by default and matches the expected return type\n }\n\n fun requiredA(condition: Boolean): Any {\n if (condition) return \"hello\"\n return Unit // explicit 'Unit' is required since the expected type is 'Any'\n }\n\n fun redundantB(condition: Boolean): Any = if (condition) {\n fun ancillary(): Int = 1\n println(\"${ancillary()}\")\n Unit // redundant since the last expression is already of type 'Unit'\n } else {\n println(\"else\")\n }\n\n fun requiredB(condition: Boolean): Any = if (condition) {\n 1024\n Unit // required, otherwise '1024' (Int) would be the return value\n } else {\n println(\"else\")\n }\n\nInspection ID: RedundantUnitExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantUnitExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousEqualsCombination", + "shortDescription": { + "text": "Suspicious combination of == and ===" + }, + "fullDescription": { + "text": "Reports '==' and '===' comparisons that are both used on the same variable within a single expression. Due to similarities '==' and '===' could be mixed without notice, and it takes a close look to check that '==' used instead of '===' Example: 'if (type === FIELD || type == METHOD || type == ANNOTATION_METHOD || // Note that \"==\" is used incorrectly\n type === LAMBDA_EXPRESSION) return' Inspection ID: SuspiciousEqualsCombination", + "markdown": "Reports `==` and `===` comparisons that are both used on the same variable within a single expression.\n\nDue to similarities `==` and `===` could be mixed without notice, and\nit takes a close look to check that `==` used instead of `===`\n\nExample:\n\n\n if (type === FIELD || type == METHOD || type == ANNOTATION_METHOD || // Note that \"==\" is used incorrectly\n type === LAMBDA_EXPRESSION) return\n\nInspection ID: SuspiciousEqualsCombination" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "SuspiciousEqualsCombination", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantElseInIf", + "shortDescription": { + "text": "Redundant 'else'" + }, + "fullDescription": { + "text": "Reports redundant 'else' in 'if' with 'return' Example: 'fun foo(arg: Boolean): Int {\n if (arg) return 0\n else { // This else is redundant, code in braces could be just shifted left\n someCode()\n }\n }' After the quick-fix is applied: 'fun foo(arg: Boolean): Int {\n if (arg) return 0\n someCode()\n }' Inspection ID: RedundantElseInIf", + "markdown": "Reports redundant `else` in `if` with `return`\n\n**Example:**\n\n\n fun foo(arg: Boolean): Int {\n if (arg) return 0\n else { // This else is redundant, code in braces could be just shifted left\n someCode()\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(arg: Boolean): Int {\n if (arg) return 0\n someCode()\n }\n\nInspection ID: RedundantElseInIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantElseInIf", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SelfReferenceConstructorParameter", + "shortDescription": { + "text": "Constructor can never be complete" + }, + "fullDescription": { + "text": "Reports constructors with a non-null self-reference parameter. Such constructors never instantiate a class. The quick-fix converts the parameter type to nullable. Example: 'class SelfRef(val ref: SelfRef)' After the quick-fix is applied: 'class SelfRef(val ref: SelfRef?)' Inspection ID: SelfReferenceConstructorParameter", + "markdown": "Reports constructors with a non-null self-reference parameter.\n\nSuch constructors never instantiate a class.\n\nThe quick-fix converts the parameter type to nullable.\n\n**Example:**\n\n\n class SelfRef(val ref: SelfRef)\n\nAfter the quick-fix is applied:\n\n\n class SelfRef(val ref: SelfRef?)\n\nInspection ID: SelfReferenceConstructorParameter" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SelfReferenceConstructorParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplacePutWithAssignment", + "shortDescription": { + "text": "'map.put()' can be converted to assignment" + }, + "fullDescription": { + "text": "Reports 'map.put' function calls that can be replaced with indexing operator ('[]'). Using syntactic sugar makes your code simpler. The quick-fix replaces 'put' call with the assignment. Example: 'fun foo(map: MutableMap) {\n map.put(42, \"foo\")\n }' After the quick-fix is applied: 'fun foo(map: MutableMap) {\n map[42] = \"foo\"\n }' Inspection ID: ReplacePutWithAssignment", + "markdown": "Reports `map.put` function calls that can be replaced with indexing operator (`[]`).\n\nUsing syntactic sugar makes your code simpler.\n\nThe quick-fix replaces `put` call with the assignment.\n\n**Example:**\n\n\n fun foo(map: MutableMap) {\n map.put(42, \"foo\")\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(map: MutableMap) {\n map[42] = \"foo\"\n }\n\nInspection ID: ReplacePutWithAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplacePutWithAssignment", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaIoSerializableObjectMustHaveReadResolve", + "shortDescription": { + "text": "Serializable object must implement 'readResolve'" + }, + "fullDescription": { + "text": "Reports 'object's ('data object' including) that implement 'java.io.Serializable' but don't implement readResolve Example: 'import java.io.Serializable\n\n object Foo : Serializable' The quick fix implements 'readResolve' method: 'import java.io.Serializable\n\n object Foo : Serializable {\n private fun readResolve() = Foo\n }' Inspection ID: JavaIoSerializableObjectMustHaveReadResolve", + "markdown": "Reports `object`s (`data object` including) that implement `java.io.Serializable` but don't implement\n[readResolve](https://docs.oracle.com/en/java/javase/11/docs/specs/serialization/input.html#the-readresolve-method)\n\n**Example:**\n\n\n import java.io.Serializable\n\n object Foo : Serializable\n\nThe quick fix implements `readResolve` method:\n\n\n import java.io.Serializable\n\n object Foo : Serializable {\n private fun readResolve() = Foo\n }\n\nInspection ID: JavaIoSerializableObjectMustHaveReadResolve" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "JavaIoSerializableObjectMustHaveReadResolve", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MainFunctionReturnUnit", + "shortDescription": { + "text": "Main function should return 'Unit'" + }, + "fullDescription": { + "text": "Reports when a main function does not have a return type of 'Unit'. Example: 'fun main() = \"Hello world!\"' Inspection ID: MainFunctionReturnUnit", + "markdown": "Reports when a main function does not have a return type of `Unit`.\n\n**Example:**\n`fun main() = \"Hello world!\"`\n\nInspection ID: MainFunctionReturnUnit" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MainFunctionReturnUnit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanUnescapeDollarLiteral", + "shortDescription": { + "text": "Redundant escaped dollar characters in string literals" + }, + "fullDescription": { + "text": "Reports that escaped dollar characters in a string can be replaced with regular literals. Escaping is only necessary when string content after dollar can be misinterpreted as a string interpolation entry. Example: 'fun example() {\n \"The price today is \\$10. The price tomorrow will be ${'$'}20.\"\n }' The quick fix converts all safely replaceable escaped dollar characters to regular dollar characters: 'fun example() {\n \"The price today is $10. The price tomorrow will be $20.\"\n }' Inspection ID: CanUnescapeDollarLiteral", + "markdown": "Reports that escaped dollar characters in a string can be replaced with regular literals.\n\n\nEscaping is only necessary when string content after dollar can be misinterpreted as a string interpolation entry.\n\n**Example:**\n\n\n fun example() {\n \"The price today is \\$10. The price tomorrow will be ${'$'}20.\"\n }\n\nThe quick fix converts all safely replaceable escaped dollar characters to regular dollar characters:\n\n\n fun example() {\n \"The price today is $10. The price tomorrow will be $20.\"\n }\n\nInspection ID: CanUnescapeDollarLiteral" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CanUnescapeDollarLiteral", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinDoubleNegation", + "shortDescription": { + "text": "Redundant double negation" + }, + "fullDescription": { + "text": "Reports redundant double negations. Example: 'val truth = !!true' Inspection ID: KotlinDoubleNegation", + "markdown": "Reports redundant double negations.\n\n**Example:**\n\n val truth = !!true\n\nInspection ID: KotlinDoubleNegation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "DoubleNegation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FunctionName", + "shortDescription": { + "text": "Function naming convention" + }, + "fullDescription": { + "text": "Reports function names that do not follow the recommended naming conventions. Example: 'fun Foo() {}' To fix the problem change the name of the function to match the recommended naming conventions. Inspection ID: FunctionName", + "markdown": "Reports function names that do not follow the recommended naming conventions.\n\n**Example:**\n\n\n fun Foo() {}\n\nTo fix the problem change the name of the function to match the recommended naming conventions.\n\nInspection ID: FunctionName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "FunctionName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertSecondaryConstructorToPrimary", + "shortDescription": { + "text": "Convert to primary constructor" + }, + "fullDescription": { + "text": "Reports a secondary constructor that can be replaced with a more concise primary constructor. Example: 'class User {\n val name: String\n\n constructor(name: String) {\n this.name = name\n }\n }' The quick-fix converts code automatically: 'class User(val name: String) {\n }' Inspection ID: ConvertSecondaryConstructorToPrimary", + "markdown": "Reports a secondary constructor that can be replaced with a more concise primary constructor.\n\n**Example:**\n\n\n class User {\n val name: String\n\n constructor(name: String) {\n this.name = name\n }\n }\n\nThe quick-fix converts code automatically:\n\n\n class User(val name: String) {\n }\n\nInspection ID: ConvertSecondaryConstructorToPrimary" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertSecondaryConstructorToPrimary", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DifferentKotlinMavenVersion", + "shortDescription": { + "text": "Maven and IDE plugins versions are different" + }, + "fullDescription": { + "text": "Reports that Maven plugin version isn't properly supported in the current IDE plugin. This inconsistency may lead to different error reporting behavior in the IDE and the compiler Inspection ID: DifferentKotlinMavenVersion", + "markdown": "Reports that Maven plugin version isn't properly supported in the current IDE plugin.\n\nThis inconsistency may lead to different error reporting behavior in the IDE and the compiler\n\nInspection ID: DifferentKotlinMavenVersion" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DifferentKotlinMavenVersion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin", + "index": 2, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceGetOrSet", + "shortDescription": { + "text": "Explicit 'get' or 'set' call" + }, + "fullDescription": { + "text": "Reports explicit calls to 'get' or 'set' functions which can be replaced by an indexing operator '[]'. Kotlin allows custom implementations for the predefined set of operators on types. To overload an operator, you can mark the corresponding function with the 'operator' modifier: 'operator fun get(index: Int) {}\n operator fun set(index: Int, value: Int) {}' The functions above correspond to the indexing operator. Example: 'class Test {\n operator fun get(i: Int): Int = 0\n }\n\n fun test() {\n Test().get(0) // replaceable 'get()'\n }' After the quick-fix is applied: 'class Test {\n operator fun get(i: Int): Int = 0\n }\n\n fun test() {\n Test()[0]\n }' Inspection ID: ReplaceGetOrSet", + "markdown": "Reports explicit calls to `get` or `set` functions which can be replaced by an indexing operator `[]`.\n\n\nKotlin allows custom implementations for the predefined set of operators on types.\nTo overload an operator, you can mark the corresponding function with the `operator` modifier:\n\n\n operator fun get(index: Int) {}\n operator fun set(index: Int, value: Int) {}\n \nThe functions above correspond to the indexing operator.\n\n**Example:**\n\n class Test {\n operator fun get(i: Int): Int = 0\n }\n\n fun test() {\n Test().get(0) // replaceable 'get()'\n }\n\nAfter the quick-fix is applied:\n\n class Test {\n operator fun get(i: Int): Int = 0\n }\n\n fun test() {\n Test()[0]\n }\n\nInspection ID: ReplaceGetOrSet" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceGetOrSet", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantUnitReturnType", + "shortDescription": { + "text": "Redundant 'Unit' return type" + }, + "fullDescription": { + "text": "Reports a redundant 'Unit' return type which can be omitted. Example: 'fun test(): Unit {\n ...\n }' The quick fix removes the 'Unit' return type: 'fun test() {\n ...\n }' Inspection ID: RedundantUnitReturnType", + "markdown": "Reports a redundant `Unit` return type which can be omitted.\n\n**Example:**\n\n\n fun test(): Unit {\n ...\n }\n\nThe quick fix removes the `Unit` return type:\n\n\n fun test() {\n ...\n }\n\nInspection ID: RedundantUnitReturnType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantUnitReturnType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedReceiverParameter", + "shortDescription": { + "text": "Unused receiver parameter" + }, + "fullDescription": { + "text": "Reports receiver parameter of extension functions and properties that is not used. Remove redundant receiver parameter can be used to amend the code automatically. Inspection ID: UnusedReceiverParameter", + "markdown": "Reports receiver parameter of extension functions and properties that is not used.\n\n**Remove redundant receiver parameter** can be used to amend the code automatically.\n\nInspection ID: UnusedReceiverParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedReceiverParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinRedundantOverride", + "shortDescription": { + "text": "Redundant overriding method" + }, + "fullDescription": { + "text": "Reports redundant overriding declarations. An override can be omitted if it does not modify the inherited signature semantics, for example, by changing visibility. Example: 'open class Foo {\n open fun singleExpression() {\n }\n }\n\n class Bar : Foo() {\n override fun singleExpression() = super.singleExpression()\n }' After the quick-fix is applied: 'class Bar : Foo() {\n }' Inspection ID: KotlinRedundantOverride", + "markdown": "Reports redundant overriding declarations.\n\n\nAn override can be omitted if it does not modify the inherited signature semantics, for example, by changing visibility.\n\n**Example:**\n\n\n open class Foo {\n open fun singleExpression() {\n }\n }\n\n class Bar : Foo() {\n override fun singleExpression() = super.singleExpression()\n }\n\nAfter the quick-fix is applied:\n\n\n class Bar : Foo() {\n }\n\nInspection ID: KotlinRedundantOverride" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantOverride", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RunBlocking", + "shortDescription": { + "text": "RunBlocking in coroutine" + }, + "fullDescription": { + "text": "Reports runBlocking builders that can be reached from coroutines. Coroutines share threads for execution. When a runBlocking builder is called from a coroutine it blocks the underlying thread and prevents other coroutines from using this resource. This can result in performance issues and in bad cases thread starvation. It provides a potential callstack from coroutine primitive (suspend function or builder) to runBlocking builder. Example: 'suspend fun main() {\n foo() \n }\n\n fun foo() {\n runBlocking { suspendFunction() }\n }' Potential solution: 'suspend fun main() {\n foo() \n }\n\n suspend fun foo() {\n suspendFunction()\n }' Use the explore functions with overrides option to configure analysis for virtual functions: Use the No option to skip analysis for a function with overrides. Use the Yes, excluding overrides option to only explore the function in the defined callee type. Use the Yes, including overrides option to explore the function and all overrides. Inspection ID: RunBlocking", + "markdown": "Reports runBlocking builders that can be reached from coroutines.\n\nCoroutines share threads for execution. When a runBlocking builder is called from a coroutine it blocks the underlying thread and prevents other coroutines from using this resource. This can result in performance issues and in bad cases thread starvation.\n\nIt provides a potential callstack from coroutine primitive (suspend function or builder) to runBlocking builder.\n\nExample:\n\n\n suspend fun main() {\n foo() \n }\n\n fun foo() {\n runBlocking { suspendFunction() }\n }\n\nPotential solution:\n\n\n suspend fun main() {\n foo() \n }\n\n suspend fun foo() {\n suspendFunction()\n }\n\nUse the **explore functions with overrides** option to configure analysis for virtual functions:\n\n* Use the **No** option to skip analysis for a function with overrides.\n* Use the **Yes, excluding overrides** option to only explore the function in the defined callee type.\n* Use the **Yes, including overrides** option to explore the function and all overrides.\n\nInspection ID: RunBlocking" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RunBlocking", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Coroutine inspections", + "index": 99, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceArrayOfWithLiteral", + "shortDescription": { + "text": "'arrayOf' call can be replaced with array literal [...]" + }, + "fullDescription": { + "text": "Reports 'arrayOf' calls that can be replaced with array literals '[...]'. Examples: 'annotation class MyAnnotation(val strings: Array)\n\n @MyAnnotation(arrayOf(\"alpha\", \"beta\", \"omega\")) // replaceable 'arrayOf()'\n class MyClass' After the quick-fix is applied: 'annotation class MyAnnotation(val strings: Array)\n\n @MyAnnotation([\"alpha\", \"beta\", \"omega\"])\n class MyClass' Inspection ID: ReplaceArrayOfWithLiteral", + "markdown": "Reports `arrayOf` calls that can be replaced with array literals `[...]`.\n\n**Examples:**\n\n annotation class MyAnnotation(val strings: Array)\n\n @MyAnnotation(arrayOf(\"alpha\", \"beta\", \"omega\")) // replaceable 'arrayOf()'\n class MyClass\n\nAfter the quick-fix is applied:\n\n annotation class MyAnnotation(val strings: Array)\n\n @MyAnnotation([\"alpha\", \"beta\", \"omega\"])\n class MyClass\n\nInspection ID: ReplaceArrayOfWithLiteral" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceArrayOfWithLiteral", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceRangeToWithUntil", + "shortDescription": { + "text": "'rangeTo' or the '..' call should be replaced with 'until'" + }, + "fullDescription": { + "text": "Reports calls to 'rangeTo' or the '..' operator instead of calls to 'until'. Using corresponding functions makes your code simpler. The quick-fix replaces 'rangeTo' or the '..' call with 'until'. Example: 'fun foo(a: Int) {\n for (i in 0..a - 1) {\n\n }\n }' After the quick-fix is applied: 'fun foo(a: Int) {\n for (i in 0 until a) {\n\n }\n }' Inspection ID: ReplaceRangeToWithUntil", + "markdown": "Reports calls to `rangeTo` or the `..` operator instead of calls to `until`.\n\nUsing corresponding functions makes your code simpler.\n\nThe quick-fix replaces `rangeTo` or the `..` call with `until`.\n\n**Example:**\n\n\n fun foo(a: Int) {\n for (i in 0..a - 1) {\n\n }\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(a: Int) {\n for (i in 0 until a) {\n\n }\n }\n\nInspection ID: ReplaceRangeToWithUntil" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceRangeToWithUntil", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceToWithInfixForm", + "shortDescription": { + "text": "'to' call should be replaced with infix form" + }, + "fullDescription": { + "text": "Reports 'to' function calls that can be replaced with the infix form. Using the infix form makes your code simpler. The quick-fix replaces 'to' with the infix form. Example: 'fun foo(a: Int, b: Int) {\n val pair = a.to(b)\n }' After the quick-fix is applied: 'fun foo(a: Int, b: Int) {\n val pair = a to b\n }' Inspection ID: ReplaceToWithInfixForm", + "markdown": "Reports `to` function calls that can be replaced with the infix form.\n\nUsing the infix form makes your code simpler.\n\nThe quick-fix replaces `to` with the infix form.\n\n**Example:**\n\n\n fun foo(a: Int, b: Int) {\n val pair = a.to(b)\n }\n\nAfter the quick-fix is applied:\n\n\n fun foo(a: Int, b: Int) {\n val pair = a to b\n }\n\nInspection ID: ReplaceToWithInfixForm" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceToWithInfixForm", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstPropertyName", + "shortDescription": { + "text": "Const property naming convention" + }, + "fullDescription": { + "text": "Reports 'const' property names that do not follow the recommended naming conventions. Consistent naming allows for easier code reading and understanding. According to the Kotlin official style guide, 'const' properties should use uppercase underscore-separated names. Example: 'const val Planck: Double = 6.62607015E-34' The quick-fix renames the property: 'const val PLANCK: Double = 6.62607015E-34' Inspection ID: ConstPropertyName", + "markdown": "Reports `const` property names that do not follow the recommended naming conventions.\n\n\nConsistent naming allows for easier code reading and understanding.\nAccording to the [Kotlin official style guide](https://kotlinlang.org/docs/coding-conventions.html#property-names),\n`const` properties should use uppercase underscore-separated names.\n\n**Example:**\n\n\n const val Planck: Double = 6.62607015E-34\n\nThe quick-fix renames the property:\n\n\n const val PLANCK: Double = 6.62607015E-34\n\nInspection ID: ConstPropertyName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConstPropertyName", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Naming conventions", + "index": 49, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantNullableReturnType", + "shortDescription": { + "text": "Redundant nullable return type" + }, + "fullDescription": { + "text": "Reports functions and variables with nullable return type which never return or become 'null'. Example: 'fun greeting(user: String): String? = \"Hello, $user!\"' After the quick-fix is applied: 'fun greeting(user: String): String = \"Hello, $user!\"' Inspection ID: RedundantNullableReturnType", + "markdown": "Reports functions and variables with nullable return type which never return or become `null`.\n\n**Example:**\n\n\n fun greeting(user: String): String? = \"Hello, $user!\"\n\nAfter the quick-fix is applied:\n\n\n fun greeting(user: String): String = \"Hello, $user!\"\n\nInspection ID: RedundantNullableReturnType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantNullableReturnType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Redundant constructs", + "index": 5, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnclearPrecedenceOfBinaryExpression", + "shortDescription": { + "text": "Multiple operators with different precedence" + }, + "fullDescription": { + "text": "Reports binary expressions that consist of different operators without parentheses. Such expressions can be less readable due to different precedence rules of operators. Example: fun foo(b: Boolean?, i: Int?) {\n val x = b ?: i == null // evaluated as `(b ?: i) == null`\n val y = i ?: 0 + 1 // evaluated as `i ?: (0 + 1)`\n }\n Inspection ID: UnclearPrecedenceOfBinaryExpression", + "markdown": "Reports binary expressions that consist of different operators without parentheses.\n\nSuch expressions can be less readable due to different [precedence rules](https://kotlinlang.org/docs/reference/grammar.html#expressions) of operators.\n\nExample:\n\n```\n fun foo(b: Boolean?, i: Int?) {\n val x = b ?: i == null // evaluated as `(b ?: i) == null`\n val y = i ?: 0 + 1 // evaluated as `i ?: (0 + 1)`\n }\n```\n\nInspection ID: UnclearPrecedenceOfBinaryExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnclearPrecedenceOfBinaryExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Style issues", + "index": 3, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UselessCallOnNotNull", + "shortDescription": { + "text": "Useless call on not-null type" + }, + "fullDescription": { + "text": "Reports calls on not-null receiver that make sense only for nullable receiver. Several functions from the standard library such as 'orEmpty()' or 'isNullOrEmpty' have sense only when they are called on receivers of nullable types. Otherwise, they can be omitted or simplified as the result will be the same. Remove redundant call and Change call to … quick-fixes can be used to amend the code automatically. Examples: 'fun test(s: String) {\n val x = s.orEmpty() // quick-fix simplifies to 's'\n val y = s.isNullOrEmpty() // quick-fix simplifies to 's.isEmpty()'\n }' Inspection ID: UselessCallOnNotNull", + "markdown": "Reports calls on not-null receiver that make sense only for nullable receiver.\n\nSeveral functions from the standard library such as `orEmpty()` or `isNullOrEmpty`\nhave sense only when they are called on receivers of nullable types. Otherwise, they can be omitted or simplified as the result will be the same.\n\n**Remove redundant call** and **Change call to ...** quick-fixes can be used to amend the code automatically.\n\nExamples:\n\n\n fun test(s: String) {\n val x = s.orEmpty() // quick-fix simplifies to 's'\n val y = s.isNullOrEmpty() // quick-fix simplifies to 's.isEmpty()'\n }\n\nInspection ID: UselessCallOnNotNull" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UselessCallOnNotNull", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedLambdaExpressionBody", + "shortDescription": { + "text": "Unused return value of a function with lambda expression body" + }, + "fullDescription": { + "text": "Reports calls with an unused return value when the called function returns a lambda from an expression body. If there is '=' between function header and body block, code from the function will not be evaluated which can lead to incorrect behavior. Remove = token from function declaration can be used to amend the code automatically. Example: 'fun printHello() = { println(\"Hello\") }\n\n fun main() {\n printHello() // This function doesn't print anything\n }' After the quick-fix is applied: 'fun printHello() { println(\"Hello\") }\n\n fun main() {\n printHello()\n }' Inspection ID: UnusedLambdaExpressionBody", + "markdown": "Reports calls with an unused return value when the called function returns a lambda from an expression body.\n\n\nIf there is `=` between function header and body block,\ncode from the function will not be evaluated which can lead to incorrect behavior.\n\n**Remove = token from function declaration** can be used to amend the code automatically.\n\nExample:\n\n\n fun printHello() = { println(\"Hello\") }\n\n fun main() {\n printHello() // This function doesn't print anything\n }\n\nAfter the quick-fix is applied:\n\n\n fun printHello() { println(\"Hello\") }\n\n fun main() {\n printHello()\n }\n\nInspection ID: UnusedLambdaExpressionBody" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedLambdaExpressionBody", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EqualsOrHashCode", + "shortDescription": { + "text": "'equals()' and 'hashCode()' not paired" + }, + "fullDescription": { + "text": "Reports classes that override 'equals()' but do not override 'hashCode()', or vice versa. It also reports object declarations that override either 'equals()' or 'hashCode()'. This can lead to undesired behavior when a class is added to a 'Collection' Example: 'class C1 {\n override fun equals(other: Any?) = true\n }\n\n class C2 {\n override fun hashCode() = 0\n }\n\n object O1 {\n override fun equals(other: Any?) = true\n }\n\n object O2 {\n override fun hashCode() = 0\n }' The quick-fix overrides 'equals()' or 'hashCode()' for classes and deletes these methods for objects: 'class C1 {\n override fun equals(other: Any?) = true\n override fun hashCode(): Int {\n return javaClass.hashCode()\n }\n }\n\n class C2 {\n override fun hashCode() = 0\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (javaClass != other?.javaClass) return false\n return true\n }\n }\n\n object O1 {\n }\n\n object O2 {\n }' Inspection ID: EqualsOrHashCode", + "markdown": "Reports classes that override `equals()` but do not override `hashCode()`, or vice versa. It also reports object declarations that override either `equals()` or `hashCode()`.\n\nThis can lead to undesired behavior when a class is added to a `Collection`\n\n**Example:**\n\n\n class C1 {\n override fun equals(other: Any?) = true\n }\n\n class C2 {\n override fun hashCode() = 0\n }\n\n object O1 {\n override fun equals(other: Any?) = true\n }\n\n object O2 {\n override fun hashCode() = 0\n }\n\nThe quick-fix overrides `equals()` or `hashCode()` for classes and deletes these methods for objects:\n\n\n class C1 {\n override fun equals(other: Any?) = true\n override fun hashCode(): Int {\n return javaClass.hashCode()\n }\n }\n\n class C2 {\n override fun hashCode() = 0\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (javaClass != other?.javaClass) return false\n return true\n }\n }\n\n object O1 {\n }\n\n object O2 {\n }\n\nInspection ID: EqualsOrHashCode" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EqualsOrHashCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Kotlin/Probable bugs", + "index": 23, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.java", + "version": "252.28459.0", + "rules": [ + { + "id": "OverrideOnly", + "shortDescription": { + "text": "Method can only be overridden" + }, + "fullDescription": { + "text": "Reports calls to API methods marked with '@ApiStatus.OverrideOnly'. The '@ApiStatus.OverrideOnly' annotation indicates that the annotated method is supposed to be implemented or overridden by client code, but not called by it directly. This pattern commonly appears in extension mechanisms where your implementation must conform to some interface, but it's not your responsibility to call it. One example of such an extension mechanism is the Service Provider Interface. Marking a class or interface with this annotation is the same as marking every method with it. The '@ApiStatus.OverrideOnly' annotation indicates that the method is part of SPI (Service Provider Interface). Clients of the declaring library should implement or override such methods, not call them directly. Marking a class or interface with this annotation is the same as marking every method with it. Example: '// In upstream library code\n @ApiStatus.OverrideOnly\n public class MyService {\n public void perform();\n }\n\n // In downstream client code\n public class Foo {\n public void bar(myService: MyService) {\n myService.perform();\n }\n }' This inspection also detects the following problems related to applying the annotation incorrectly: Annotating classes/methods that cannot be extended/overridden Redundantly annotating methods from a class already annotated with '@ApiStatus.OverrideOnly' Inspection ID: OverrideOnly", + "markdown": "Reports calls to API methods marked with `@ApiStatus.OverrideOnly`.\n\n\nThe `@ApiStatus.OverrideOnly` annotation indicates that the annotated method is supposed to be implemented or overridden by\nclient code, but not called by it directly.\nThis pattern commonly appears in extension mechanisms where your implementation must conform to some interface, but it's not your\nresponsibility to call it.\nOne example of such an extension mechanism is the Service Provider Interface.\nMarking a class or interface with this annotation is the same as marking every method with it.\n\n\nThe `@ApiStatus.OverrideOnly` annotation indicates that the method is part of SPI (Service Provider Interface).\nClients of the declaring library should implement or override such methods, not call them directly.\nMarking a class or interface with this annotation is the same as marking every method with it.\n\n**Example:**\n\n\n // In upstream library code\n @ApiStatus.OverrideOnly\n public class MyService {\n public void perform();\n }\n\n // In downstream client code\n public class Foo {\n public void bar(myService: MyService) {\n myService.perform();\n }\n }\n\nThis inspection also detects the following problems related to applying the annotation incorrectly:\n\n* Annotating classes/methods that cannot be extended/overridden\n* Redundantly annotating methods from a class already annotated with `@ApiStatus.OverrideOnly`\n\nInspection ID: OverrideOnly" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "OverrideOnly", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RuntimeExec", + "shortDescription": { + "text": "Call to 'Runtime.exec()'" + }, + "fullDescription": { + "text": "Reports calls to 'Runtime.exec()' or any of its variants. Calls to 'Runtime.exec()' are inherently unportable. Inspection ID: RuntimeExec", + "markdown": "Reports calls to `Runtime.exec()` or any of its variants. Calls to `Runtime.exec()` are inherently unportable.\n\nInspection ID: RuntimeExec" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToRuntimeExec", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticInitializerReferencesSubClass", + "shortDescription": { + "text": "Static initializer references subclass" + }, + "fullDescription": { + "text": "Reports classes that refer to their subclasses in static initializers or static fields. Such references can cause JVM-level deadlocks in multithreaded environment, when one thread tries to load the superclass and another thread tries to load the subclass at the same time. Example: 'class Parent {\n static final Child field = new Child();\n }\n class Child extends Parent { }' Inspection ID: StaticInitializerReferencesSubClass", + "markdown": "Reports classes that refer to their subclasses in static initializers or static fields.\n\nSuch references can cause JVM-level deadlocks in multithreaded environment, when one thread tries to load the superclass\nand another thread tries to load the subclass at the same time.\n\n**Example:**\n\n\n class Parent {\n static final Child field = new Child();\n }\n class Child extends Parent { }\n\nInspection ID: StaticInitializerReferencesSubClass" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StaticInitializerReferencesSubClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingDeprecatedAnnotationOnScheduledForRemovalApi", + "shortDescription": { + "text": "Missing '@Deprecated' annotation on scheduled for removal API" + }, + "fullDescription": { + "text": "Reports declarations marked with '@ApiStatus.ScheduledForRemoval' without '@Deprecated'. Example: '@ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }' After the quick-fix is applied the result looks like: '@Deprecated\n @ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }' Inspection ID: MissingDeprecatedAnnotationOnScheduledForRemovalApi", + "markdown": "Reports declarations marked with `@ApiStatus.ScheduledForRemoval` without `@Deprecated`.\n\nExample:\n\n\n @ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }\n\nAfter the quick-fix is applied the result looks like:\n\n\n @Deprecated\n @ApiStatus.ScheduledForRemoval(inVersion = \"2017.3\")\n public void myLegacyMethod() { }\n\nInspection ID: MissingDeprecatedAnnotationOnScheduledForRemovalApi" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "MissingDeprecatedAnnotationOnScheduledForRemovalApi", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CallToSuspiciousStringMethod", + "shortDescription": { + "text": "Call to suspicious 'String' method" + }, + "fullDescription": { + "text": "Reports calls of: 'equals()' 'equalsIgnoreCase()' 'compareTo()' 'compareToIgnoreCase()' and 'trim()' on 'String' objects. Comparison of internationalized strings should probably use a 'java.text.Collator' instead. 'String.trim()' only removes control characters between 0x00 and 0x20. The 'String.strip()' method introduced in Java 11 is more Unicode aware and can be used as a replacement. Inspection ID: CallToSuspiciousStringMethod", + "markdown": "Reports calls of:\n\n* `equals()`\n* `equalsIgnoreCase()`\n* `compareTo()`\n* `compareToIgnoreCase()` and\n* `trim()`\n\n\non `String` objects.\nComparison of internationalized strings should probably use a `java.text.Collator` instead.\n`String.trim()` only removes control characters between 0x00 and 0x20.\nThe `String.strip()` method introduced in Java 11 is more Unicode aware and can be used as a replacement.\n\nInspection ID: CallToSuspiciousStringMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToSuspiciousStringMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KeySetIterationMayUseEntrySet", + "shortDescription": { + "text": "Iteration over 'keySet()' can be optimized" + }, + "fullDescription": { + "text": "Reports iterations over the 'keySet()' of a 'java.util.Map' instance, where the iterated keys are used to retrieve the values from the map. Such iteration may be more efficient when replaced with an iteration over the 'entrySet()' or 'values()' (if the key is not actually used). Similarly, 'keySet().forEach(key -> ...)' can be replaced with 'forEach((key, value) -> ...)' if values are retrieved inside a lambda. Example: 'for (Object key : map.keySet()) {\n Object val = map.get(key);\n }' After the quick-fix is applied: 'for (Object val : map.values()) {}' Inspection ID: KeySetIterationMayUseEntrySet", + "markdown": "Reports iterations over the `keySet()` of a `java.util.Map` instance, where the iterated keys are used to retrieve the values from the map.\n\n\nSuch iteration may be more efficient when replaced with an iteration over the\n`entrySet()` or `values()` (if the key is not actually used).\n\n\nSimilarly, `keySet().forEach(key -> ...)`\ncan be replaced with `forEach((key, value) -> ...)` if values are retrieved\ninside a lambda.\n\n**Example:**\n\n\n for (Object key : map.keySet()) {\n Object val = map.get(key);\n }\n\nAfter the quick-fix is applied:\n\n\n for (Object val : map.values()) {}\n\nInspection ID: KeySetIterationMayUseEntrySet" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "KeySetIterationMayUseEntrySet", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryQualifierForThis", + "shortDescription": { + "text": "Unnecessary qualifier for 'this' or 'super'" + }, + "fullDescription": { + "text": "Reports unnecessary qualification of 'this' or 'super'. Using a qualifier on 'this' or 'super' to disambiguate a code reference may easily become unnecessary via automatic refactorings and should be deleted for clarity. Example: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n Bar.super.foo();\n }\n }' After the quick-fix is applied: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }' Inspection ID: UnnecessaryQualifierForThis", + "markdown": "Reports unnecessary qualification of `this` or `super`.\n\n\nUsing a qualifier on `this` or `super` to\ndisambiguate a code reference may easily become unnecessary via automatic refactorings and should be deleted for clarity.\n\n**Example:**\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n Bar.super.foo();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }\n\nInspection ID: UnnecessaryQualifierForThis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryQualifierForThis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantDeclaredInAbstractClass", + "shortDescription": { + "text": "Constant declared in 'abstract' class" + }, + "fullDescription": { + "text": "Reports constants ('public static final' fields) declared in abstract classes. Some coding standards require declaring constants in interfaces instead. Inspection ID: ConstantDeclaredInAbstractClass", + "markdown": "Reports constants (`public static final` fields) declared in abstract classes.\n\nSome coding standards require declaring constants in interfaces instead.\n\nInspection ID: ConstantDeclaredInAbstractClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantDeclaredInAbstractClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SubtractionInCompareTo", + "shortDescription": { + "text": "Subtraction in 'compareTo()'" + }, + "fullDescription": { + "text": "Reports subtraction in 'compareTo()' methods and methods implementing 'java.util.Comparator.compare()'. While it is a common idiom to use the results of integer subtraction as the result of a 'compareTo()' method, this construct may cause subtle and difficult bugs in cases of integer overflow. Comparing the integer values directly and returning '-1', '0', or '1' is a better practice in most cases. Subtraction on floating point values that is immediately cast to integral type is also reported because precision loss is possible due to rounding. The inspection doesn't report when it's statically determined that value ranges are limited, and overflow never occurs. Additionally, subtraction on 'int' numbers greater than or equal to '0' will never overflow. Therefore, this inspection tries not to warn in those cases. Methods that always return zero or greater can be marked with the 'javax.annotation.Nonnegative' annotation or specified in this inspection's options. Example: 'class DoubleHolder implements Comparable {\n double d;\n public int compareTo(DoubleHolder that) {\n return (int)(this.d - that.d);\n }\n }' A no-warning example because 'String.length()' is known to be non-negative: 'class A implements Comparable {\n final String s = \"\";\n public int compareTo(A a) {\n return s.length() - a.s.length();\n }\n }' Use the options to list methods that are safe to use inside a subtraction. Methods are safe when they return an 'int' value that is always greater than or equal to '0'. Inspection ID: SubtractionInCompareTo", + "markdown": "Reports subtraction in `compareTo()` methods and methods implementing `java.util.Comparator.compare()`.\n\n\nWhile it is a common idiom to\nuse the results of integer subtraction as the result of a `compareTo()`\nmethod, this construct may cause subtle and difficult bugs in cases of integer overflow.\nComparing the integer values directly and returning `-1`, `0`, or `1` is a better practice in most cases.\n\n\nSubtraction on floating point values that is immediately cast to integral type is also reported because precision loss is possible due to\nrounding.\n\n\nThe inspection doesn't report when it's statically determined that value ranges are limited, and overflow never occurs.\nAdditionally, subtraction on `int` numbers greater than or equal to `0` will never overflow.\nTherefore, this inspection tries not to warn in those cases.\n\n\nMethods that always return zero or greater can be marked with the\n`javax.annotation.Nonnegative` annotation or specified in this inspection's options.\n\n**Example:**\n\n\n class DoubleHolder implements Comparable {\n double d;\n public int compareTo(DoubleHolder that) {\n return (int)(this.d - that.d);\n }\n }\n\nA no-warning example because `String.length()` is known to be non-negative:\n\n\n class A implements Comparable {\n final String s = \"\";\n public int compareTo(A a) {\n return s.length() - a.s.length();\n }\n }\n\n\nUse the options to list methods that are safe to use inside a subtraction.\nMethods are safe when they return an `int` value that is always greater than or equal to `0`.\n\nInspection ID: SubtractionInCompareTo" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SubtractionInCompareTo", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedReturnValue", + "shortDescription": { + "text": "Method can be made 'void'" + }, + "fullDescription": { + "text": "Reports methods whose return values are never used when called. The return type of such methods can be made 'void'. Methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation will not be reported. The quick-fix updates the method signature and removes 'return' statements from inside the method. Example: '// reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }' After the quick-fix is applied to both methods: 'protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...' NOTE: Some methods might not be reported during in-editor highlighting due to performance reasons. To see all results, run the inspection using Code | Inspect Code or Code | Analyze Code | Run Inspection by Name> Use the Ignore chainable methods option to ignore unused return values from chainable calls. Use the Maximal reported method visibility option to control the maximum visibility of methods to be reported. Inspection ID: UnusedReturnValue", + "markdown": "Reports methods whose return values are never used when called. The return type of such methods can be made `void`.\n\nMethods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\nThe quick-fix updates the method signature and removes `return` statements from inside the method.\n\n**Example:**\n\n\n // reported if visibility setting is Protected or Public\n protected String myToUpperCase(String s) {\n return s.toUpperCase();\n }\n\n // simple setter, reporting depends on setting\n public String setStr(String str) {\n myStr = str;\n return myStr;\n }\n\n void test() {\n setStr(\"value\"); // return value is unused\n myToUpperCase(\"result\"); // return value is unused\n }\n\nAfter the quick-fix is applied to both methods:\n\n\n protected void myToUpperCase(String s) {\n // 'return' removed completely\n // as 's.toUpperCase()' has no side effect\n }\n\n public void setStr(String str) {\n myStr = str;\n // 'return' removed\n }\n ...\n\n\n**NOTE:** Some methods might not be reported during in-editor highlighting due to performance reasons.\nTo see all results, run the inspection using **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**\\>\n\nUse the **Ignore chainable methods** option to ignore unused return values from chainable calls.\n\nUse the **Maximal reported method visibility** option to control the maximum visibility of methods to be reported.\n\nInspection ID: UnusedReturnValue" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedReturnValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UncheckedExceptionClass", + "shortDescription": { + "text": "Unchecked 'Exception' class" + }, + "fullDescription": { + "text": "Reports subclasses of 'java.lang.RuntimeException'. Some coding standards require that all user-defined exception classes are checked. Example: 'class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException'' Inspection ID: UncheckedExceptionClass", + "markdown": "Reports subclasses of `java.lang.RuntimeException`.\n\nSome coding standards require that all user-defined exception classes are checked.\n\n**Example:**\n\n\n class EnigmaException extends RuntimeException {} // warning: Unchecked exception class 'EnigmaException'\n\nInspection ID: UncheckedExceptionClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UncheckedExceptionClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SizeReplaceableByIsEmpty", + "shortDescription": { + "text": "'size() == 0' can be replaced with 'isEmpty()'" + }, + "fullDescription": { + "text": "Reports '.size()' or '.length()' comparisons with a '0' literal that can be replaced with a call to '.isEmpty()'. Example: 'boolean emptyList = list.size() == 0;' After the quick-fix is applied: 'boolean emptyList = list.isEmpty();' Use the Ignored classes table to add classes for which any '.size()' or '.length()' comparisons should not be replaced. Use the Ignore expressions which would be replaced with '!isEmpty()' option to ignore any expressions which would be replaced with '!isEmpty()'. Inspection ID: SizeReplaceableByIsEmpty", + "markdown": "Reports `.size()` or `.length()` comparisons with a `0` literal that can be replaced with a call to `.isEmpty()`.\n\n**Example:**\n\n\n boolean emptyList = list.size() == 0;\n\nAfter the quick-fix is applied:\n\n\n boolean emptyList = list.isEmpty();\n \n\nUse the **Ignored classes** table to add classes for which any `.size()` or `.length()` comparisons should not be replaced.\n\nUse the **Ignore expressions which would be replaced with `!isEmpty()`** option to ignore any expressions which would be replaced with `!isEmpty()`.\n\nInspection ID: SizeReplaceableByIsEmpty" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SizeReplaceableByIsEmpty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnsupportedChronoFieldUnitCall", + "shortDescription": { + "text": "Call methods with unsupported 'java.time.temporal.ChronoUnit' and 'java.time.temporal.ChronoField'" + }, + "fullDescription": { + "text": "Reports 'java.time' method calls ('get()', 'getLong()', 'with()', 'plus()', 'minus()') with unsupported 'java.time.temporal.ChronoField' or 'java.time.temporal.ChronoUnit' enum constants as arguments. Such calls will throw a 'UnsupportedTemporalTypeException' at runtime. Example: 'LocalTime localTime = LocalTime.now();\nint year = localTime.get(ChronoField.YEAR);' Inspection ID: UnsupportedChronoFieldUnitCall New in 2023.2", + "markdown": "Reports `java.time` method calls (`get()`, `getLong()`, `with()`, `plus()`, `minus()`) with unsupported `java.time.temporal.ChronoField` or `java.time.temporal.ChronoUnit` enum constants as arguments. Such calls will throw a `UnsupportedTemporalTypeException` at runtime.\n\nExample:\n\n\n LocalTime localTime = LocalTime.now();\n int year = localTime.get(ChronoField.YEAR);\n\nInspection ID: UnsupportedChronoFieldUnitCall\n\nNew in 2023.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnsupportedChronoFieldUnitCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NumberEquality", + "shortDescription": { + "text": "Number comparison using '==', instead of 'equals()'" + }, + "fullDescription": { + "text": "Reports code that uses == or != instead of 'equals()' to test for 'Number' equality. With auto-boxing, it is easy to make the mistake of comparing two instances of a wrapper type instead of two primitives, for example 'Integer' instead of 'int'. Example: 'void foo(Integer a, Integer b) {\n final boolean bool = a == b;\n }' If 'a' is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following: 'void foo(Integer a, Integer b) {\n final boolean bool = a.equals(b);\n }' Inspection ID: NumberEquality", + "markdown": "Reports code that uses **==** or **!=** instead of `equals()` to test for `Number` equality.\n\n\nWith auto-boxing, it is easy\nto make the mistake of comparing two instances of a wrapper type instead of two primitives, for example `Integer` instead of\n`int`.\n\n**Example:**\n\n void foo(Integer a, Integer b) {\n final boolean bool = a == b;\n }\n\nIf `a` is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following:\n\n void foo(Integer a, Integer b) {\n final boolean bool = a.equals(b);\n }\n\n\nInspection ID: NumberEquality" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NumberEquality", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComparatorNotSerializable", + "shortDescription": { + "text": "'Comparator' class not declared 'Serializable'" + }, + "fullDescription": { + "text": "Reports classes that implement 'java.lang.Comparator', but do not implement 'java.io.Serializable'. If a non-serializable comparator is used to construct an ordered collection such as a 'java.util.TreeMap' or 'java.util.TreeSet', then the collection will also be non-serializable. This can result in unexpected and difficult-to-diagnose bugs. Since subclasses of 'java.lang.Comparator' are often stateless, simply marking them serializable is a small cost to avoid such issues. Example: 'class Foo implements Comparator { // warning\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }' After the quick-fix is applied: 'class Foo implements Comparator, Serializable { // no warning here\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }' Inspection ID: ComparatorNotSerializable", + "markdown": "Reports classes that implement `java.lang.Comparator`, but do not implement `java.io.Serializable`.\n\n\nIf a non-serializable comparator is used to construct an ordered collection such\nas a `java.util.TreeMap` or `java.util.TreeSet`, then the\ncollection will also be non-serializable. This can result in unexpected and\ndifficult-to-diagnose bugs.\n\n\nSince subclasses of `java.lang.Comparator` are often stateless,\nsimply marking them serializable is a small cost to avoid such issues.\n\n**Example:**\n\n\n class Foo implements Comparator { // warning\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Comparator, Serializable { // no warning here\n @Override\n public int compare(Object o1, Object o2) {\n /* ... */\n }\n }\n\nInspection ID: ComparatorNotSerializable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ComparatorNotSerializable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithOnlyPrivateConstructors", + "shortDescription": { + "text": "Class with only 'private' constructors should be declared 'final'" + }, + "fullDescription": { + "text": "Reports classes with only 'private' constructors. A class that only has 'private' constructors cannot be extended outside a file and should be declared as 'final'. Inspection ID: ClassWithOnlyPrivateConstructors", + "markdown": "Reports classes with only `private` constructors.\n\nA class that only has `private` constructors cannot be extended outside a file and should be declared as `final`.\n\nInspection ID: ClassWithOnlyPrivateConstructors" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithOnlyPrivateConstructors", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConnectionResource", + "shortDescription": { + "text": "Connection opened but not safely closed" + }, + "fullDescription": { + "text": "Reports Java ME 'javax.microedition.io.Connection' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. Example: 'void example() throws IOException {\n Connection c = Connector.open(\"foo\");\n }' Inspection ID: ConnectionResource", + "markdown": "Reports Java ME `javax.microedition.io.Connection` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n**Example:**\n\n\n void example() throws IOException {\n Connection c = Connector.open(\"foo\");\n }\n\nInspection ID: ConnectionResource" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConnectionOpenedButNotSafelyClosed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UNUSED_IMPORT", + "shortDescription": { + "text": "Unused import" + }, + "fullDescription": { + "text": "Reports redundant 'import' statements. Regular 'import' statements are unnecessary when not using imported classes and packages in the source file. The same applies to imported 'static' fields and methods that aren't used in the source file. Example: 'import java.util.ArrayList;\n public class Example {\n public static void main(String[] args) {\n System.out.println(\"Hello World!\");\n }\n }' After the quick fix is applied: 'public class Example {\n public static void main(String[] args) {\n System.out.println(\"Hello World!\");\n }\n }' Inspection ID: UNUSED_IMPORT", + "markdown": "Reports redundant `import` statements.\n\nRegular `import` statements are unnecessary when not using imported classes and packages in the source file.\nThe same applies to imported `static` fields and methods that aren't used in the source file.\n\n**Example:**\n\n\n import java.util.ArrayList;\n public class Example {\n public static void main(String[] args) {\n System.out.println(\"Hello World!\");\n }\n }\n\nAfter the quick fix is applied:\n\n\n public class Example {\n public static void main(String[] args) {\n System.out.println(\"Hello World!\");\n }\n }\n\nInspection ID: UNUSED_IMPORT" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UNUSED_IMPORT", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Imports", + "index": 21, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BooleanVariableAlwaysNegated", + "shortDescription": { + "text": "Boolean variable is always inverted" + }, + "fullDescription": { + "text": "Reports boolean variables or fields which are always negated when their value is used. Example: 'void m() {\n boolean b = true; //boolean variable 'b' is always inverted\n System.out.println(!b);\n }' Inspection ID: BooleanVariableAlwaysNegated", + "markdown": "Reports boolean variables or fields which are always negated when their value is used.\n\nExample:\n\n\n void m() {\n boolean b = true; //boolean variable 'b' is always inverted\n System.out.println(!b);\n }\n\nInspection ID: BooleanVariableAlwaysNegated" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BooleanVariableAlwaysNegated", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Data flow", + "index": 22, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldAccessedSynchronizedAndUnsynchronized", + "shortDescription": { + "text": "Field accessed in both 'synchronized' and unsynchronized contexts" + }, + "fullDescription": { + "text": "Reports non-final fields that are accessed in both 'synchronized' and non-'synchronized' contexts. 'volatile' fields as well as accesses in constructors and initializers are ignored by this inspection. Such \"partially synchronized\" access is often the result of a coding oversight and may lead to unexpectedly inconsistent data structures. Example: 'public class Program {\n Console console; // warning: Field 'console' is accessed in both synchronized and unsynchronized contexts\n\n public synchronized void execute() {\n console.print(\"running\");\n }\n\n public void check() {\n console.check();\n }\n }'\n Use the option to specify if simple getters and setters are counted as accesses too. Inspection ID: FieldAccessedSynchronizedAndUnsynchronized", + "markdown": "Reports non-final fields that are accessed in both `synchronized` and non-`synchronized` contexts. `volatile` fields as well as accesses in constructors and initializers are ignored by this inspection.\n\n\nSuch \"partially synchronized\" access is often the result of a coding oversight\nand may lead to unexpectedly inconsistent data structures.\n\n**Example:**\n\n\n public class Program {\n Console console; // warning: Field 'console' is accessed in both synchronized and unsynchronized contexts\n\n public synchronized void execute() {\n console.print(\"running\");\n }\n\n public void check() {\n console.check();\n }\n }\n\n\nUse the option to specify if simple getters and setters are counted as accesses too.\n\n\nInspection ID: FieldAccessedSynchronizedAndUnsynchronized" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FieldAccessedSynchronizedAndUnsynchronized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExtendsAnnotation", + "shortDescription": { + "text": "Class extends annotation interface" + }, + "fullDescription": { + "text": "Reports classes declared as an implementation or extension of an annotation interface. While it is legal to extend an annotation interface, it is often done by accident, and the result can't be used as an annotation. This inspection depends on the Java feature 'Annotations', which is available since Java 5. Inspection ID: ExtendsAnnotation", + "markdown": "Reports classes declared as an implementation or extension of an annotation interface.\n\nWhile it is legal to extend an annotation interface, it is often done by accident,\nand the result can't be used as an annotation.\n\nThis inspection depends on the Java feature 'Annotations', which is available since Java 5.\n\nInspection ID: ExtendsAnnotation" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ClassExplicitlyAnnotation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RemoveLiteralUnderscores", + "shortDescription": { + "text": "Underscores in numeric literal" + }, + "fullDescription": { + "text": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level. The quick-fix removes underscores from numeric literals. For example '1_000_000' will be converted to '1000000'. Numeric literals with underscores appeared in Java 7. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: RemoveLiteralUnderscores New in 2020.2", + "markdown": "Reports numeric literals with underscores and suggests removing them with a quick-fix. This may be useful if you need to lower the language level.\n\nThe quick-fix removes underscores from numeric literals. For example `1_000_000` will be converted to `1000000`.\n\n\n*Numeric literals with underscores* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: RemoveLiteralUnderscores\n\nNew in 2020.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RemoveLiteralUnderscores", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NegatedEqualityExpression", + "shortDescription": { + "text": "Negated equality expression" + }, + "fullDescription": { + "text": "Reports equality expressions which are negated by a prefix expression. Such expressions can be simplified using the '!=' operator. Example: '!(i == 1)' After the quick-fix is applied: 'i != 1' Inspection ID: NegatedEqualityExpression", + "markdown": "Reports equality expressions which are negated by a prefix expression.\n\nSuch expressions can be simplified using the `!=` operator.\n\nExample:\n\n\n !(i == 1)\n\nAfter the quick-fix is applied:\n\n\n i != 1\n\n\nInspection ID: NegatedEqualityExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NegatedEqualityExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MathRandomCastToInt", + "shortDescription": { + "text": "'Math.random()' cast to 'int'" + }, + "fullDescription": { + "text": "Reports calls to 'Math.random()' which are immediately cast to 'int'. Casting a 'double' between '0.0' (inclusive) and '1.0' (exclusive) to 'int' will always round down to zero. The value should first be multiplied by some factor before casting it to an 'int' to get a value between zero (inclusive) and the multiplication factor (exclusive). Another possible solution is to use the 'nextInt()' method of 'java.util.Random'. Example: 'int r = (int)Math.random() * 10;' After the quick fix is applied: 'int r = (int)(Math.random() * 10);' Inspection ID: MathRandomCastToInt", + "markdown": "Reports calls to `Math.random()` which are immediately cast to `int`.\n\nCasting a `double` between `0.0` (inclusive) and\n`1.0` (exclusive) to `int` will always round down to zero. The value\nshould first be multiplied by some factor before casting it to an `int` to\nget a value between zero (inclusive) and the multiplication factor (exclusive).\nAnother possible solution is to use the `nextInt()` method of\n`java.util.Random`.\n\n**Example:**\n\n int r = (int)Math.random() * 10;\n\nAfter the quick fix is applied:\n\n int r = (int)(Math.random() * 10);\n\nInspection ID: MathRandomCastToInt" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MathRandomCastToInt", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DoubleBraceInitialization", + "shortDescription": { + "text": "Double brace initialization" + }, + "fullDescription": { + "text": "Reports Double Brace Initialization. Compared to regular initialization, double brace initialization provides worse performance since it requires loading an additional class. It may also cause failure of 'equals()' comparisons if the 'equals()' method doesn't accept subclasses as parameters. Double brace initialization may cause memory leaks when used in a non-static context. This is because it defines an anonymous class that will reference the surrounding object, when compiled with javac from before Java 18. In addition, before Java 9, double brace initialization couldn't be combined with the diamond operator since it was incompatible with anonymous classes. Example: 'List list = new ArrayList<>() {{\n add(1);\n add(2);\n }};' After the quick-fix is applied: 'List list = new ArrayList<>();\n list.add(1);\n list.add(2);' Inspection ID: DoubleBraceInitialization", + "markdown": "Reports [Double Brace Initialization](https://www.c2.com/cgi/wiki?DoubleBraceInitialization).\n\nCompared to regular initialization, double brace initialization provides worse performance since it requires loading an\nadditional class.\n\nIt may also cause failure of `equals()` comparisons if the `equals()` method doesn't accept subclasses as\nparameters.\n\nDouble brace initialization may cause memory leaks when used in a non-static context. This is because it defines an anonymous class\nthat will reference the surrounding object, when compiled with javac from before Java 18.\n\nIn addition, before Java 9, double brace initialization couldn't be combined with the diamond operator since it was incompatible\nwith anonymous classes.\n\n**Example:**\n\n\n List list = new ArrayList<>() {{\n add(1);\n add(2);\n }};\n\nAfter the quick-fix is applied:\n\n\n List list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\nInspection ID: DoubleBraceInitialization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "DoubleBraceInitialization", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "unused", + "shortDescription": { + "text": "Unused declaration" + }, + "fullDescription": { + "text": "Reports classes, methods, or fields that are not used or unreachable from the entry points. An entry point can be a main method, tests, classes from outside the specified scope, classes accessible from 'module-info.java', and so on. It is possible to configure custom entry points by using name patterns or annotations. Example: 'public class Department {\n private Organization myOrganization;\n }' In this example, 'Department' explicitly references 'Organization' but if 'Department' class itself is unused, then inspection will report both classes. The inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local variables that are declared but not used. Note: Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is checked only when its name rarely occurs in the project. To see all results, run the inspection by selecting Code | Inspect Code or Code | Analyze Code | Run Inspection by Name from the main menu. Use the visibility settings below to configure members to be reported. For example, configuring report 'private' methods only means that 'public' methods of 'private' inner class will be reported but 'protected' methods of top level class will be ignored. Use the entry points tab to configure entry points to be considered during the inspection run. You can add entry points manually when inspection results are ready. If your code uses unsupported frameworks, there are several options: If the framework relies on annotations, use the Annotations... button to configure the framework's annotations. If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework. This way the annotated code accessible by the framework internals will be treated as used. Inspection ID: unused", + "markdown": "Reports classes, methods, or fields that are not used or unreachable from the entry points.\n\nAn entry point can be a main method, tests, classes from outside the specified scope, classes accessible from\n`module-info.java`, and so on. It is possible to configure custom entry points by using name patterns or annotations.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nIn this example, `Department` explicitly references `Organization` but if `Department` class itself is unused, then inspection will report both classes.\n\n\nThe inspection also reports parameters that are not used by their methods and all method implementations and overriders, as well as local\nvariables that are declared but not used.\n\n\n**Note:** Some unused members may not be reported during in-editor code highlighting. For performance reasons, a non-private member is\nchecked only when its name rarely occurs in the project.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the visibility settings below to configure members to be reported. For example, configuring report `private` methods only means\nthat `public` methods of `private` inner class will be reported but `protected` methods of top level class\nwill be ignored.\n\n\nUse the **entry points** tab to configure entry points to be considered during the inspection run.\n\nYou can add entry points manually when inspection results are ready.\n\nIf your code uses unsupported frameworks, there are several options:\n\n* If the framework relies on annotations, use the **Annotations...** button to configure the framework's annotations.\n* If the framework doesn't rely on annotations, try to configure class name patterns that are expected by the framework.\n\nThis way the annotated code accessible by the framework internals will be treated as used.\n\nInspection ID: unused" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "unused", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringConcatenationInLoops", + "shortDescription": { + "text": "String concatenation in loop" + }, + "fullDescription": { + "text": "Reports String concatenation in loops. As every String concatenation copies the whole string, usually it is preferable to replace it with explicit calls to 'StringBuilder.append()' or 'StringBuffer.append()'. Example: 'String str = \"\";\n for(int i=0; i<10; i++) {\n str += i;\n }' After the quick-fix is applied: 'String str = \"\";\n StringBuilder strBuilder = new StringBuilder(str);\n for(int i = 0; i<10; i++) {\n strBuilder.append(i);\n }\n str = strBuilder.toString();' Sometimes, the quick-fixes allow you to convert a 'String' variable to a 'StringBuilder' or introduce a new 'StringBuilder'. Be careful if the original code specially handles the 'null' value, as the replacement may change semantics. If 'null' is possible, null-safe fixes that generate necessary null-checks are suggested. Also, it's not guaranteed that the automatic replacement will always be more performant. Inspection ID: StringConcatenationInLoops", + "markdown": "Reports String concatenation in loops.\n\n\nAs every String concatenation copies the whole\nstring, usually it is preferable to replace it with explicit calls to `StringBuilder.append()` or\n`StringBuffer.append()`.\n\n**Example:**\n\n\n String str = \"\";\n for(int i=0; i<10; i++) {\n str += i;\n }\n\nAfter the quick-fix is applied:\n\n\n String str = \"\";\n StringBuilder strBuilder = new StringBuilder(str);\n for(int i = 0; i<10; i++) {\n strBuilder.append(i);\n }\n str = strBuilder.toString();\n\n\nSometimes, the quick-fixes allow you to convert a `String` variable to a `StringBuilder` or\nintroduce a new `StringBuilder`. Be careful if the original code specially handles the `null` value, as the\nreplacement may change semantics. If `null` is possible, null-safe fixes that generate\nnecessary null-checks are suggested. Also, it's not guaranteed that the automatic replacement will always be more performant.\n\nInspection ID: StringConcatenationInLoops" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringConcatenationInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CloneableClassInSecureContext", + "shortDescription": { + "text": "Cloneable class in secure context" + }, + "fullDescription": { + "text": "Reports classes which may be cloned. A class may be cloned if it supports the 'Cloneable' interface, and its 'clone()' method is not defined to immediately throw an error. Cloneable classes may be dangerous in code intended for secure use. Example: 'class SecureBean implements Cloneable {}' After the quick-fix is applied: 'class SecureBean {}' When the class extends an existing cloneable class or implements a cloneable interface, then after the quick-fix is applied, the code may look like: 'class SecureBean extends ParentBean {\n @Override\n protected SecureBean clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }\n}' Inspection ID: CloneableClassInSecureContext", + "markdown": "Reports classes which may be cloned.\n\n\nA class\nmay be cloned if it supports the `Cloneable` interface,\nand its `clone()` method is not defined to immediately\nthrow an error. Cloneable classes may be dangerous in code intended for secure use.\n\n**Example:**\n`class SecureBean implements Cloneable {}`\n\nAfter the quick-fix is applied:\n`class SecureBean {}`\n\n\nWhen the class extends an existing cloneable class or implements a cloneable interface,\nthen after the quick-fix is applied, the code may look like:\n\n class SecureBean extends ParentBean {\n @Override\n protected SecureBean clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }\n }\n\n\nInspection ID: CloneableClassInSecureContext" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CloneableClassInSecureContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InconsistentTextBlockIndent", + "shortDescription": { + "text": "Inconsistent whitespace indentation in text block" + }, + "fullDescription": { + "text": "Reports text blocks that are indented using both space and tab characters. This can produce unexpected results because spaces and tabs are treated equally by javac's text block processing. In the following example, spaces and tabs are visualized as '·' and '␉' respectively, and a tab is equal to 2 spaces in the editor. Example: 'String colors = \"\"\"\n····red\n␉ ␉ green\n····blue\"\"\";' When printing such a string, the result will be: '··red\ngreen\n··blue' After the compiler removes an equal number of whitespace characters from the beginning of each line, some lines remain with leading spaces. This inspection depends on the Java feature 'Text block literals', which is available since Java 15. Inspection ID: InconsistentTextBlockIndent New in 2021.1", + "markdown": "Reports text blocks that are indented using both space and tab characters. This can produce unexpected results because spaces and tabs are treated equally by javac's text block processing.\n\nIn the following example, spaces and tabs are visualized as `·` and `␉` respectively,\nand a tab is equal to 2 spaces in the editor.\n\n**Example:**\n\n\n String colors = \"\"\"\n ····red\n ␉ ␉ green\n ····blue\"\"\";\n\nWhen printing such a string, the result will be:\n\n\n ··red\n green\n ··blue\n\nAfter the compiler removes an equal number of whitespace characters from the beginning of each line,\nsome lines remain with leading spaces.\n\nThis inspection depends on the Java feature 'Text block literals', which is available since Java 15.\n\nInspection ID: InconsistentTextBlockIndent\n\nNew in 2021.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InconsistentTextBlockIndent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousGetterSetter", + "shortDescription": { + "text": "Suspicious getter/setter" + }, + "fullDescription": { + "text": "Reports getter or setter methods that access a field that is not expected by its name. For example, when 'getY()' returns the 'x' field. Usually, it might be a copy-paste error. Example: 'class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }' Use the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter. Inspection ID: SuspiciousGetterSetter", + "markdown": "Reports getter or setter methods that access a field that is not expected by its name. For example, when `getY()` returns the `x` field. Usually, it might be a copy-paste error.\n\n**Example:**\n\n class Point {\n private int x;\n private int y;\n\n public void setX(int x) { // Warning: setter 'setX()' assigns field 'y'\n this.y = x;\n }\n\n public int getY() { // Warning: getter 'getY()' returns field 'x'\n return x;\n }\n }\n\n\nUse the checkbox below to report situations when a field in the class has a name that matches a name of a getter or a setter.\n\n\nInspection ID: SuspiciousGetterSetter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousGetterSetter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/JavaBeans issues", + "index": 35, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MismatchedStringCase", + "shortDescription": { + "text": "Mismatched case in 'String' operation" + }, + "fullDescription": { + "text": "Reports 'String' method calls that always return the same value ('-1' or 'false') because a lowercase character is searched in an uppercase-only string or vice versa. Reported methods include 'equals', 'startsWith', 'endsWith', 'contains', 'indexOf', and 'lastIndexOf'. Example: if (columnName.toLowerCase().equals(\"ID\")) {...}\n Inspection ID: MismatchedStringCase New in 2019.3", + "markdown": "Reports `String` method calls that always return the same value (`-1` or `false`) because a lowercase character is searched in an uppercase-only string or vice versa.\n\nReported methods include `equals`, `startsWith`, `endsWith`, `contains`,\n`indexOf`, and `lastIndexOf`.\n\n**Example:**\n\n```\n if (columnName.toLowerCase().equals(\"ID\")) {...}\n```\n\nInspection ID: MismatchedStringCase\n\nNew in 2019.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MismatchedStringCase", + "cweIds": [ + 597 + ], + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssertionCanBeIf", + "shortDescription": { + "text": "Assertion can be replaced with 'if' statement" + }, + "fullDescription": { + "text": "Reports 'assert' statements and suggests replacing them with 'if' statements that throw 'java.lang.AssertionError'. Example: 'assert param != null;' After the quick-fix is applied: 'if (param == null) throw new AssertionError();' This inspection depends on the Java feature 'Assertions', which is available since Java 1.4. Inspection ID: AssertionCanBeIf", + "markdown": "Reports `assert` statements and suggests replacing them with `if` statements that throw `java.lang.AssertionError`.\n\nExample:\n\n\n assert param != null;\n\nAfter the quick-fix is applied:\n\n\n if (param == null) throw new AssertionError();\n\nThis inspection depends on the Java feature 'Assertions', which is available since Java 1.4.\n\nInspection ID: AssertionCanBeIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "AssertionCanBeIf", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DoubleNegation", + "shortDescription": { + "text": "Double negation" + }, + "fullDescription": { + "text": "Reports double negations that can be simplified. Example: 'if (!!functionCall()) {}' After the quick-fix is applied: 'if (functionCall()) {}' Example: 'if (!(a != b)) {}' After the quick-fix is applied: 'if (a == b) {}' Inspection ID: DoubleNegation", + "markdown": "Reports double negations that can be simplified.\n\nExample:\n\n\n if (!!functionCall()) {}\n\nAfter the quick-fix is applied:\n\n\n if (functionCall()) {}\n\nExample:\n\n\n if (!(a != b)) {}\n\nAfter the quick-fix is applied:\n\n\n if (a == b) {}\n\n\nInspection ID: DoubleNegation" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DoubleNegation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToNull", + "shortDescription": { + "text": "'null' assignment" + }, + "fullDescription": { + "text": "Reports variables that are assigned to 'null' outside a declaration. The main purpose of 'null' in Java is to denote uninitialized reference variables. In rare cases, assigning a variable explicitly to 'null' is useful to aid garbage collection. However, using 'null' to denote a missing, not specified, or invalid value or a not found element is considered bad practice and may make your code more prone to 'NullPointerExceptions'. Instead, consider defining a sentinel object with the intended semantics or use library types like 'Optional' to denote the absence of a value. Example: 'Integer convert(String s) {\n Integer value;\n try {\n value = Integer.parseInt(s);\n } catch (NumberFormatException e) {\n // Warning: null is used to denote an 'invalid value'\n value = null;\n }\n return value;\n }' Use the Ignore assignments to fields option to ignore assignments to fields. Inspection ID: AssignmentToNull", + "markdown": "Reports variables that are assigned to `null` outside a declaration.\n\nThe main purpose of `null` in Java is to denote uninitialized\nreference variables. In rare cases, assigning a variable explicitly to `null`\nis useful to aid garbage collection. However, using `null` to denote a missing, not specified, or invalid value or a not\nfound element is considered bad practice and may make your code more prone to `NullPointerExceptions`.\nInstead, consider defining a sentinel object with the intended semantics\nor use library types like `Optional` to denote the absence of a value.\n\n**Example:**\n\n\n Integer convert(String s) {\n Integer value;\n try {\n value = Integer.parseInt(s);\n } catch (NumberFormatException e) {\n // Warning: null is used to denote an 'invalid value'\n value = null;\n }\n return value;\n }\n\n\nUse the **Ignore assignments to fields** option to ignore assignments to fields.\n\nInspection ID: AssignmentToNull" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToNull", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageWithTooFewClasses", + "shortDescription": { + "text": "Package with too few classes" + }, + "fullDescription": { + "text": "Reports packages that contain fewer classes than the specified minimum. Packages which contain subpackages are not reported. Overly small packages may indicate a fragmented design. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Minimum number of classes field to specify the minimum allowed number of classes in a package. Inspection ID: PackageWithTooFewClasses", + "markdown": "Reports packages that contain fewer classes than the specified minimum.\n\nPackages which contain subpackages are not reported. Overly small packages may indicate a fragmented design.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Minimum number of classes** field to specify the minimum allowed number of classes in a package.\n\nInspection ID: PackageWithTooFewClasses" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PackageWithTooFewClasses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Packaging issues", + "index": 38, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceOnLiteralHasNoEffect", + "shortDescription": { + "text": "Replacement operation has no effect" + }, + "fullDescription": { + "text": "Reports calls to the 'String' methods 'replace()', 'replaceAll()' or 'replaceFirst()' that have no effect. Such calls can be guaranteed to have no effect when the qualifier and search string are compile-time constants and the search string is not found in the qualifier. This is redundant and may indicate an error. Example: '// replacement does nothing\n \"hello\".replace(\"$value$\", value);' Inspection ID: ReplaceOnLiteralHasNoEffect New in 2022.1", + "markdown": "Reports calls to the `String` methods `replace()`, `replaceAll()` or `replaceFirst()` that have no effect. Such calls can be guaranteed to have no effect when the qualifier and search string are compile-time constants and the search string is not found in the qualifier. This is redundant and may indicate an error.\n\n**Example:**\n\n\n // replacement does nothing\n \"hello\".replace(\"$value$\", value);\n\nInspection ID: ReplaceOnLiteralHasNoEffect\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReplaceOnLiteralHasNoEffect", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WaitCalledOnCondition", + "shortDescription": { + "text": "'wait()' called on 'java.util.concurrent.locks.Condition' object" + }, + "fullDescription": { + "text": "Reports calls to 'wait()' made on a 'java.util.concurrent.locks.Condition' object. This is probably a programming error, and some variant of the 'await()' method was intended instead. Example: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }' Good code would look like this: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }' Inspection ID: WaitCalledOnCondition", + "markdown": "Reports calls to `wait()` made on a `java.util.concurrent.locks.Condition` object. This is probably a programming error, and some variant of the `await()` method was intended instead.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.wait();\n }\n }\n\nGood code would look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n\nInspection ID: WaitCalledOnCondition" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WaitCalledOnCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SingleClassImport", + "shortDescription": { + "text": "Single class import" + }, + "fullDescription": { + "text": "Reports 'import' statements that import single classes (as opposed to entire packages). Some coding standards prohibit such 'import' statements. You can configure IntelliJ IDEA to detect and fix such statements with its Optimize Imports command. Go to Settings | Editor | Code Style | Java | Imports and clear the Use single class import checkbox. Thus this inspection is mostly useful for offline reporting on code bases that you don't intend to change. Inspection ID: SingleClassImport", + "markdown": "Reports `import` statements that import single classes (as opposed to entire packages).\n\nSome coding standards prohibit such `import` statements.\n\n\nYou can configure IntelliJ IDEA to detect and fix such statements with its **Optimize Imports** command. Go to\n[Settings \\| Editor \\| Code Style \\| Java \\| Imports](settings://preferences.sourceCode.Java?Use%20single%20class%20import)\nand clear the **Use single class import** checkbox. Thus this inspection is mostly useful for\noffline reporting on code bases that you don't intend to change.\n\nInspection ID: SingleClassImport" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SingleClassImport", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Imports", + "index": 21, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonSynchronizedMethodOverridesSynchronizedMethod", + "shortDescription": { + "text": "Unsynchronized method overrides 'synchronized' method" + }, + "fullDescription": { + "text": "Reports non-'synchronized' methods overriding 'synchronized' methods. The overridden method will not be automatically synchronized if the superclass method is declared as 'synchronized'. This may result in unexpected race conditions when using the subclass. Example: 'class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n }' Inspection ID: NonSynchronizedMethodOverridesSynchronizedMethod", + "markdown": "Reports non-`synchronized` methods overriding `synchronized` methods.\n\n\nThe overridden method will not be automatically synchronized if the superclass method\nis declared as `synchronized`. This may result in unexpected race conditions when using the subclass.\n\n**Example:**\n\n\n class Super {\n synchronized void process() {}\n }\n class Sub extends Super {\n // Unsynchronized method 'process()' overrides synchronized method\n void process() {}\n } \n\nInspection ID: NonSynchronizedMethodOverridesSynchronizedMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonSynchronizedMethodOverridesSynchronizedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TooBroadCatch", + "shortDescription": { + "text": "Overly broad 'catch' block" + }, + "fullDescription": { + "text": "Reports 'catch' blocks with parameters that are more generic than the exception thrown by the corresponding 'try' block. Example: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }' After the quick-fix is applied: 'try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }' Configure the inspection: Use the Only warn on RuntimeException, Exception, Error or Throwable option to have this inspection warn only on the most generic exceptions. Use the Ignore exceptions which hide others but are themselves thrown option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad. Inspection ID: TooBroadCatch", + "markdown": "Reports `catch` blocks with parameters that are more generic than the exception thrown by the corresponding `try` block.\n\n**Example:**\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (Exception ex) { // warning: 'catch' of 'Exception' is too broad, masking exceptions 'RuntimeException'\n return defaultFilePath;\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n File file = new File(pathToFile);\n return file.getAbsolutePath();\n } catch (RuntimeException ex) {\n return defaultFilePath;\n }\n\nConfigure the inspection:\n\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown and thus are technically not overly broad.\n\nInspection ID: TooBroadCatch" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyBroadCatchBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ProtectedMemberInFinalClass", + "shortDescription": { + "text": "'protected' member in 'final' class" + }, + "fullDescription": { + "text": "Reports 'protected' members in 'final' classes with no 'protected' modifier. Since 'final' classes cannot be inherited, marking the method as 'protected' may be confusing. It is better to declare such members as 'private' or package-visible instead. Example: 'record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly. Inspection ID: ProtectedMemberInFinalClass", + "markdown": "Reports `protected` members in `final` classes with no `protected` modifier.\n\nSince `final` classes cannot be inherited, marking the method as `protected`\nmay be confusing. It is better to declare such members as `private` or package-visible instead.\n\n**Example:**\n\n record Bar(int a, int b) {\n protected int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly.\n\n\nInspection ID: ProtectedMemberInFinalClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ProtectedMemberInFinalClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DanglingJavadoc", + "shortDescription": { + "text": "Dangling Javadoc comment" + }, + "fullDescription": { + "text": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates. Example: 'class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' A quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied: 'class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }' Use the Ignore file header comment in JavaDoc format option to ignore comments at the beginning of Java files. These are usually copyright messages. Inspection ID: DanglingJavadoc", + "markdown": "Reports Javadoc comments that don't belong to any class, method or field. The Javadoc tool ignores dangling Javadoc comments and doesn't include them in the HTML documentation it generates.\n\n**Example:**\n\n\n class A {\n /**\n * Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nA quick-fix is available to delete such comments completely or convert them into a block comment. After the quick-fix is applied:\n\n\n class A {\n /*\n Dangling comment\n */\n /**\n * Method javadoc\n */\n public void m(){}\n }\n\nUse the **Ignore file header comment in JavaDoc format** option to ignore comments at the beginning of Java files.\nThese are usually copyright messages.\n\nInspection ID: DanglingJavadoc" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DanglingJavadoc", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadOddness", + "shortDescription": { + "text": "Suspicious oddness check" + }, + "fullDescription": { + "text": "Reports odd-even checks of the following form: 'x % 2 == 1'. Such checks fail when used with negative odd values. Consider using 'x % 2 != 0' or '(x & 1) == 1' instead. Inspection ID: BadOddness", + "markdown": "Reports odd-even checks of the following form: `x % 2 == 1`. Such checks fail when used with negative odd values. Consider using `x % 2 != 0` or `(x & 1) == 1` instead.\n\n\nInspection ID: BadOddness" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BadOddness", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoggingConditionDisagreesWithLogLevelStatement", + "shortDescription": { + "text": "Log condition does not match logging call" + }, + "fullDescription": { + "text": "Reports is log enabled for conditions of 'if' statements that do not match the log level of the contained logging call. For example: 'if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }' This inspection understands the java.util.logging, Log4j, Log4j2, Apache Commons Logging and the SLF4J logging frameworks. Inspection ID: LoggingConditionDisagreesWithLogLevelStatement", + "markdown": "Reports *is log enabled for* conditions of `if` statements that do not match the log level of the contained logging call.\n\n\nFor example:\n\n\n if (LOG.isTraceEnabled()) {\n // debug level logged, but checked for trace level\n LOG.debug(\"some log message\");\n }\n\nThis inspection understands the *java.util.logging* , *Log4j* , *Log4j2* , *Apache Commons Logging*\nand the *SLF4J* logging frameworks.\n\nInspection ID: LoggingConditionDisagreesWithLogLevelStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LoggingConditionDisagreesWithLogLevelStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Logging", + "index": 46, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HibernateResource", + "shortDescription": { + "text": "Hibernate resource opened but not safely closed" + }, + "fullDescription": { + "text": "Reports calls to the 'openSession()' method if the returned 'org.hibernate.Session' resource is not safely closed. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void doHibernateQuery(SessionFactory factory) {\n Session session = factory.openSession(); //warning\n session.createQuery(\"...\");\n }' Use the following options to configure the inspection: Whether a 'org.hibernate.Session' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: HibernateResource", + "markdown": "Reports calls to the `openSession()` method if the returned `org.hibernate.Session` resource is not safely closed.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void doHibernateQuery(SessionFactory factory) {\n Session session = factory.openSession(); //warning\n session.createQuery(\"...\");\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `org.hibernate.Session` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: HibernateResource" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HibernateResourceOpenedButNotSafelyClosed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Resource management", + "index": 47, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryInitCause", + "shortDescription": { + "text": "Unnecessary call to 'Throwable.initCause()'" + }, + "fullDescription": { + "text": "Reports calls to 'Throwable.initCause()' where an exception constructor also takes a 'Throwable cause' argument. In this case, the 'initCause()' call can be removed and its argument can be added to the call to the exception's constructor. Example: 'try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }' A quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied: 'try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }' Inspection ID: UnnecessaryInitCause", + "markdown": "Reports calls to `Throwable.initCause()` where an exception constructor also takes a `Throwable cause` argument.\n\nIn this case, the `initCause()` call can be removed and its argument can be added to the call to the exception's constructor.\n\n**Example:**\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\");\n wrapper.initCause(ex); // Unnecessary call to 'Throwable.initCause()'\n throw wrapper;\n }\n\nA quick-fix is available to pass the cause argument to the constructor. After the quick-fix is applied:\n\n\n try {\n process();\n }\n catch (RuntimeException ex) {\n RuntimeException wrapper = new RuntimeException(\"Error while processing\", ex);\n throw wrapper;\n }\n \nInspection ID: UnnecessaryInitCause" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryInitCause", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComparisonOfShortAndChar", + "shortDescription": { + "text": "Comparison of 'short' and 'char' values" + }, + "fullDescription": { + "text": "Reports equality comparisons between 'short' and 'char' values. Such comparisons may cause subtle bugs because while both values are 2-byte long, 'short' values are signed, and 'char' values are unsigned. Example: 'if (Character.MAX_VALUE == shortValue()) {} //never can be true' Inspection ID: ComparisonOfShortAndChar", + "markdown": "Reports equality comparisons between `short` and `char` values.\n\nSuch comparisons may cause subtle bugs because while both values are 2-byte long, `short` values are\nsigned, and `char` values are unsigned.\n\n**Example:**\n\n\n if (Character.MAX_VALUE == shortValue()) {} //never can be true\n\nInspection ID: ComparisonOfShortAndChar" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ComparisonOfShortAndChar", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrayCanBeReplacedWithEnumValues", + "shortDescription": { + "text": "Array can be replaced with enum values" + }, + "fullDescription": { + "text": "Reports arrays of enum constants that can be replaced with a call to 'EnumType.values()'. Usually, when updating such an enum, you have to update the array as well. However, if you use 'EnumType.values()' instead, no modifications are required. Example: 'enum States {\n NOT_RUN, IN_PROGRESS, FINISHED;\n }\n \n handleStates(new States[] {NOT_RUN, IN_PROGRESS, FINISHED});' After the quick-fix is applied: 'handleStates(States.values());' Inspection ID: ArrayCanBeReplacedWithEnumValues New in 2019.1", + "markdown": "Reports arrays of enum constants that can be replaced with a call to `EnumType.values()`.\n\nUsually, when updating such an enum, you have to update the array as well. However, if you use `EnumType.values()`\ninstead, no modifications are required.\n\nExample:\n\n\n enum States {\n NOT_RUN, IN_PROGRESS, FINISHED;\n }\n \n handleStates(new States[] {NOT_RUN, IN_PROGRESS, FINISHED});\n\nAfter the quick-fix is applied:\n\n\n handleStates(States.values());\n\nInspection ID: ArrayCanBeReplacedWithEnumValues\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ArrayCanBeReplacedWithEnumValues", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SystemOutErr", + "shortDescription": { + "text": "Use of 'System.out' or 'System.err'" + }, + "fullDescription": { + "text": "Reports usages of 'System.out' or 'System.err'. Such statements are often used for temporary debugging and should be either removed from the production code, or replaced by a more robust logging facility. The provided quick-fix supports SLF4J and Log4j 2. It replaces 'System.out' and 'System.err' calls with log calls Example: 'public static void test(Object o) {\n System.out.println(\"Test: \"+ o);\n }' After the quick-fix is applied: 'private static final Logger log = LoggerFactory.getLogger(Test.class);\n\n public static void test(Object o) {\n log.info(\"Test: {}\", o);;\n }' Use the Log method for 'System.err' option to specify a method which it is used to log a message for 'System.err' calls. Use the Log method for 'System.out' option to specify a method which it is used to log a message for 'System.out' calls. Inspection ID: SystemOutErr", + "markdown": "Reports usages of `System.out` or `System.err`.\n\nSuch statements are often used for temporary debugging and should be either removed from the production code, or replaced by a more robust\nlogging facility.\n\nThe provided quick-fix supports **SLF4J** and **Log4j 2** .\nIt replaces `System.out` and `System.err` calls with log calls\n\n**Example:**\n\n\n public static void test(Object o) {\n System.out.println(\"Test: \"+ o);\n }\n\nAfter the quick-fix is applied:\n\n\n private static final Logger log = LoggerFactory.getLogger(Test.class);\n\n public static void test(Object o) {\n log.info(\"Test: {}\", o);;\n }\n\n\nUse the **Log method for 'System.err'** option to specify a method which it is used to log a message for 'System.err' calls.\nUse the **Log method for 'System.out'** option to specify a method which it is used to log a message for 'System.out' calls.\n\nInspection ID: SystemOutErr" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UseOfSystemOutOrSystemErr", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WaitNotifyNotInSynchronizedContext", + "shortDescription": { + "text": "'wait()' or 'notify()' is not in synchronized context" + }, + "fullDescription": { + "text": "Reports calls to 'wait()', 'notify()', and 'notifyAll()' that are not made inside a corresponding synchronized statement or synchronized method. Calling these methods on an object without holding a lock on that object causes 'IllegalMonitorStateException'. Such a construct is not necessarily an error, as the necessary lock may be acquired before the containing method is called, but it's worth looking at. Example: 'class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }' Inspection ID: WaitNotifyNotInSynchronizedContext", + "markdown": "Reports calls to `wait()`, `notify()`, and `notifyAll()` that are not made inside a corresponding synchronized statement or synchronized method.\n\n\nCalling these methods on an object\nwithout holding a lock on that object causes `IllegalMonitorStateException`.\nSuch a construct is not necessarily an error, as the necessary lock may be acquired before\nthe containing method is called, but it's worth looking at.\n\n**Example:**\n\n\n class Sync {\n private final Object lock = new Object();\n\n void test() throws InterruptedException {\n synchronized (this) {\n lock.wait(); // 'lock.wait()' is not synchronized on 'lock'\n }\n }\n }\n\nInspection ID: WaitNotifyNotInSynchronizedContext" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WaitNotifyWhileNotSynced", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DollarSignInName", + "shortDescription": { + "text": "Use of '$' in identifier" + }, + "fullDescription": { + "text": "Reports variables, methods, and classes with dollar signs ('$') in their names. While such names are legal Java, their use outside of generated java code is strongly discouraged. Example: 'class SalaryIn${}' Rename quick-fix is suggested only in the editor. Inspection ID: DollarSignInName", + "markdown": "Reports variables, methods, and classes with dollar signs (`$`) in their names. While such names are legal Java, their use outside of generated java code is strongly discouraged.\n\n**Example:**\n\n\n class SalaryIn${}\n\nRename quick-fix is suggested only in the editor.\n\nInspection ID: DollarSignInName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DollarSignInName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckedExceptionClass", + "shortDescription": { + "text": "Checked exception class" + }, + "fullDescription": { + "text": "Reports checked exception classes (that is, subclasses of 'java.lang.Exception' that are not subclasses of 'java.lang.RuntimeException'). Some coding standards suppress checked user-defined exception classes. Example: 'class IllegalMoveException extends Exception {}' Inspection ID: CheckedExceptionClass", + "markdown": "Reports checked exception classes (that is, subclasses of `java.lang.Exception` that are not subclasses of `java.lang.RuntimeException`).\n\nSome coding standards suppress checked user-defined exception classes.\n\n**Example:**\n\n\n class IllegalMoveException extends Exception {}\n\nInspection ID: CheckedExceptionClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CheckedExceptionClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DynamicRegexReplaceableByCompiledPattern", + "shortDescription": { + "text": "Dynamic regular expression can be replaced by compiled 'Pattern'" + }, + "fullDescription": { + "text": "Reports calls to the regular expression methods (such as 'matches()' or 'split()') of 'java.lang.String' using constant arguments. Such calls may be profitably replaced with a 'private static final Pattern' field so that the regular expression does not have to be compiled each time it is used. Example: 'text.replaceAll(\"abc\", replacement);' After the quick-fix is applied: 'private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));' Inspection ID: DynamicRegexReplaceableByCompiledPattern", + "markdown": "Reports calls to the regular expression methods (such as `matches()` or `split()`) of `java.lang.String` using constant arguments.\n\n\nSuch calls may be profitably replaced with a `private static final Pattern` field\nso that the regular expression does not have to be compiled each time it is used.\n\n**Example:**\n\n\n text.replaceAll(\"abc\", replacement);\n\nAfter the quick-fix is applied:\n\n\n private static final Pattern ABC = Pattern.compile(\"abc\", Pattern.LITERAL);\n ABC.matcher(text).replaceAll(Matcher.quoteReplacement(replacement));\n\nInspection ID: DynamicRegexReplaceableByCompiledPattern" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DynamicRegexReplaceableByCompiledPattern", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyInitializer", + "shortDescription": { + "text": "Empty class initializer" + }, + "fullDescription": { + "text": "Reports empty class initializer blocks. Inspection ID: EmptyInitializer", + "markdown": "Reports empty class initializer blocks.\n\n\nInspection ID: EmptyInitializer" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyClassInitializer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerializableStoresNonSerializable", + "shortDescription": { + "text": "'Serializable' object implicitly stores non-'Serializable' object" + }, + "fullDescription": { + "text": "Reports any references to local non-'Serializable' variables outside 'Serializable' lambdas, local and anonymous classes. When a local variable is referenced from an anonymous class, its value is stored in an implicit field of that class. The same happens for local classes and lambdas. If the variable is of a non-'Serializable' type, serialization will fail. Example: 'interface A extends Serializable {\n abstract void foo();\n }\n class B {}\n class C {\n void foo() {\n B b = new B();\n A a = new A() {\n @Override\n public void foo() {\n System.out.println(b); // warning\n }\n };\n }\n }' Inspection ID: SerializableStoresNonSerializable", + "markdown": "Reports any references to local non-`Serializable` variables outside `Serializable` lambdas, local and anonymous classes.\n\n\nWhen a local variable is referenced from an anonymous class, its value\nis stored in an implicit field of that class. The same happens\nfor local classes and lambdas. If the variable is of a\nnon-`Serializable` type, serialization will fail.\n\n**Example:**\n\n\n interface A extends Serializable {\n abstract void foo();\n }\n class B {}\n class C {\n void foo() {\n B b = new B();\n A a = new A() {\n @Override\n public void foo() {\n System.out.println(b); // warning\n }\n };\n }\n }\n\nInspection ID: SerializableStoresNonSerializable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SerializableStoresNonSerializable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InsertLiteralUnderscores", + "shortDescription": { + "text": "Unreadable numeric literal" + }, + "fullDescription": { + "text": "Reports long numeric literals without underscores and suggests adding them. Underscores make such literals easier to read. Example: '1000000' After the quick-fix is applied: '1_000_000' This inspection only reports if the language level of the project of module is 7 or higher. Inspection ID: InsertLiteralUnderscores New in 2020.2", + "markdown": "Reports long numeric literals without underscores and suggests adding them. Underscores make such literals easier to read.\n\nExample:\n\n\n 1000000\n\nAfter the quick-fix is applied:\n\n\n 1_000_000\n\nThis inspection only reports if the language level of the project of module is 7 or higher.\n\nInspection ID: InsertLiteralUnderscores\n\nNew in 2020.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "InsertLiteralUnderscores", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryBreak", + "shortDescription": { + "text": "Unnecessary 'break' statement" + }, + "fullDescription": { + "text": "Reports any unnecessary 'break' statements. An 'break' statement is unnecessary if no other statements are executed after it has been removed. Example: 'switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }' Inspection ID: UnnecessaryBreak", + "markdown": "Reports any unnecessary `break` statements.\n\nAn `break` statement is unnecessary if no other statements are executed after it has been removed.\n\n**Example:**\n\n\n switch (e) {\n case A -> {\n System.out.println(\"A\");\n break; // reports 'break' statement is unnecessary\n }\n default -> {\n System.out.println(\"Default\");\n break; // reports 'break' statement is unnecessary\n }\n }\n\nInspection ID: UnnecessaryBreak" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryBreak", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BreakStatement", + "shortDescription": { + "text": "'break' statement" + }, + "fullDescription": { + "text": "Reports 'break' statements that are used in places other than at the end of a 'switch' statement branch. 'break' statements complicate refactoring and can be confusing. Example: 'void foo(List strs) {\n for (String str : strs) {\n if (str.contains(\"stop\")) break;\n handleStr(str);\n }\n}' Inspection ID: BreakStatement", + "markdown": "Reports `break` statements that are used in places other than at the end of a `switch` statement branch.\n\n`break` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void foo(List strs) {\n for (String str : strs) {\n if (str.contains(\"stop\")) break;\n handleStr(str);\n }\n }\n\n\nInspection ID: BreakStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BreakStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RawUseOfParameterizedType", + "shortDescription": { + "text": "Raw use of parameterized class" + }, + "fullDescription": { + "text": "Reports generic classes with omitted type parameters. Such raw use of generic types is valid in Java, but it defeats the purpose of type parameters and may mask bugs. This inspection mirrors the 'rawtypes' warning of 'javac'. Examples: '//warning: Raw use of parameterized class 'List'\nList list = new ArrayList();\n//list of strings was created but integer is accepted as well\nlist.add(1);' '//no warning as it's impossible to provide type arguments during array creation\nIntFunction[]> fun = List[]::new;' Configure the inspection: Use the Ignore construction of new objects option to ignore raw types used in object construction. Use the Ignore type casts option to ignore raw types used in type casts. Use the Ignore where a type parameter would not compile option to ignore the cases when a type parameter fails to compile (for example, when creating an array or overriding a library method). Use the Ignore parameter types of overriding methods option to ignore type parameters used in parameters of overridden methods. Use the Ignore when automatic quick-fix is not available option to ignore the cases when a quick-fix is not available. This inspection depends on the Java feature 'Generics', which is available since Java 5. Inspection ID: RawUseOfParameterizedType", + "markdown": "Reports generic classes with omitted type parameters. Such *raw* use of generic types is valid in Java, but it defeats the purpose of type parameters and may mask bugs. This inspection mirrors the `rawtypes` warning of `javac`.\n\n**Examples:**\n\n\n //warning: Raw use of parameterized class 'List'\n List list = new ArrayList();\n //list of strings was created but integer is accepted as well\n list.add(1);\n\n\n //no warning as it's impossible to provide type arguments during array creation\n IntFunction[]> fun = List[]::new;\n\nConfigure the inspection:\n\n* Use the **Ignore construction of new objects** option to ignore raw types used in object construction.\n* Use the **Ignore type casts** option to ignore raw types used in type casts.\n* Use the **Ignore where a type parameter would not compile** option to ignore the cases when a type parameter fails to compile (for example, when creating an array or overriding a library method).\n* Use the **Ignore parameter types of overriding methods** option to ignore type parameters used in parameters of overridden methods.\n* Use the **Ignore when automatic quick-fix is not available** option to ignore the cases when a quick-fix is not available.\n\nThis inspection depends on the Java feature 'Generics', which is available since Java 5.\n\nInspection ID: RawUseOfParameterizedType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "rawtypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JDBCExecuteWithNonConstantString", + "shortDescription": { + "text": "Call to 'Statement.execute()' with non-constant string" + }, + "fullDescription": { + "text": "Reports calls to 'java.sql.Statement.execute()' or any of its variants which take a dynamically-constructed string as the query to execute. Constructed SQL statements are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'ResultSet execute(Statement statement, String name) throws SQLException {\n return statement.executeQuery(\"select * from \" + name); // reports warning\n }' Use the inspection options to consider any 'static' 'final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'private static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";' Inspection ID: JDBCExecuteWithNonConstantString", + "markdown": "Reports calls to `java.sql.Statement.execute()` or any of its variants which take a dynamically-constructed string as the query to execute.\n\nConstructed SQL statements are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n ResultSet execute(Statement statement, String name) throws SQLException {\n return statement.executeQuery(\"select * from \" + name); // reports warning\n }\n\n\nUse the inspection options to consider any `static` `final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n private static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";\n\n\nInspection ID: JDBCExecuteWithNonConstantString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JDBCExecuteWithNonConstantString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicConstructorInNonPublicClass", + "shortDescription": { + "text": "'public' constructor in non-public class" + }, + "fullDescription": { + "text": "Reports 'public' constructors in non-'public' classes. Usually, there is no reason for creating a 'public' constructor in a class with a lower access level. Please note, however, that this inspection changes the behavior of some reflection calls. In particular, 'Class.getConstructor()' won't be able to find the updated constructor ('Class.getDeclaredConstructor()' should be used instead). Do not use the inspection if your code or code of some used frameworks relies on constructor accessibility via 'getConstructor()'. Example: 'class House {\n public House() {}\n }' After the quick-fix is applied: 'class House {\n House() {}\n }' Inspection ID: PublicConstructorInNonPublicClass", + "markdown": "Reports `public` constructors in non-`public` classes.\n\nUsually, there is no reason for creating a `public` constructor in a class with a lower access level.\nPlease note, however, that this inspection changes the behavior of some reflection calls. In particular,\n`Class.getConstructor()` won't be able to find the updated constructor\n(`Class.getDeclaredConstructor()` should be used instead). Do not use the inspection if your code\nor code of some used frameworks relies on constructor accessibility via `getConstructor()`.\n\n**Example:**\n\n\n class House {\n public House() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class House {\n House() {}\n }\n\nInspection ID: PublicConstructorInNonPublicClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PublicConstructorInNonPublicClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantValueVariableUse", + "shortDescription": { + "text": "Use of variable whose value is known to be constant" + }, + "fullDescription": { + "text": "Reports any usages of variables which are known to be constant. This is the case if the (read) use of the variable is surrounded by an 'if', 'while', or 'for' statement with an '==' condition which compares the variable with a constant. In this case, the use of a variable which is known to be constant can be replaced with an actual constant. Example: 'private static void foo(double number) {\n if (number == 1.0) {\n f(number);\n }\n }\n private static void f(double number) {}' After the quick-fix is applied: 'private static void foo(double number) {\n if (number == 1.0) {\n f(1.0);\n }\n }\n private static void f(double number) {}' Inspection ID: ConstantValueVariableUse", + "markdown": "Reports any usages of variables which are known to be constant.\n\nThis is the case if the (read) use of the variable is surrounded by an\n`if`, `while`, or `for`\nstatement with an `==` condition which compares the variable with a constant.\nIn this case, the use of a variable which is known to be constant can be replaced with\nan actual constant.\n\nExample:\n\n\n private static void foo(double number) {\n if (number == 1.0) {\n f(number);\n }\n }\n private static void f(double number) {}\n\nAfter the quick-fix is applied:\n\n\n private static void foo(double number) {\n if (number == 1.0) {\n f(1.0);\n }\n }\n private static void f(double number) {}\n\nInspection ID: ConstantValueVariableUse" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantValueVariableUse", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Data flow", + "index": 22, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NewStringBufferWithCharArgument", + "shortDescription": { + "text": "StringBuilder constructor call with 'char' argument" + }, + "fullDescription": { + "text": "Reports calls to 'StringBuffer' and 'StringBuilder' constructors with 'char' as the argument. In this case, 'char' is silently cast to an integer and interpreted as the initial capacity of the buffer. Example: 'new StringBuilder('(').append(\"1\").append(')');' After the quick-fix is applied: 'new StringBuilder(\"(\").append(\"1\").append(')');' Inspection ID: NewStringBufferWithCharArgument", + "markdown": "Reports calls to `StringBuffer` and `StringBuilder` constructors with `char` as the argument. In this case, `char` is silently cast to an integer and interpreted as the initial capacity of the buffer.\n\n**Example:**\n\n\n new StringBuilder('(').append(\"1\").append(')');\n\nAfter the quick-fix is applied:\n\n\n new StringBuilder(\"(\").append(\"1\").append(')');\n\nInspection ID: NewStringBufferWithCharArgument" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NewStringBufferWithCharArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ProtectedInnerClass", + "shortDescription": { + "text": "Protected nested class" + }, + "fullDescription": { + "text": "Reports 'protected' nested classes. Example: 'public class Outer {\n protected static class Nested {} // warning\n protected class Inner {} // warning\n protected enum Mode {} // warning depends on the setting\n protected interface I {} // warning depends on the setting\n }' Configure the inspection: Use the Ignore 'protected' inner enums option to ignore 'protected' inner enums. Use the Ignore 'protected' inner interfaces option to ignore 'protected' inner interfaces. Inspection ID: ProtectedInnerClass", + "markdown": "Reports `protected` nested classes.\n\n**Example:**\n\n\n public class Outer {\n protected static class Nested {} // warning\n protected class Inner {} // warning\n protected enum Mode {} // warning depends on the setting\n protected interface I {} // warning depends on the setting\n }\n\nConfigure the inspection:\n\n* Use the **Ignore 'protected' inner enums** option to ignore `protected` inner enums.\n* Use the **Ignore 'protected' inner interfaces** option to ignore `protected` inner interfaces.\n\nInspection ID: ProtectedInnerClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ProtectedInnerClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Encapsulation", + "index": 59, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnqualifiedStaticUsage", + "shortDescription": { + "text": "Unqualified static access" + }, + "fullDescription": { + "text": "Reports usage of static members that is not qualified with the class name. This is legal if the static member is in the same class, but may be confusing. Example: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }' After the quick-fix is applied: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }' Use the inspection settings to toggle the reporting for the following items: static fields access 'void bar() { System.out.println(x); }' calls to static methods 'void bar() { foo(); }' 'static void baz() { foo(); }' You can also configure the inspection to only report static member usage from a non-static context. In the above example, 'static void baz() { foo(); }' will not be reported. Inspection ID: UnqualifiedStaticUsage", + "markdown": "Reports usage of static members that is not qualified with the class name.\n\n\nThis is legal if the static member is in\nthe same class, but may be confusing.\n\n**Example:**\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }\n\nUse the inspection settings to toggle the reporting for the following items:\n\n*\n static fields access \n\n `void bar() { System.out.println(x); }`\n\n*\n calls to static methods \n\n `void bar() { foo(); }` \n\n `static void baz() { foo(); }`\n\n\nYou can also configure the inspection to only report static member usage from a non-static context.\nIn the above example, `static void baz() { foo(); }` will not be reported.\n\nInspection ID: UnqualifiedStaticUsage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnqualifiedStaticUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticGuardedByInstance", + "shortDescription": { + "text": "Static member guarded by instance field or this" + }, + "fullDescription": { + "text": "Reports '@GuardedBy' annotations on 'static' fields or methods in which the guard is either a non-static field or 'this'. Guarding a static element with a non-static element may result in excessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy' Inspection ID: StaticGuardedByInstance", + "markdown": "Reports `@GuardedBy` annotations on `static` fields or methods in which the guard is either a non-static field or `this`.\n\nGuarding a static element with a non-static element may result in\nexcessive concurrency, multiple threads may be able to access the guarded field simultaneously by locking in different object contexts.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock();\n\n @GuardedBy(\"lock\")\n public static void bar() {\n // ...\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`\n\nInspection ID: StaticGuardedByInstance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticGuardedByInstance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Concurrency annotation issues", + "index": 60, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassGetClass", + "shortDescription": { + "text": "Suspicious 'Class.getClass()' call" + }, + "fullDescription": { + "text": "Reports 'getClass()' methods that are called on a 'java.lang.Class' instance. This is usually a mistake as the result is always equivalent to 'Class.class'. If it's a mistake, then it's better to remove the 'getClass()' call and use the qualifier directly. If the behavior is intended, then it's better to write 'Class.class' explicitly to avoid confusion. Example: 'void test(Class clazz) {\n String name = clazz.getClass().getName();\n }' After one of the possible quick-fixes is applied: 'void test(Class clazz) {\n String name = clazz.getName();\n }' Inspection ID: ClassGetClass New in 2018.2", + "markdown": "Reports `getClass()` methods that are called on a `java.lang.Class` instance.\n\nThis is usually a mistake as the result is always equivalent to `Class.class`.\nIf it's a mistake, then it's better to remove the `getClass()` call and use the qualifier directly.\nIf the behavior is intended, then it's better to write `Class.class` explicitly to avoid confusion.\n\nExample:\n\n\n void test(Class clazz) {\n String name = clazz.getClass().getName();\n }\n\nAfter one of the possible quick-fixes is applied:\n\n\n void test(Class clazz) {\n String name = clazz.getName();\n }\n\nInspection ID: ClassGetClass\n\nNew in 2018.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ClassGetClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExternalizableWithoutPublicNoArgConstructor", + "shortDescription": { + "text": "'Externalizable' class without 'public' no-arg constructor" + }, + "fullDescription": { + "text": "Reports 'Externalizable' classes without a public no-argument constructor. When an 'Externalizable' object is reconstructed, an instance is created using the public no-arg constructor before the 'readExternal' method called. If a public no-arg constructor is not available, a 'java.io.InvalidClassException' will be thrown at runtime. Inspection ID: ExternalizableWithoutPublicNoArgConstructor", + "markdown": "Reports `Externalizable` classes without a public no-argument constructor.\n\nWhen an `Externalizable` object is reconstructed, an instance is created using the public\nno-arg constructor before the `readExternal` method called. If a public\nno-arg constructor is not available, a `java.io.InvalidClassException` will be\nthrown at runtime.\n\nInspection ID: ExternalizableWithoutPublicNoArgConstructor" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ExternalizableWithoutPublicNoArgConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ResultOfObjectAllocationIgnored", + "shortDescription": { + "text": "Result of object allocation ignored" + }, + "fullDescription": { + "text": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way. Such allocation expressions are legal in Java, but are usually either unintended, or evidence of a very odd object initialization strategy. Use the options to list classes whose allocations should be ignored by this inspection. Inspection ID: ResultOfObjectAllocationIgnored", + "markdown": "Reports object allocations where the allocated object is ignored and neither assigned to a variable nor used in another way.\n\n\nSuch allocation expressions are legal in Java, but are usually either unintended, or\nevidence of a very odd object initialization strategy.\n\n\nUse the options to list classes whose allocations should be ignored by this inspection.\n\n\nInspection ID: ResultOfObjectAllocationIgnored" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ResultOfObjectAllocationIgnored", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedLibrary", + "shortDescription": { + "text": "Unused library" + }, + "fullDescription": { + "text": "Reports libraries attached to the specified inspection scope that are not used directly in code. Inspection ID: UnusedLibrary", + "markdown": "Reports libraries attached to the specified inspection scope that are not used directly in code.\n\n\nInspection ID: UnusedLibrary" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedLibrary", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ManualArrayCopy", + "shortDescription": { + "text": "Manual array copy" + }, + "fullDescription": { + "text": "Reports manual copying of array contents that can be replaced with a call to 'System.arraycopy()'. Example: 'for (int i = 0; i < array.length; i++) {\n newArray[i] = array[i];\n }' After the quick-fix is applied: 'System.arraycopy(array, 0, newArray, 0, array.length);' Inspection ID: ManualArrayCopy", + "markdown": "Reports manual copying of array contents that can be replaced with a call to `System.arraycopy()`.\n\n**Example:**\n\n\n for (int i = 0; i < array.length; i++) {\n newArray[i] = array[i];\n }\n\nAfter the quick-fix is applied:\n\n\n System.arraycopy(array, 0, newArray, 0, array.length);\n\nInspection ID: ManualArrayCopy" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ManualArrayCopy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObsoleteCollection", + "shortDescription": { + "text": "Use of obsolete collection type" + }, + "fullDescription": { + "text": "Reports usages of 'java.util.Vector', 'java.util.Hashtable' and 'java.util.Stack'. Usages of these classes can often be replaced with usages of 'java.util.ArrayList', 'java.util.HashMap' and 'java.util.ArrayDeque' respectively. While still supported, the former classes were made obsolete by the JDK1.2 collection classes, and should probably not be used in new development. Use the Ignore obsolete collection types where they are required option to ignore any cases where the obsolete collections are used as method arguments or assigned to a variable that requires the obsolete type. Enabling this option may consume significant processor resources. Inspection ID: ObsoleteCollection", + "markdown": "Reports usages of `java.util.Vector`, `java.util.Hashtable` and `java.util.Stack`.\n\nUsages of these classes can often be replaced with usages of\n`java.util.ArrayList`, `java.util.HashMap` and `java.util.ArrayDeque` respectively.\nWhile still supported,\nthe former classes were made obsolete by the JDK1.2 collection classes, and should probably\nnot be used in new development.\n\n\nUse the **Ignore obsolete collection types where they are required** option to ignore any cases where the obsolete collections are used\nas method arguments or assigned to a variable that requires the obsolete type.\nEnabling this option may consume significant processor resources.\n\nInspection ID: ObsoleteCollection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfObsoleteCollectionType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticPseudoFunctionalStyleMethod", + "shortDescription": { + "text": "Guava pseudo-functional call can be converted to Stream API call" + }, + "fullDescription": { + "text": "Reports usages of Guava pseudo-functional code when 'Java Stream API' is available. Though 'Guava Iterable API' provides functionality similar to 'Java Streams API', it's slightly different and may miss some features. Especially, primitive-specialized stream variants like 'IntStream' are more performant than generic variants. Example: 'List transformedIterable = Iterables.transform(someList, someTransformFunction);//warning: Pseudo functional style code' After the quick-fix is applied: 'List transformedIterable = someList.stream().map(someTransformFunction).collect(Collectors.toList());' Note: Code semantics can be changed; for example, Guava's 'Iterable.transform' produces a lazy-evaluated iterable, but the replacement is eager-evaluated. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: StaticPseudoFunctionalStyleMethod", + "markdown": "Reports usages of Guava pseudo-functional code when `Java Stream API` is available.\n\nThough `Guava Iterable API` provides functionality similar to `Java Streams API`, it's slightly different and\nmay miss some features.\nEspecially, primitive-specialized stream variants like `IntStream` are more performant than generic variants.\n\n**Example:**\n\n\n List transformedIterable = Iterables.transform(someList, someTransformFunction);//warning: Pseudo functional style code\n\nAfter the quick-fix is applied:\n\n List transformedIterable = someList.stream().map(someTransformFunction).collect(Collectors.toList());\n\n\n**Note:** Code semantics can be changed; for example, Guava's `Iterable.transform` produces a lazy-evaluated iterable,\nbut the replacement is eager-evaluated.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: StaticPseudoFunctionalStyleMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticPseudoFunctionalStyleMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ControlFlowStatementWithoutBraces", + "shortDescription": { + "text": "Control flow statement without braces" + }, + "fullDescription": { + "text": "Reports any 'if', 'while', 'do', or 'for' statements without braces. Some code styles, e.g. the Google Java Style guide, require braces for all control statements. When adding further statements to control statements without braces, it is important not to forget adding braces. When commenting out a line of code, it is also necessary to be more careful when not using braces, to not inadvertently make the next statement part of the control flow statement. Always using braces makes inserting or commenting out a line of code safer. It's likely the goto fail vulnerability would not have happened, if an always use braces code style was used. Control statements with braces make the control flow easier to see, without relying on, possibly incorrect, indentation. Example: 'class Strange {\n void x(boolean one, boolean two) {\n if(one)\n if(two)\n foo();\n else\n bar();\n }\n\n void foo() {}\n void bar() {}\n }' The quick-fix wraps the statement body with braces: 'class Strange {\n void x(boolean one, boolean two) {\n if(one) {\n if(two) {\n foo();\n } else {\n bar();\n }\n }\n }\n\n void foo() {}\n void bar() {}\n }' Inspection ID: ControlFlowStatementWithoutBraces", + "markdown": "Reports any `if`, `while`, `do`, or `for` statements without braces. Some code styles, e.g. the [Google Java Style guide](https://google.github.io/styleguide/javaguide.html), require braces for all control statements.\n\n\nWhen adding further statements to control statements without braces, it is important not to forget adding braces.\nWhen commenting out a line of code, it is also necessary to be more careful when not using braces,\nto not inadvertently make the next statement part of the control flow statement.\nAlways using braces makes inserting or commenting out a line of code safer.\n\n\nIt's likely the [goto fail vulnerability](https://www.imperialviolet.org/2014/02/22/applebug.html) would not have happened,\nif an always use braces code style was used.\nControl statements with braces make the control flow easier to see, without relying on, possibly incorrect, indentation.\n\nExample:\n\n\n class Strange {\n void x(boolean one, boolean two) {\n if(one)\n if(two)\n foo();\n else\n bar();\n }\n\n void foo() {}\n void bar() {}\n }\n\nThe quick-fix wraps the statement body with braces:\n\n\n class Strange {\n void x(boolean one, boolean two) {\n if(one) {\n if(two) {\n foo();\n } else {\n bar();\n }\n }\n }\n\n void foo() {}\n void bar() {}\n }\n\nInspection ID: ControlFlowStatementWithoutBraces" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ControlFlowStatementWithoutBraces", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LengthOneStringInIndexOf", + "shortDescription": { + "text": "Single character string argument in 'String.indexOf()' call" + }, + "fullDescription": { + "text": "Reports single character strings being used as an argument in 'String.indexOf()' and 'String.lastIndexOf()' calls. A quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement. Example: 'return s.indexOf(\"x\");' After the quick-fix is applied: 'return s.indexOf('x');' Inspection ID: LengthOneStringInIndexOf", + "markdown": "Reports single character strings being used as an argument in `String.indexOf()` and `String.lastIndexOf()` calls.\n\nA quick-fix is suggested to replace such string literals with equivalent character literals, gaining some performance enhancement.\n\n**Example:**\n\n\n return s.indexOf(\"x\");\n\nAfter the quick-fix is applied:\n\n\n return s.indexOf('x');\n\nInspection ID: LengthOneStringInIndexOf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SingleCharacterStringConcatenation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonFinalFieldInEnum", + "shortDescription": { + "text": "Non-final field in 'enum'" + }, + "fullDescription": { + "text": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable. Example: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' After the quick-fix is applied: 'enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }' Use the `Ignore fields that cannot be made 'final'` option to only warn on fields that can be made final using the quick-fix. Inspection ID: NonFinalFieldInEnum", + "markdown": "Reports non-final fields in enumeration types. Non-final fields introduce global mutable state, which is generally considered undesirable.\n\n**Example:**\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n enum Enum {\n FIRST(\"first\"),\n SECOND(\"second\");\n\n public final String str;\n\n Enum(String str) {\n this.str = str;\n }\n }\n\nUse the \\`Ignore fields that cannot be made 'final'\\` option to only warn on fields that can be made final using the quick-fix.\n\nInspection ID: NonFinalFieldInEnum" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonFinalFieldInEnum", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MisspelledEquals", + "shortDescription": { + "text": "'equal()' instead of 'equals()'" + }, + "fullDescription": { + "text": "Reports declarations of 'equal()' with a single parameter. Normally, this is a typo and 'equals()' is actually intended. A quick-fix is suggested to rename the method to 'equals'. Example: 'class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }' After the quick-fix is applied: 'class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }' Inspection ID: MisspelledEquals", + "markdown": "Reports declarations of `equal()` with a single parameter. Normally, this is a typo and `equals()` is actually intended.\n\nA quick-fix is suggested to rename the method to `equals`.\n\n**Example:**\n\n\n class Main {\n public boolean equal(Object obj) {\n return true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n public boolean equals(Object obj) {\n return true;\n }\n }\n\nInspection ID: MisspelledEquals" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MisspelledEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EnumClass", + "shortDescription": { + "text": "Enumerated class" + }, + "fullDescription": { + "text": "Reports enum classes. Such statements are not supported in Java 1.4 and earlier JVM. Inspection ID: EnumClass", + "markdown": "Reports **enum** classes. Such statements are not supported in Java 1.4 and earlier JVM.\n\n\nInspection ID: EnumClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EnumClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level issues", + "index": 62, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TrivialFunctionalExpressionUsage", + "shortDescription": { + "text": "Trivial usage of functional expression" + }, + "fullDescription": { + "text": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation. Example: 'boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }' When the quick-fix is applied, the method call changes to: 'boolean contains(List names, String name) {\n return names.contains(name);\n }' Inspection ID: TrivialFunctionalExpressionUsage", + "markdown": "Reports functional interface methods calls that are directly invoked on the definition of the lambda, method reference, or anonymous class. Such method calls can be replaced with the body of the functional interface implementation.\n\n**Example:**\n\n\n boolean contains(List names, String name) {\n return ((Predicate)x -> {\n return names.contains(x);\n }).test(name);\n }\n\nWhen the quick-fix is applied, the method call changes to:\n\n\n boolean contains(List names, String name) {\n return names.contains(name);\n }\n\nInspection ID: TrivialFunctionalExpressionUsage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TrivialFunctionalExpressionUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MismatchedStringBuilderQueryUpdate", + "shortDescription": { + "text": "Mismatched query and update of 'StringBuilder'" + }, + "fullDescription": { + "text": "Reports 'StringBuilder', 'StringBuffer' or 'StringJoiner' objects whose contents are read but not written to, or written to but not read. Such inconsistent reads and writes are pointless and probably indicate dead, incomplete, or erroneous code. Example: 'public void m1() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"a\");\n }' Inspection ID: MismatchedStringBuilderQueryUpdate", + "markdown": "Reports `StringBuilder`, `StringBuffer` or `StringJoiner` objects whose contents are read but not written to, or written to but not read.\n\nSuch inconsistent reads and writes are pointless and probably indicate\ndead, incomplete, or erroneous code.\n\n**Example:**\n\n\n public void m1() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"a\");\n }\n\n\nInspection ID: MismatchedStringBuilderQueryUpdate" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MismatchedQueryAndUpdateOfStringBuilder", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnonymousHasLambdaAlternative", + "shortDescription": { + "text": "Anonymous type has shorter lambda alternative" + }, + "fullDescription": { + "text": "Reports anonymous classes which could be transformed to a constructor or a factory method call with a lambda expression argument. The following classes are reported by this inspection: Anonymous classes extending 'ThreadLocal' which have an 'initialValue()' method (can be replaced with 'ThreadLocal.withInitial') Anonymous classes extending 'Thread' which have a 'run()' method (can be replaced with 'new Thread(Runnable)' Example: 'new Thread() {\n @Override\n public void run() {\n System.out.println(\"Hello from thread!\");\n }\n }.start();' After the quick-fix is applied: 'new Thread(() -> {\n System.out.println(\"Hello from thread!\");\n }).start();' This inspection depends on the Java feature 'ThreadLocal.withInitial()', which is available since Java 8. Inspection ID: AnonymousHasLambdaAlternative", + "markdown": "Reports anonymous classes which could be transformed to a constructor or a factory method call with a lambda expression argument.\n\nThe following classes are reported by this inspection:\n\n* Anonymous classes extending `ThreadLocal` which have an `initialValue()` method (can be replaced with `ThreadLocal.withInitial`)\n* Anonymous classes extending `Thread` which have a `run()` method (can be replaced with `new Thread(Runnable)`\n\nExample:\n\n\n new Thread() {\n @Override\n public void run() {\n System.out.println(\"Hello from thread!\");\n }\n }.start();\n\nAfter the quick-fix is applied:\n\n\n new Thread(() -> {\n System.out.println(\"Hello from thread!\");\n }).start();\n\nThis inspection depends on the Java feature 'ThreadLocal.withInitial()', which is available since Java 8.\n\nInspection ID: AnonymousHasLambdaAlternative" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AnonymousHasLambdaAlternative", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FinalizeNotProtected", + "shortDescription": { + "text": "'finalize()' should be protected, not public" + }, + "fullDescription": { + "text": "Reports any implementations of the 'Object.finalize()' method that are declared 'public'. According to the contract of the 'Object.finalize()', only the garbage collector calls this method. Making this method public may be confusing, because it means that the method can be used from other code. A quick-fix is provided to make the method 'protected', to prevent it from being invoked from other classes. Example: 'class X {\n public void finalize() {\n /* ... */\n }\n }' After the quick-fix is applied: 'class X {\n protected void finalize() {\n /* ... */\n }\n }' Inspection ID: FinalizeNotProtected", + "markdown": "Reports any implementations of the `Object.finalize()` method that are declared `public`.\n\n\nAccording to the contract of the `Object.finalize()`, only the garbage\ncollector calls this method. Making this method public may be confusing, because it\nmeans that the method can be used from other code.\n\n\nA quick-fix is provided to make the method `protected`, to prevent it from being invoked\nfrom other classes.\n\n**Example:**\n\n\n class X {\n public void finalize() {\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n protected void finalize() {\n /* ... */\n }\n }\n\nInspection ID: FinalizeNotProtected" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "FinalizeNotProtected", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Finalization", + "index": 64, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExtendsThread", + "shortDescription": { + "text": "Class directly extends 'Thread'" + }, + "fullDescription": { + "text": "Reports classes that directly extend 'java.lang.Thread'. It is usually recommended to prefer composition over inheritance to create more reusable code that is easier to modify later. Example: 'class MainThread extends Thread {\n }' Inspection ID: ExtendsThread", + "markdown": "Reports classes that directly extend `java.lang.Thread`. It is usually recommended to prefer composition over inheritance to create more reusable code that is easier to modify later.\n\n**Example:**\n\n\n class MainThread extends Thread {\n }\n\nInspection ID: ExtendsThread" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassExplicitlyExtendsThread", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyOptionalCallChains", + "shortDescription": { + "text": "Optional call chain can be simplified" + }, + "fullDescription": { + "text": "Reports Optional call chains that can be simplified. Here are several examples of possible simplifications: 'optional.map(x -> true).orElse(false)' → 'optional.isPresent()' 'optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)' → 'optional.map(String::trim)' 'optional.map(x -> (String)x).orElse(null)' → '(String) optional.orElse(null)' 'Optional.ofNullable(optional.orElse(null))' → 'optional' 'val = optional.orElse(null); val != null ? val : defaultExpr' → 'optional.orElse(defaultExpr)' 'val = optional.orElse(null); if(val != null) expr(val)' → 'optional.ifPresent(val -> expr(val))' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: SimplifyOptionalCallChains New in 2017.2", + "markdown": "Reports **Optional** call chains that can be simplified. Here are several examples of possible simplifications:\n\n* `optional.map(x -> true).orElse(false)` → `optional.isPresent()`\n* `optional.map(x -> Optional.of(x.trim())).orElseGet(Optional::empty)` → `optional.map(String::trim)`\n* `optional.map(x -> (String)x).orElse(null)` → `(String) optional.orElse(null)`\n* `Optional.ofNullable(optional.orElse(null))` → `optional`\n* `val = optional.orElse(null); val != null ? val : defaultExpr ` → `optional.orElse(defaultExpr)`\n* `val = optional.orElse(null); if(val != null) expr(val) ` → `optional.ifPresent(val -> expr(val))`\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: SimplifyOptionalCallChains\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SimplifyOptionalCallChains", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ModuleWithTooManyClasses", + "shortDescription": { + "text": "Module with too many classes" + }, + "fullDescription": { + "text": "Reports modules that contain too many classes. Overly large modules may indicate a lack of design clarity. Java, Kotlin and Groovy classes are counted. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Maximum number of classes field to specify the maximum number of classes a module may have. Inspection ID: ModuleWithTooManyClasses", + "markdown": "Reports modules that contain too many classes. Overly large modules may indicate a lack of design clarity. Java, Kotlin and Groovy classes are counted.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Maximum number of classes** field to specify the maximum number of classes a module may have.\n\n\nInspection ID: ModuleWithTooManyClasses" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ModuleWithTooManyClasses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Modularization issues", + "index": 66, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InfiniteLoopStatement", + "shortDescription": { + "text": "Infinite loop statement" + }, + "fullDescription": { + "text": "Reports 'for', 'while', or 'do' statements that can only exit by throwing an exception. While such statements may be correct, they often happen due to coding errors. Example: 'for (;;) {\n }' Use the Ignore when placed in Thread.run option to ignore the infinite loop statements inside 'Thread.run'. It may be useful for the daemon threads. Example: 'new Thread(() -> {\n while (true) {\n }\n }).start();' Inspection ID: InfiniteLoopStatement", + "markdown": "Reports `for`, `while`, or `do` statements that can only exit by throwing an exception. While such statements may be correct, they often happen due to coding errors.\n\nExample:\n\n\n for (;;) {\n }\n\n\nUse the **Ignore when placed in Thread.run** option to ignore the\ninfinite loop statements inside `Thread.run`.\nIt may be useful for the daemon threads.\n\nExample:\n\n\n new Thread(() -> {\n while (true) {\n }\n }).start();\n\n\nInspection ID: InfiniteLoopStatement" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InfiniteLoopStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavadocHtmlLint", + "shortDescription": { + "text": "HTML problems in Javadoc (DocLint)" + }, + "fullDescription": { + "text": "Reports the same HTML issues in the Javadoc comments that have been reported by DocLint since Java 8. The inspection detects the following issues: Self-closed, unclosed, unknown, misplaced, or empty tag Unknown or wrong attribute Misplaced text Example: '/**\n * Unknown tag: List\n * Unclosed tag: error\n * Misplaced text or tag:

\n * Wrong or empty attribute: \n * Self-closed tag:
\n * ...\n */\nvoid sample(){ }' Inspection ID: JavadocHtmlLint", + "markdown": "Reports the same HTML issues in the Javadoc comments that have been reported by DocLint since Java 8.\n\nThe inspection detects the following issues:\n\n* Self-closed, unclosed, unknown, misplaced, or empty tag\n* Unknown or wrong attribute\n* Misplaced text\n\nExample:\n\n\n /**\n * Unknown tag: List\n * Unclosed tag: error
\n * Misplaced text or tag:
  • one
  • ,
  • two
\n * Wrong or empty attribute: \n * Self-closed tag:
\n * ...\n */\n void sample(){ }\n\nInspection ID: JavadocHtmlLint" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JavadocHtmlLint", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RandomDoubleForRandomInteger", + "shortDescription": { + "text": "Using 'Random.nextDouble()' to get random integer" + }, + "fullDescription": { + "text": "Reports calls to 'java.util.Random.nextDouble()' that are used to create a positive integer number by multiplying the call by a factor and casting to an integer. For generating a random positive integer in a range, 'java.util.Random.nextInt(int)' is simpler and more efficient. Example: 'int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }'\n After the quick-fix is applied: 'int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }' Inspection ID: RandomDoubleForRandomInteger", + "markdown": "Reports calls to `java.util.Random.nextDouble()` that are used to create a positive integer number by multiplying the call by a factor and casting to an integer.\n\n\nFor generating a random positive integer in a range,\n`java.util.Random.nextInt(int)` is simpler and more efficient.\n\n**Example:**\n\n\n int getRandomInt() {\n return (int) ((new Random()).nextDouble() * SIZE);\n }\n \nAfter the quick-fix is applied:\n\n\n int getRandomInt() {\n return (new Random()).nextInt(SIZE);\n }\n\nInspection ID: RandomDoubleForRandomInteger" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UsingRandomNextDoubleForRandomInteger", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousArrayCast", + "shortDescription": { + "text": "Suspicious array cast" + }, + "fullDescription": { + "text": "Reports suspicious array casts. An array cast is considered suspicious when it casts to a more specific array type. Such a cast is legal at compile time but may fail with a 'ClassCastException' at runtime. Example: 'Number[] numbers = new Number[]{1L, 2L, 4L};\n Long[] longs = (Long[])numbers;' Inspection ID: SuspiciousArrayCast", + "markdown": "Reports suspicious array casts. An array cast is considered suspicious when it casts to a more specific array type. Such a cast is legal at compile time but may fail with a `ClassCastException` at runtime.\n\n**Example:**\n\n\n Number[] numbers = new Number[]{1L, 2L, 4L};\n Long[] longs = (Long[])numbers;\n\nInspection ID: SuspiciousArrayCast" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousArrayCast", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassUnconnectedToPackage", + "shortDescription": { + "text": "Class independent of its package" + }, + "fullDescription": { + "text": "Reports classes that don't depend on any other class in their package and are not a dependency for any other class in their package. Such classes indicate ad-hoc or incoherent packaging strategies and often may be profitably moved. Classes that are the only class in their package are not reported. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassUnconnectedToPackage", + "markdown": "Reports classes that don't depend on any other class in their package and are not a dependency for any other class in their package. Such classes indicate ad-hoc or incoherent packaging strategies and often may be profitably moved. Classes that are the only class in their package are not reported.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassUnconnectedToPackage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassUnconnectedToPackage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Packaging issues", + "index": 38, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExceptionNameDoesntEndWithException", + "shortDescription": { + "text": "Exception class name does not end with 'Exception'" + }, + "fullDescription": { + "text": "Reports exception classes whose names don't end with 'Exception'. Example: 'class NotStartedEx extends Exception {}' A quick-fix that renames such classes is available only in the editor. Inspection ID: ExceptionNameDoesntEndWithException", + "markdown": "Reports exception classes whose names don't end with `Exception`.\n\n**Example:** `class NotStartedEx extends Exception {}`\n\nA quick-fix that renames such classes is available only in the editor.\n\n\nInspection ID: ExceptionNameDoesntEndWithException" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExceptionClassNameDoesntEndWithException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Class", + "index": 68, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ZeroLengthArrayInitialization", + "shortDescription": { + "text": "Zero-length array allocation" + }, + "fullDescription": { + "text": "Reports allocations of arrays with known lengths of zero. Since array lengths in Java are non-modifiable, it is almost always possible to share zero-length arrays, rather than repeatedly allocate new ones. Such sharing may provide useful optimizations in the program runtime or footprint. Note that the inspection does not report zero-length arrays allocated as static final fields, since those arrays are assumed to be used for implementing array sharing. Inspection ID: ZeroLengthArrayInitialization", + "markdown": "Reports allocations of arrays with known lengths of zero.\n\n\nSince array lengths in Java are non-modifiable, it is almost always possible to share zero-length arrays, rather than repeatedly\nallocate new ones. Such sharing may provide useful optimizations in the program runtime or footprint.\n\n\nNote that the inspection does not report zero-length arrays allocated as static final fields,\nsince those arrays are assumed to be used for implementing array sharing.\n\nInspection ID: ZeroLengthArrayInitialization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ZeroLengthArrayAllocation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Memory", + "index": 69, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonFinalStaticVariableUsedInClassInitialization", + "shortDescription": { + "text": "Non-final static field is used during class initialization" + }, + "fullDescription": { + "text": "Reports the use of non-'final' 'static' variables during class initialization. In such cases, the code semantics may become dependent on the class creation order. Additionally, such cases may lead to the use of variables before their initialization, and generally cause difficult and confusing bugs. Example: 'class Foo {\n public static int bar = 0;\n\n static {\n System.out.println(bar);\n }\n }' Inspection ID: NonFinalStaticVariableUsedInClassInitialization", + "markdown": "Reports the use of non-`final` `static` variables during class initialization.\n\nIn such cases, the code semantics may become dependent on the class creation order. Additionally, such cases may lead to the use of\nvariables before their initialization, and generally cause difficult and confusing bugs.\n\n**Example:**\n\n\n class Foo {\n public static int bar = 0;\n\n static {\n System.out.println(bar);\n }\n }\n\nInspection ID: NonFinalStaticVariableUsedInClassInitialization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonFinalStaticVariableUsedInClassInitialization", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DivideByZero", + "shortDescription": { + "text": "Division by zero" + }, + "fullDescription": { + "text": "Reports division by zero or remainder by zero. Such expressions will produce an 'Infinity', '-Infinity' or 'NaN' result for doubles or floats, and will throw an 'ArithmeticException' for integers. When the expression has a 'NaN' result, the fix suggests replacing the division expression with the 'NaN' constant. Inspection ID: DivideByZero", + "markdown": "Reports division by zero or remainder by zero. Such expressions will produce an `Infinity`, `-Infinity` or `NaN` result for doubles or floats, and will throw an `ArithmeticException` for integers.\n\nWhen the expression has a `NaN` result, the fix suggests replacing the division expression with the `NaN` constant.\n\n\nInspection ID: DivideByZero" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "divzero", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadStopSuspendResume", + "shortDescription": { + "text": "Call to 'Thread.stop()', 'suspend()' or 'resume()'" + }, + "fullDescription": { + "text": "Reports calls to 'Thread.stop()', 'Thread.suspend()', and 'Thread.resume()'. These calls are inherently prone to data corruption and deadlocks, and their use is strongly discouraged. It is better to use cooperative cancellation instead of 'stop', and interruption instead of direct calls to 'suspend' and 'resume'. Inspection ID: ThreadStopSuspendResume", + "markdown": "Reports calls to `Thread.stop()`, `Thread.suspend()`, and `Thread.resume()`.\n\n\nThese calls are inherently prone to data corruption and deadlocks, and their use is strongly discouraged.\nIt is better to use cooperative cancellation instead of `stop`, and\ninterruption instead of direct calls to `suspend` and `resume`.\n\nInspection ID: ThreadStopSuspendResume" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToThreadStopSuspendOrResumeManager", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryTemporaryOnConversionFromString", + "shortDescription": { + "text": "Unnecessary temporary object in conversion from 'String'" + }, + "fullDescription": { + "text": "Reports unnecessary creation of temporary objects when converting from 'String' to primitive types. Example: 'new Integer(\"3\").intValue()' After the quick-fix is applied: 'Integer.valueOf(\"3\")' Inspection ID: UnnecessaryTemporaryOnConversionFromString", + "markdown": "Reports unnecessary creation of temporary objects when converting from `String` to primitive types.\n\n**Example:**\n\n\n new Integer(\"3\").intValue()\n\nAfter the quick-fix is applied:\n\n\n Integer.valueOf(\"3\")\n\n\nInspection ID: UnnecessaryTemporaryOnConversionFromString" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryTemporaryOnConversionFromString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingSerialAnnotation", + "shortDescription": { + "text": "'@Serial' annotation can be used" + }, + "fullDescription": { + "text": "Reports methods and fields in the 'Serializable' and 'Externalizable' classes that are suitable to be annotated with the 'java.io.Serial' annotation. The quick-fix adds the annotation. Example: 'class Main implements Serializable {\n private static final long serialVersionUID = 7874493593505141603L;\n\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n}' After the quick-fix is applied: 'class Main implements Serializable {\n @Serial\n private static final long serialVersionUID = 7874493593505141603L;\n\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n}' Example: 'class Main implements Externalizable {\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }' After the quick-fix is applied: 'class Main implements Externalizable {\n @Serial\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }' For more information about all possible cases, refer to the Javadoc of the 'java.io.Serial' class. This inspection depends on the Java feature '@Serial annotation', which is available since Java 14. Inspection ID: MissingSerialAnnotation New in 2020.3", + "markdown": "Reports methods and fields in the `Serializable` and `Externalizable` classes that are suitable to be annotated with the `java.io.Serial` annotation. The quick-fix adds the annotation.\n\n**Example:**\n\n\n class Main implements Serializable {\n private static final long serialVersionUID = 7874493593505141603L;\n\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main implements Serializable {\n @Serial\n private static final long serialVersionUID = 7874493593505141603L;\n\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\n**Example:**\n\n\n class Main implements Externalizable {\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main implements Externalizable {\n @Serial\n protected Object readResolve() throws ObjectStreamException {\n return \"SomeObject\";\n }\n }\n\nFor more information about all possible cases, refer to the Javadoc of the `java.io.Serial` class.\n\nThis inspection depends on the Java feature '@Serial annotation', which is available since Java 14.\n\nInspection ID: MissingSerialAnnotation\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MissingSerialAnnotation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringConcatenationMissingWhitespace", + "shortDescription": { + "text": "Whitespace may be missing in string concatenation" + }, + "fullDescription": { + "text": "Reports string concatenations with missing whitespaces, that is where the left-hand side ends with a Unicode letter or digit and the right-hand side starts with a Unicode letter or digit. Example: 'String sql = \"SELECT column\" +\n \"FROM table\";' Use the Ignore concatenations with variable strings option to only report when both the left and right side of the concatenation are literals. Inspection ID: StringConcatenationMissingWhitespace", + "markdown": "Reports string concatenations with missing whitespaces, that is where the left-hand side ends with a Unicode letter or digit and the right-hand side starts with a Unicode letter or digit.\n\n**Example:**\n\n\n String sql = \"SELECT column\" +\n \"FROM table\";\n\n\nUse the **Ignore concatenations with variable strings** option to only report\nwhen both the left and right side of the concatenation are literals.\n\nInspection ID: StringConcatenationMissingWhitespace" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringConcatenationMissingWhitespace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StandardVariableNames", + "shortDescription": { + "text": "Standard variable names" + }, + "fullDescription": { + "text": "Reports variables with 'standard' names that do not correspond to their types. Such names may be confusing. There are the following standard names for specific types: i, j, k, m, n - 'int' f - 'float' d - 'double' b - 'byte' c, ch - 'char' l - 'long' s, str - 'String' Rename quick-fix is suggested only in the editor. Use the option to ignore parameter names which are identical to the parameter name from a direct super method. Inspection ID: StandardVariableNames", + "markdown": "Reports variables with 'standard' names that do not correspond to their types. Such names may be confusing. There are the following standard names for specific types:\n\n* i, j, k, m, n - `int`\n* f - `float`\n* d - `double`\n* b - `byte`\n* c, ch - `char`\n* l - `long`\n* s, str - `String`\n\nRename quick-fix is suggested only in the editor.\n\n\nUse the option to ignore parameter names which are identical to the parameter name from a direct super method.\n\nInspection ID: StandardVariableNames" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StandardVariableNames", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfConcreteClass", + "shortDescription": { + "text": "Use of concrete class" + }, + "fullDescription": { + "text": "Reports usages of concrete classes, rather than interfaces. Such declarations may represent a failure of abstraction and may make testing more difficult. Declarations whose classes come from system or third-party libraries will not be reported by this inspection. Casts, instanceofs, and local variables are not reported in 'equals()' method implementations. Also, casts are not reported in 'clone()' method implementations. Example: 'interface Entity {}\n class EntityImpl implements Entity {}\n\n void processObject(Object obj) {\n // warning: instanceof of the concrete class\n if (obj instanceof EntityImpl) {\n // warning: cast to the concrete class,\n // rather than the interface\n processEntity((EntityImpl)obj);\n }\n }\n // warning: parameter of concrete class\n void processEntity(EntityImpl obj) {\n }' Use the Ignore abstract class type option to ignore casts to abstract classes. Use the subsequent options to control contexts where the problem is reported. Inspection ID: UseOfConcreteClass", + "markdown": "Reports usages of concrete classes, rather than interfaces. Such declarations may represent a failure of abstraction and may make testing more difficult.\n\n\nDeclarations whose classes come from system or third-party libraries will not be reported by this inspection.\nCasts, instanceofs, and local variables are not reported in `equals()` method implementations.\nAlso, casts are not reported in `clone()` method implementations.\n\nExample:\n\n\n interface Entity {}\n class EntityImpl implements Entity {}\n\n void processObject(Object obj) {\n // warning: instanceof of the concrete class\n if (obj instanceof EntityImpl) {\n // warning: cast to the concrete class,\n // rather than the interface\n processEntity((EntityImpl)obj);\n }\n }\n // warning: parameter of concrete class\n void processEntity(EntityImpl obj) {\n }\n\n\nUse the **Ignore abstract class type** option to ignore casts to abstract classes.\n\nUse the subsequent options to control contexts where the problem is reported.\n\nInspection ID: UseOfConcreteClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfConcreteClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DeconstructionCanBeUsed", + "shortDescription": { + "text": "Record pattern can be used" + }, + "fullDescription": { + "text": "Reports patterns that can be replaced with record patterns. Example: 'record Point(int x, int y) {\n static void printSum(Object obj) {\n if (obj instanceof Point p) {\n int x = p.x();\n int y = p.y();\n System.out.println(x + y);\n }\n }\n }' After the quick-fix is applied: 'record Point(int x, int y) {\n static void printSum(Object obj) {\n if (obj instanceof Point(int x, int y)) {\n System.out.println(x + y);\n }\n }\n }' This inspection depends on the Java feature 'Pattern guards and record patterns', which is available since Java 21. Inspection ID: DeconstructionCanBeUsed New in 2023.1", + "markdown": "Reports patterns that can be replaced with record patterns.\n\nExample:\n\n\n record Point(int x, int y) {\n static void printSum(Object obj) {\n if (obj instanceof Point p) {\n int x = p.x();\n int y = p.y();\n System.out.println(x + y);\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n record Point(int x, int y) {\n static void printSum(Object obj) {\n if (obj instanceof Point(int x, int y)) {\n System.out.println(x + y);\n }\n }\n }\n\nThis inspection depends on the Java feature 'Pattern guards and record patterns', which is available since Java 21.\n\nInspection ID: DeconstructionCanBeUsed\n\nNew in 2023.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DeconstructionCanBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 21", + "index": 77, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantLabeledSwitchRuleCodeBlock", + "shortDescription": { + "text": "Labeled switch rule has redundant code block" + }, + "fullDescription": { + "text": "Reports labeled rules of 'switch' statements or 'switch' expressions that have a redundant code block. Example: 'String s = switch (n) {\n case 1 -> { yield Integer.toString(n); }\n default -> \"default\";\n };' After the quick-fix is applied: 'String s = switch (n) {\n case 1 -> Integer.toString(n);\n default -> \"default\";\n };' This inspection depends on the Java feature 'Enhanced 'switch' blocks', which is available since Java 14. Inspection ID: RedundantLabeledSwitchRuleCodeBlock New in 2019.1", + "markdown": "Reports labeled rules of `switch` statements or `switch` expressions that have a redundant code block.\n\nExample:\n\n\n String s = switch (n) {\n case 1 -> { yield Integer.toString(n); }\n default -> \"default\";\n };\n\nAfter the quick-fix is applied:\n\n\n String s = switch (n) {\n case 1 -> Integer.toString(n);\n default -> \"default\";\n };\n\nThis inspection depends on the Java feature 'Enhanced 'switch' blocks', which is available since Java 14.\n\nInspection ID: RedundantLabeledSwitchRuleCodeBlock\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantLabeledSwitchRuleCodeBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IOStreamConstructor", + "shortDescription": { + "text": "'InputStream' and 'OutputStream' can be constructed using 'Files' methods" + }, + "fullDescription": { + "text": "Reports 'new FileInputStream()' or 'new FileOutputStream()' expressions that can be replaced with 'Files.newInputStream()' or 'Files.newOutputStream()' calls respectively. The streams created using 'Files' methods are usually more efficient than those created by stream constructors. Example: 'InputStream is = new BufferedInputStream(new FileInputStream(file));' After the quick-fix is applied: 'InputStream is = new BufferedInputStream(Files.newInputStream(file.toPath()));' This inspection does not show warning if the language level 10 or higher, but the quick-fix is still available. This inspection only reports if the language level of the project or module is 7 or higher. Inspection ID: IOStreamConstructor New in 2022.1", + "markdown": "Reports `new FileInputStream()` or `new FileOutputStream()` expressions that can be replaced with `Files.newInputStream()` or `Files.newOutputStream()` calls respectively. \nThe streams created using `Files` methods are usually more efficient than those created by stream constructors.\n\nExample:\n\n\n InputStream is = new BufferedInputStream(new FileInputStream(file));\n\nAfter the quick-fix is applied:\n\n\n InputStream is = new BufferedInputStream(Files.newInputStream(file.toPath()));\n\nThis inspection does not show warning if the language level 10 or higher, but the quick-fix is still available.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nInspection ID: IOStreamConstructor\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IOStreamConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToForLoopParameter", + "shortDescription": { + "text": "Assignment to 'for' loop parameter" + }, + "fullDescription": { + "text": "Reports assignment to, or modification of a 'for' loop parameter inside the body of the loop. Although occasionally intended, this construct may be confusing and is often the result of a typo or a wrong variable being used. The quick-fix adds a declaration of a new variable. Example: 'for (String s : list) {\n // Warning: s is changed inside the loop\n s = s.trim();\n System.out.println(\"String: \" + s);\n }' After the quick-fix is applied: 'for (String s : list) {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n }' Assignments in basic 'for' loops without an update statement are not reported. In such cases the assignment is probably intended and can't be easily moved to the update part of the 'for' loop. Example: 'for (int i = 0; i < list.size(); ) {\n if (element.equals(list.get(i))) {\n list.remove(i);\n } else {\n // modification of for loop parameter is not reported\n // as there's no update statement\n i++;\n }\n }' Use the Check enhanced 'for' loop parameters option to specify whether modifications of enhanced 'for' loop parameters should be also reported. Inspection ID: AssignmentToForLoopParameter", + "markdown": "Reports assignment to, or modification of a `for` loop parameter inside the body of the loop.\n\nAlthough occasionally intended, this construct may be confusing and is often the result of a typo or a wrong variable being used.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n for (String s : list) {\n // Warning: s is changed inside the loop\n s = s.trim();\n System.out.println(\"String: \" + s);\n }\n\nAfter the quick-fix is applied:\n\n\n for (String s : list) {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n }\n\nAssignments in basic `for` loops without an update statement are not reported.\nIn such cases the assignment is probably intended and can't be easily moved to the update part of the `for` loop.\n\n**Example:**\n\n\n for (int i = 0; i < list.size(); ) {\n if (element.equals(list.get(i))) {\n list.remove(i);\n } else {\n // modification of for loop parameter is not reported\n // as there's no update statement\n i++;\n }\n }\n\nUse the **Check enhanced 'for' loop parameters** option to specify whether modifications of enhanced `for` loop parameters\nshould be also reported.\n\nInspection ID: AssignmentToForLoopParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToForLoopParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java9CollectionFactory", + "shortDescription": { + "text": "Immutable collection creation can be replaced with collection factory call" + }, + "fullDescription": { + "text": "Reports 'java.util.Collections' unmodifiable collection calls that can be converted to newer collection factory methods. These can be replaced with e.g. 'List.of()' or 'Set.of()' introduced in Java 9 or 'List.copyOf()' introduced in Java 10. Note that in contrast to 'java.util.Collections' methods, Java 9 collection factory methods: Do not accept 'null' values. Require unique set elements and map keys. Do not accept 'null' arguments to query methods like 'List.contains()' or 'Map.get()' of the collections returned. When these cases are violated, exceptions are thrown. This can change the semantics of the code after the migration. Example: 'List even = Collections.unmodifiableList(\n Arrays.asList(2, 4, 6, 8, 10, 2));\n List evenCopy = Collections.unmodifiableList(\n new ArrayList<>(list1));' After the quick-fix is applied: 'List even = List.of(2, 4, 6, 8, 10, 2);\n List evenCopy = List.copyOf(list);' Use the Do not warn when content is non-constant option to report only in cases when the supplied arguments are compile-time constants. This reduces the chances that the behavior changes, because it's not always possible to statically check whether original elements are unique and not 'null'. Use the Suggest 'Map.ofEntries' option to suggest replacing unmodifiable maps with more than 10 entries with 'Map.ofEntries()'. This inspection depends on the Java feature 'Collection factory methods', which is available since Java 9. Inspection ID: Java9CollectionFactory New in 2017.2", + "markdown": "Reports `java.util.Collections` unmodifiable collection calls that can be converted to newer collection factory methods. These can be replaced with e.g. `List.of()` or `Set.of()` introduced in Java 9 or `List.copyOf()` introduced in Java 10.\n\nNote that in contrast to `java.util.Collections` methods, Java 9 collection factory methods:\n\n* Do not accept `null` values.\n* Require unique set elements and map keys.\n* Do not accept `null` arguments to query methods like `List.contains()` or `Map.get()` of the collections returned.\n\nWhen these cases are violated, exceptions are thrown.\nThis can change the semantics of the code after the migration.\n\nExample:\n\n\n List even = Collections.unmodifiableList(\n Arrays.asList(2, 4, 6, 8, 10, 2));\n List evenCopy = Collections.unmodifiableList(\n new ArrayList<>(list1));\n\nAfter the quick-fix is applied:\n\n\n List even = List.of(2, 4, 6, 8, 10, 2);\n List evenCopy = List.copyOf(list);\n\n\nUse the **Do not warn when content is non-constant** option to report only in cases when the supplied arguments are compile-time constants.\nThis reduces the chances that the behavior changes,\nbecause it's not always possible to statically check whether original elements are unique and not `null`.\n\n\nUse the **Suggest 'Map.ofEntries'** option to suggest replacing unmodifiable maps with more than 10 entries with `Map.ofEntries()`.\n\nThis inspection depends on the Java feature 'Collection factory methods', which is available since Java 9.\n\nInspection ID: Java9CollectionFactory\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "Java9CollectionFactory", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 9", + "index": 78, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExceptionFromCatchWhichDoesntWrap", + "shortDescription": { + "text": "'throw' inside 'catch' block which ignores the caught exception" + }, + "fullDescription": { + "text": "Reports exceptions that are thrown from inside 'catch' blocks but do not \"wrap\" the caught exception. When an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information, such as stack frames and line numbers. Example: '...\n catch (IOException e) {\n closeAllConnections();\n throw new ConnectException(\"Connection problem.\"); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'\n }' Configure the inspection: Use the Ignore if result of exception method call is used option to indicate whether the inspection should ignore exceptions whose argument is the result of a method call on the original exception, such as 'getMessage()'. Use the Ignore if thrown exception cannot wrap an exception option to ignore 'throw' statements that throw exceptions without a constructor that accepts a 'Throwable' cause. Inspection ID: ExceptionFromCatchWhichDoesntWrap", + "markdown": "Reports exceptions that are thrown from inside `catch` blocks but do not \"wrap\" the caught exception.\n\nWhen an exception is thrown in response to an exception, wrapping the initial exception prevents losing valuable context information,\nsuch as stack frames and line numbers.\n\n**Example:**\n\n\n ...\n catch (IOException e) {\n closeAllConnections();\n throw new ConnectException(\"Connection problem.\"); // warning: 'throw' inside 'catch' block ignores the caught exception 'e'\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if result of exception method call is used** option to indicate whether the inspection should ignore exceptions whose argument is the result of a method call on the original exception, such as `getMessage()`.\n* Use the **Ignore if thrown exception cannot wrap an exception** option to ignore `throw` statements that throw exceptions without a constructor that accepts a `Throwable` cause.\n\nInspection ID: ExceptionFromCatchWhichDoesntWrap" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ThrowInsideCatchBlockWhichIgnoresCaughtException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodOnlyUsedFromInnerClass", + "shortDescription": { + "text": "Private method only used from inner class" + }, + "fullDescription": { + "text": "Reports 'private' methods which are only called from an inner class of the class containing the method. Such methods can be safely moved into that inner class. Example: 'public class Outer {\n public static void main(String[] args) {\n new Inner().run(args[0]);\n }\n\n static class Inner {\n void run(String arg) {\n // Method isEmpty() is used from Inner class only\n // consider moving it to the Inner class\n if (!isEmpty(arg)) {\n System.out.println(\"Argument is supplied\");\n }\n }\n }\n\n private static boolean isEmpty(String s) {\n return s != null && s.trim().isEmpty();\n }\n}' Use the first checkbox below to ignore 'private' methods which are called from an anonymous or local class. Use the third checkbox to only report 'static' methods. Inspection ID: MethodOnlyUsedFromInnerClass", + "markdown": "Reports `private` methods which are only called from an inner class of the class containing the method. Such methods can be safely moved into that inner class.\n\nExample:\n\n\n public class Outer {\n public static void main(String[] args) {\n new Inner().run(args[0]);\n }\n\n static class Inner {\n void run(String arg) {\n // Method isEmpty() is used from Inner class only\n // consider moving it to the Inner class\n if (!isEmpty(arg)) {\n System.out.println(\"Argument is supplied\");\n }\n }\n }\n\n private static boolean isEmpty(String s) {\n return s != null && s.trim().isEmpty();\n }\n }\n\n\nUse the first checkbox below to ignore `private`\nmethods which are called from an anonymous or local class.\n\n\nUse the third checkbox to only report `static` methods.\n\n\nInspection ID: MethodOnlyUsedFromInnerClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodOnlyUsedFromInnerClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComparisonToNaN", + "shortDescription": { + "text": "Comparison to 'Double.NaN' or 'Float.NaN'" + }, + "fullDescription": { + "text": "Reports any comparisons to 'Double.NaN' or 'Float.NaN'. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the 'Double.isNaN()' or 'Float.isNaN()' methods instead. Example: 'if (x == Double.NaN) {...}' After the quick-fix is applied: 'if (Double.isNaN(x)) {...}' Inspection ID: ComparisonToNaN", + "markdown": "Reports any comparisons to `Double.NaN` or `Float.NaN`. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the `Double.isNaN()` or `Float.isNaN()` methods instead.\n\n**Example:**\n\n\n if (x == Double.NaN) {...}\n\nAfter the quick-fix is applied:\n\n\n if (Double.isNaN(x)) {...}\n\nInspection ID: ComparisonToNaN" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ComparisonToNaN", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MultiCatchCanBeSplit", + "shortDescription": { + "text": "Multi-catch can be split into separate catch blocks" + }, + "fullDescription": { + "text": "Reports multi-'catch' sections and suggests splitting them into separate 'catch' blocks. Example: 'try {\n int i = getIndex();\n } catch (NullPointerException|IndexOutOfBoundsException e) {\n e.printStackTrace();\n }' After the quick-fix is applied: 'try {\n int i = getIndex();\n } catch (NullPointerException e) {\n e.printStackTrace();\n } catch (IndexOutOfBoundsException e) {\n e.printStackTrace();\n }' This inspection depends on the Java feature 'Multi-catches', which is available since Java 7. Inspection ID: MultiCatchCanBeSplit", + "markdown": "Reports multi-`catch` sections and suggests splitting them into separate `catch` blocks.\n\nExample:\n\n\n try {\n int i = getIndex();\n } catch (NullPointerException|IndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n int i = getIndex();\n } catch (NullPointerException e) {\n e.printStackTrace();\n } catch (IndexOutOfBoundsException e) {\n e.printStackTrace();\n }\n\nThis inspection depends on the Java feature 'Multi-catches', which is available since Java 7.\n\nInspection ID: MultiCatchCanBeSplit" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MultiCatchCanBeSplit", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ResultSetIndexZero", + "shortDescription": { + "text": "Use of index 0 in JDBC ResultSet" + }, + "fullDescription": { + "text": "Reports attempts to access column 0 of 'java.sql.ResultSet' or 'java.sql.PreparedStatement'. For historical reasons, columns of 'java.sql.ResultSet' and 'java.sql.PreparedStatement' are numbered starting with 1, rather than with 0, and accessing column 0 is a common error in JDBC programming. Example: 'String getName(ResultSet rs) {\n return rs.getString(0);\n }' Inspection ID: ResultSetIndexZero", + "markdown": "Reports attempts to access column 0 of `java.sql.ResultSet` or `java.sql.PreparedStatement`. For historical reasons, columns of `java.sql.ResultSet` and `java.sql.PreparedStatement` are numbered starting with **1** , rather than with **0** , and accessing column 0 is a common error in JDBC programming.\n\n**Example:**\n\n\n String getName(ResultSet rs) {\n return rs.getString(0);\n }\n\nInspection ID: ResultSetIndexZero" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfIndexZeroInJDBCResultSet", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionCoveredByFurtherCondition", + "shortDescription": { + "text": "Condition is covered by further condition" + }, + "fullDescription": { + "text": "Reports conditions that become redundant as they are completely covered by a subsequent condition. For example, in the 'value != -1 && value > 0' condition, the first part is redundant: if it's false, then the second part is also false. Or in a condition like 'obj != null && obj instanceof String', the null-check is redundant as 'instanceof' operator implies non-nullity. Inspection ID: ConditionCoveredByFurtherCondition New in 2018.3", + "markdown": "Reports conditions that become redundant as they are completely covered by a subsequent condition.\n\nFor example, in the `value != -1 && value > 0` condition, the first part is redundant:\nif it's false, then the second part is also false.\nOr in a condition like `obj != null && obj instanceof String`,\nthe null-check is redundant as `instanceof` operator implies non-nullity.\n\nInspection ID: ConditionCoveredByFurtherCondition\n\nNew in 2018.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConditionCoveredByFurtherCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MetaAnnotationWithoutRuntimeRetention", + "shortDescription": { + "text": "Test annotation without '@Retention(RUNTIME)' annotation" + }, + "fullDescription": { + "text": "Reports annotations with a 'SOURCE' or 'CLASS' retention policy that are supposed to be used by JUnit 5. Such annotations are not available at runtime and most probably their retention policy should be fixed to be accessible through reflection. Note that if the retention policy is not specified, then the default retention policy 'CLASS' is used. Example: '@Testable\n public @interface UnitTest {}' After the quick-fix is applied: '@Retention(RetentionPolicy.RUNTIME)\n @Testable\n public @interface UnitTest {}'", + "markdown": "Reports annotations with a `SOURCE` or `CLASS` retention policy that are supposed to be used by JUnit 5. Such annotations are not available at runtime and most probably their retention policy should be fixed to be accessible through reflection.\n\nNote that if the retention policy is not specified, then the default retention policy `CLASS` is used.\n\n**Example:**\n\n\n @Testable\n public @interface UnitTest {}\n\nAfter the quick-fix is applied:\n\n\n @Retention(RetentionPolicy.RUNTIME)\n @Testable\n public @interface UnitTest {}\n" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MetaAnnotationWithoutRuntimeRetention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/JUnit", + "index": 79, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PatternVariableHidesField", + "shortDescription": { + "text": "Pattern variable hides field" + }, + "fullDescription": { + "text": "Reports pattern variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the pattern variable when using the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'class Pointless {\n Point p = new Point();\n\n public void test(Object a) {\n if (a instanceof Point p) {\n System.out.print(\"a is a point (\" + p.x + \", \" + p.y + ')');\n } else {\n System.out.print(\"p is a point (\" + p.x + \", \" + p.y + ')');\n }\n }\n }' Inspection ID: PatternVariableHidesField New in 2022.2", + "markdown": "Reports pattern variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the pattern variable when using the identically named field is intended.\n\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n class Pointless {\n Point p = new Point();\n\n public void test(Object a) {\n if (a instanceof Point p) {\n System.out.print(\"a is a point (\" + p.x + \", \" + p.y + ')');\n } else {\n System.out.print(\"p is a point (\" + p.x + \", \" + p.y + ')');\n }\n }\n }\n\nInspection ID: PatternVariableHidesField\n\nNew in 2022.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PatternVariableHidesField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JoinDeclarationAndAssignmentJava", + "shortDescription": { + "text": "Assignment can be joined with declaration" + }, + "fullDescription": { + "text": "Reports variable assignments that can be joined with a variable declaration. Example: 'int x;\n x = 1;' The quick-fix converts the assignment into an initializer: 'int x = 1;' Inspection ID: JoinDeclarationAndAssignmentJava New in 2018.3", + "markdown": "Reports variable assignments that can be joined with a variable declaration.\n\nExample:\n\n\n int x;\n x = 1;\n\nThe quick-fix converts the assignment into an initializer:\n\n\n int x = 1;\n\nInspection ID: JoinDeclarationAndAssignmentJava\n\nNew in 2018.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JoinDeclarationAndAssignmentJava", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InnerClassVariableHidesOuterClassVariable", + "shortDescription": { + "text": "Inner class field hides outer class field" + }, + "fullDescription": { + "text": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended. A quick-fix is suggested to rename the inner class field. Example: 'class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }' Use the option to choose whether this inspection should report all name clashes, or only clashes with fields that are visible from the inner class. Inspection ID: InnerClassVariableHidesOuterClassVariable", + "markdown": "Reports inner class fields named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the field from the inner class when using the identically named field of a surrounding class is intended.\n\nA quick-fix is suggested to rename the inner class field.\n\n**Example:**\n\n\n class Outer {\n private String name;\n\n class Inner {\n private String name;\n }\n }\n\n\nUse the option to choose whether this inspection should report all name clashes,\nor only clashes with fields that are visible from the inner class.\n\nInspection ID: InnerClassVariableHidesOuterClassVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InnerClassFieldHidesOuterClassField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryContinue", + "shortDescription": { + "text": "Unnecessary 'continue' statement" + }, + "fullDescription": { + "text": "Reports 'continue' statements if they are the last reachable statements in the loop. These 'continue' statements are unnecessary and can be safely removed. Example: 'for (String element: elements) {\n System.out.println();\n continue;\n }' After the quick-fix is applied: 'for (String element: elements) {\n System.out.println();\n }' The inspection doesn't analyze JSP files. Use the Ignore in then branch of 'if' statement with 'else' branch option to ignore 'continue' statements when they are placed in a 'then' branch of a complete 'if'-'else' statement. Example: 'for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }' Inspection ID: UnnecessaryContinue", + "markdown": "Reports `continue` statements if they are the last reachable statements in the loop. These `continue` statements are unnecessary and can be safely removed.\n\nExample:\n\n\n for (String element: elements) {\n System.out.println();\n continue;\n }\n\nAfter the quick-fix is applied:\n\n\n for (String element: elements) {\n System.out.println();\n }\n\nThe inspection doesn't analyze JSP files.\n\n\nUse the **Ignore in then branch of 'if' statement with 'else' branch** option to ignore\n`continue` statements when they are placed in a `then` branch of a complete\n`if`-`else` statement.\n\nExample:\n\n\n for (String element: elements) {\n if(element.isEmpty()) {\n continue;\n } else {\n //...\n }\n }\n\nInspection ID: UnnecessaryContinue" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryContinue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MISSORTED_IMPORTS", + "shortDescription": { + "text": "Missorted imports" + }, + "fullDescription": { + "text": "Reports 'import' statements which are not arranged according to the current code style (see Settings|Editor|Code Style). Example: 'import java.util.List;\n import java.util.ArrayList;\n\n public class Example {\n List list = new ArrayList();\n }' After the \"Optimize Imports\" quick fix is applied: 'import java.util.ArrayList;\n import java.util.List;\n\n public class Example {\n List list = new ArrayList();\n }' Inspection ID: MISSORTED_IMPORTS", + "markdown": "Reports `import` statements which are not arranged according to the current code style (see Settings\\|Editor\\|Code Style).\n\n**Example:**\n\n\n import java.util.List;\n import java.util.ArrayList;\n\n public class Example {\n List list = new ArrayList();\n }\n\nAfter the \"Optimize Imports\" quick fix is applied:\n\n\n import java.util.ArrayList;\n import java.util.List;\n\n public class Example {\n List list = new ArrayList();\n }\n\nInspection ID: MISSORTED_IMPORTS" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MISSORTED_IMPORTS", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Imports", + "index": 21, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryModifier", + "shortDescription": { + "text": "Unnecessary modifier" + }, + "fullDescription": { + "text": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same. Example 1: '// all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }' Example 2: 'final record R() {\n // all records are implicitly final\n }' Example 3: '// all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }' Inspection ID: UnnecessaryModifier", + "markdown": "Reports redundant modifiers and suggests to remove them. The resulting code will be shorter, but the behaviour and meaning will remain the same.\n\n**Example 1:**\n\n\n // all code is implicitly strictfp under Java 17 and higher\n strictfp class X {\n\n // inner enums are implicitly static\n static enum Inner {\n A, B, C\n }\n\n // inner records are implicitly static\n static record R() {\n }\n }\n\n**Example 2:**\n\n\n final record R() {\n // all records are implicitly final\n }\n\n**Example 3:**\n\n\n // all interfaces are implicitly abstract\n abstract interface Printer {\n\n // all interface members are implicitly public\n public int size();\n\n // all inner classes of interfaces are implicitly static\n static class Inner {}\n }\n\n\nInspection ID: UnnecessaryModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonThreadSafeLazyInitialization", + "shortDescription": { + "text": "Unsafe lazy initialization of 'static' field" + }, + "fullDescription": { + "text": "Reports 'static' variables that are lazily initialized in a non-thread-safe manner. Lazy initialization of 'static' variables should be done with an appropriate synchronization construct to prevent different threads from performing conflicting initialization. When applicable, a quick-fix, which introduces the lazy initialization holder class idiom, is suggested. This idiom makes use of the fact that the JVM guarantees that a class will not be initialized until it is used. Example: 'class X {\n private static List list;\n\n public List getList() {\n if (list == null) {\n list = List.of(\"one\", \"two\", \"tree\");\n }\n return list;\n }\n }' After the quick-fix is applied: 'class X {\n private static final class ListHolder {\n static final List list = List.of(\"one\", \"two\", \"tree\");\n }\n\n public List getList() {\n return ListHolder.list;\n }\n }' Inspection ID: NonThreadSafeLazyInitialization", + "markdown": "Reports `static` variables that are lazily initialized in a non-thread-safe manner.\n\nLazy initialization of `static` variables should be done with an appropriate synchronization construct\nto prevent different threads from performing conflicting initialization.\n\nWhen applicable, a quick-fix, which introduces the\n[lazy initialization holder class idiom](https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom), is suggested.\nThis idiom makes use of the fact that the JVM guarantees that a class will not be initialized until it is used.\n\n**Example:**\n\n\n class X {\n private static List list;\n\n public List getList() {\n if (list == null) {\n list = List.of(\"one\", \"two\", \"tree\");\n }\n return list;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n private static final class ListHolder {\n static final List list = List.of(\"one\", \"two\", \"tree\");\n }\n\n public List getList() {\n return ListHolder.list;\n }\n }\n\nInspection ID: NonThreadSafeLazyInitialization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonThreadSafeLazyInitialization", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionalCanBePushedInsideExpression", + "shortDescription": { + "text": "Conditional can be pushed inside branch expression" + }, + "fullDescription": { + "text": "Reports conditional expressions with 'then' and else branches that are similar enough so that the expression can be moved inside. This action shortens the code. Example: 'double g(int a, int b) {\n return a == b ? Math.cos(0) : Math.cos(1);\n }' After the quick-fix is applied: 'double g(int a, int b) {\n return Math.cos(a == b ? 0 : 1);\n }' Inspection ID: ConditionalCanBePushedInsideExpression New in 2017.2", + "markdown": "Reports conditional expressions with `then` and else branches that are similar enough so that the expression can be moved inside. This action shortens the code.\n\nExample:\n\n\n double g(int a, int b) {\n return a == b ? Math.cos(0) : Math.cos(1);\n }\n\nAfter the quick-fix is applied:\n\n\n double g(int a, int b) {\n return Math.cos(a == b ? 0 : 1);\n }\n\nInspection ID: ConditionalCanBePushedInsideExpression\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConditionalCanBePushedInsideExpression", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CloneInNonCloneableClass", + "shortDescription": { + "text": "'clone()' method in non-Cloneable class" + }, + "fullDescription": { + "text": "Reports classes that override the 'clone()' method but don't implement the 'Cloneable' interface. This usually represents a programming error. Use the Only warn on 'public' clone methods option to ignore methods that aren't 'public'. For classes designed to be inherited, you may choose to override 'clone()' and declare it as 'protected' without implementing the 'Cloneable' interface and decide whether to implement the 'Cloneable' interface in subclasses. Inspection ID: CloneInNonCloneableClass", + "markdown": "Reports classes that override the `clone()` method but don't implement the `Cloneable` interface. This usually represents a programming error.\n\n\nUse the **Only warn on 'public' clone methods** option to ignore methods that aren't `public`.\n\nFor classes designed to be inherited, you may choose to override `clone()` and declare it as `protected`\nwithout implementing the `Cloneable` interface and decide whether to implement the `Cloneable` interface in subclasses.\n\nInspection ID: CloneInNonCloneableClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CloneInNonCloneableClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Cloning issues", + "index": 82, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CStyleArrayDeclaration", + "shortDescription": { + "text": "C-style array declaration" + }, + "fullDescription": { + "text": "Reports array declarations written in C-style syntax, where the array brackets are placed after a variable name or after a method parameter list. Most code styles prefer Java-style array declarations, where the array brackets are placed after the type name. Example: 'public String process(String value[])[] {\n return value;\n }' After the quick-fix is applied: 'public String[] process(String[] value) {\n return value;\n }' Configure the inspection: Use the Ignore C-style declarations in variables option to report C-style array declaration of method return types only. Inspection ID: CStyleArrayDeclaration", + "markdown": "Reports array declarations written in C-style syntax, where the array brackets are placed after a variable name or after a method parameter list. Most code styles prefer Java-style array declarations, where the array brackets are placed after the type name.\n\n**Example:**\n\n\n public String process(String value[])[] {\n return value;\n }\n\nAfter the quick-fix is applied:\n\n\n public String[] process(String[] value) {\n return value;\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore C-style declarations in variables** option to report C-style array declaration of method return types only.\n\n\nInspection ID: CStyleArrayDeclaration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CStyleArrayDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java8ListReplaceAll", + "shortDescription": { + "text": "Loop can be replaced with 'List.replaceAll()'" + }, + "fullDescription": { + "text": "Reports loops which can be collapsed into a single 'List.replaceAll()' call. Example: 'for (int i = 0; i < strings.size(); i++) {\n String str = strings.get(i).toLowerCase();\n strings.set(i, str);\n }' After the quick-fix is applied: 'strings.replaceAll(String::toLowerCase);' This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: Java8ListReplaceAll New in 2022.1", + "markdown": "Reports loops which can be collapsed into a single `List.replaceAll()` call.\n\n**Example:**\n\n\n for (int i = 0; i < strings.size(); i++) {\n String str = strings.get(i).toLowerCase();\n strings.set(i, str);\n }\n\nAfter the quick-fix is applied:\n\n\n strings.replaceAll(String::toLowerCase);\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: Java8ListReplaceAll\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Java8ListReplaceAll", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SystemExit", + "shortDescription": { + "text": "Call to 'System.exit()' or related methods" + }, + "fullDescription": { + "text": "Reports calls to 'System.exit()', 'Runtime.exit()', and 'Runtime.halt()'. Invoking 'System.exit()' or 'Runtime.exit()' calls the shutdown hooks and terminates the currently running Java virtual machine. Invoking 'Runtime.halt()' forcibly terminates the JVM without causing shutdown hooks to be started. Each of these methods should be used with extreme caution. Calls to these methods make the calling code unportable to most application servers. Use the option to ignore calls in main methods. Inspection ID: SystemExit", + "markdown": "Reports calls to `System.exit()`, `Runtime.exit()`, and `Runtime.halt()`.\n\n\nInvoking `System.exit()` or `Runtime.exit()`\ncalls the shutdown hooks and terminates the currently running Java\nvirtual machine. Invoking `Runtime.halt()` forcibly\nterminates the JVM without causing shutdown hooks to be started.\nEach of these methods should be used with extreme caution. Calls\nto these methods make the calling code unportable to most\napplication servers.\n\n\nUse the option to ignore calls in main methods.\n\n\nInspection ID: SystemExit" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToSystemExit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BigDecimalLegacyMethod", + "shortDescription": { + "text": "'BigDecimal' legacy method called" + }, + "fullDescription": { + "text": "Reports calls to 'BigDecimal.divide()' or 'BigDecimal.setScale()' that use integer constants to specify the rounding mode. Since JDK 1.5, consider using methods that take the 'RoundingMode' 'enum' parameter instead. Example: 'new BigDecimal(\"42\").setScale(2, BigDecimal.ROUND_FLOOR);' After the quick-fix is applied: 'new BigDecimal(\"42\").setScale(2, RoundingMode.FLOOR);' Inspection ID: BigDecimalLegacyMethod", + "markdown": "Reports calls to `BigDecimal.divide()` or `BigDecimal.setScale()` that use integer constants to specify the rounding mode. Since JDK 1.5, consider using methods that take the `RoundingMode` `enum` parameter instead.\n\n**Example:**\n\n new BigDecimal(\"42\").setScale(2, BigDecimal.ROUND_FLOOR);\n\nAfter the quick-fix is applied:\n\n new BigDecimal(\"42\").setScale(2, RoundingMode.FLOOR);\n\n\nInspection ID: BigDecimalLegacyMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BigDecimalLegacyMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DeclareCollectionAsInterface", + "shortDescription": { + "text": "Collection declared by class, not interface" + }, + "fullDescription": { + "text": "Reports declarations of 'Collection' variables made by using the collection class as a type, rather than an appropriate interface. The warning is not issued if weakening the variable type will cause a compilation error. Example: '// Warning: concrete collection class ArrayList used.\n int getTotalLength(ArrayList list) {\n return list.stream().mapToInt(String::length).sum();\n }\n\n // No warning, as trimToSize() method is not\n // available in the List interface\n void addData(ArrayList data) {\n data.add(\"Hello\");\n data.add(\"World\");\n data.trimToSize();\n }' A quick-fix is suggested to use the appropriate collection interface (e.g. 'Collection', 'Set', or 'List'). Inspection ID: DeclareCollectionAsInterface", + "markdown": "Reports declarations of `Collection` variables made by using the collection class as a type, rather than an appropriate interface. The warning is not issued if weakening the variable type will cause a compilation error.\n\nExample:\n\n\n // Warning: concrete collection class ArrayList used.\n int getTotalLength(ArrayList list) {\n return list.stream().mapToInt(String::length).sum();\n }\n\n // No warning, as trimToSize() method is not\n // available in the List interface\n void addData(ArrayList data) {\n data.add(\"Hello\");\n data.add(\"World\");\n data.trimToSize();\n }\n\nA quick-fix is suggested to use the appropriate collection interface (e.g. `Collection`, `Set`, or `List`).\n\nInspection ID: DeclareCollectionAsInterface" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CollectionDeclaredAsConcreteClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TrivialStringConcatenation", + "shortDescription": { + "text": "Concatenation with empty string" + }, + "fullDescription": { + "text": "Reports empty string operands in string concatenations. Concatenation with the empty string can be used to convert non-'String' objects or primitives into 'String's, but it can be clearer to use a 'String.valueOf()' method call. A quick-fix is suggested to simplify the concatenation. Example: 'void foo(int x, int y) {\n String s = \"\" + x + \" ; \" + y;\n }' After the quick-fix is applied: 'void foo(int x, int y) {\n String s = x + \" ; \" + y;\n }' Use the Report only where empty strings can be removed without other changes option to ignore cases cases where removing the empty string will require adding a 'String.valueOf()' conversion of another operand. Inspection ID: TrivialStringConcatenation", + "markdown": "Reports empty string operands in string concatenations. Concatenation with the empty string can be used to convert non-`String` objects or primitives into `String`s, but it can be clearer to use a `String.valueOf()` method call.\n\n\nA quick-fix is suggested to simplify the concatenation.\n\n**Example:**\n\n\n void foo(int x, int y) {\n String s = \"\" + x + \" ; \" + y;\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(int x, int y) {\n String s = x + \" ; \" + y;\n }\n\n\nUse the **Report only where empty strings can be removed without other changes**\noption to ignore cases cases where removing the empty string\nwill require adding a `String.valueOf()` conversion of another operand.\n\nInspection ID: TrivialStringConcatenation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConcatenationWithEmptyString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousInvocationHandlerImplementation", + "shortDescription": { + "text": "Suspicious 'InvocationHandler' implementation" + }, + "fullDescription": { + "text": "Reports implementations of 'InvocationHandler' that do not proxy standard 'Object' methods like 'hashCode()', 'equals()', and 'toString()'. Failing to handle these methods might cause unexpected problems upon calling them on a proxy instance. Example: 'InvocationHandler myHandler = (proxy, method, params) -> {\n System.out.println(\"Hello World!\");\n return null;\n };\n Runnable myProxy = (Runnable) Proxy.newProxyInstance(\n Thread.currentThread().getContextClassLoader(),\n new Class[] {Runnable.class}, myHandler\n );' This code snippet is designed to only proxy the 'Runnable.run()' method. However, calls to any 'Object' methods, like 'hashCode()', are proxied as well. This can lead to problems like a 'NullPointerException', for example, when adding 'myProxy' to a 'HashSet'. New in 2020.2 Inspection ID: SuspiciousInvocationHandlerImplementation", + "markdown": "Reports implementations of `InvocationHandler` that do not proxy standard `Object` methods like `hashCode()`, `equals()`, and `toString()`.\n\nFailing to handle these methods might cause unexpected problems upon calling them on a proxy instance.\n\n**Example:**\n\n\n InvocationHandler myHandler = (proxy, method, params) -> {\n System.out.println(\"Hello World!\");\n return null;\n };\n Runnable myProxy = (Runnable) Proxy.newProxyInstance(\n Thread.currentThread().getContextClassLoader(),\n new Class[] {Runnable.class}, myHandler\n );\n\n\nThis code snippet is designed to only proxy the `Runnable.run()` method.\nHowever, calls to any `Object` methods, like `hashCode()`, are proxied as well.\nThis can lead to problems like a `NullPointerException`, for example, when adding `myProxy` to a `HashSet`.\n\nNew in 2020.2\n\nInspection ID: SuspiciousInvocationHandlerImplementation" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousInvocationHandlerImplementation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingPackageInfo", + "shortDescription": { + "text": "Missing 'package-info.java'" + }, + "fullDescription": { + "text": "Reports packages that contain classes but do not contain the 'package-info.java' or 'package.html' files and are, thus, missing the package documentation. The quick-fix creates an initial 'package-info.java' file. Inspection ID: MissingPackageInfo", + "markdown": "Reports packages that contain classes but do not contain the `package-info.java` or `package.html` files and are, thus, missing the package documentation.\n\nThe quick-fix creates an initial `package-info.java` file.\n\n\nInspection ID: MissingPackageInfo" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MissingPackageInfo", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryConstructor", + "shortDescription": { + "text": "Redundant no-arg constructor" + }, + "fullDescription": { + "text": "Reports unnecessary constructors. A constructor is unnecessary if it is the only constructor of a class, has no parameters, has the same access modifier as its containing class, and does not perform any initialization except explicitly or implicitly calling the superclass constructor without arguments. Such a constructor can be safely removed as it will be generated by the compiler even if not specified. Example: 'public class Foo {\n public Foo() {}\n }' After the quick-fix is applied: 'public class Foo {}' Use the inspection settings to ignore unnecessary constructors that have an annotation. Inspection ID: UnnecessaryConstructor", + "markdown": "Reports unnecessary constructors.\n\n\nA constructor is unnecessary if it is the only constructor of a class, has no parameters,\nhas the same access modifier as its containing class,\nand does not perform any initialization except explicitly or implicitly calling the superclass constructor without arguments.\nSuch a constructor can be safely removed as it will be generated by the compiler even if not specified.\n\n**Example:**\n\n\n public class Foo {\n public Foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class Foo {}\n\n\nUse the inspection settings to ignore unnecessary constructors that have an annotation.\n\n\nInspection ID: UnnecessaryConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantNoArgConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnreachableCode", + "shortDescription": { + "text": "Unreachable code" + }, + "fullDescription": { + "text": "Reports the code which is never reached according to data flow analysis. It can be the result of previous always-true or always-false condition, unreachable loop body or catch section. Usually (though not always) unreachable code is a consequence of a previous warning, so check inspection warnings form \"Nullability and data flow problems\", \"Constant values\", or \"Redundant operation on empty container\" to better understand the cause. Example: 'void finishApplication() {\n System.exit(0);\n System.out.println(\"Application is terminated\"); // Unreachable code\n }' Note that this inspection relies on method contract inference. In particular, if you call a static or final method that always throws an exception, then the \"always failing\" contract will be inferred, and code after the method call will be considered unreachable. For example: 'void run() {\n performAction();\n System.out.println(\"Action is performed\"); // Unreachable code\n }\n \n static void performAction() {\n throw new AssertionError();\n }' This may cause false-positives if any kind of code postprocessing is used, for example, if an annotation processor later replaces the method body with something useful. To avoid false-positive warnings, suppress the automatic contract inference with explicit '@org.jetbrains.annotations.Contract' annotation from 'org.jetbrains:annotations' package: 'void run() {\n performAction();\n System.out.println(\"Action is performed\"); // No warning anymore\n }\n\n @Contract(\"-> _\") // implementation will be replaced\n static void performAction() {\n throw new AssertionError();\n }' Inspection ID: UnreachableCode New in 2024.1", + "markdown": "Reports the code which is never reached according to data flow analysis. It can be the result of previous always-true or always-false condition, unreachable loop body or catch section. Usually (though not always) unreachable code is a consequence of a previous warning, so check inspection warnings form \"Nullability and data flow problems\", \"Constant values\", or \"Redundant operation on empty container\" to better understand the cause.\n\nExample:\n\n\n void finishApplication() {\n System.exit(0);\n System.out.println(\"Application is terminated\"); // Unreachable code\n }\n\n\nNote that this inspection relies on method contract inference. In particular, if you call a static or final method\nthat always throws an exception, then the \"always failing\" contract will be inferred, and code after the method call\nwill be considered unreachable. For example:\n\n\n void run() {\n performAction();\n System.out.println(\"Action is performed\"); // Unreachable code\n }\n \n static void performAction() {\n throw new AssertionError();\n }\n\n\nThis may cause false-positives if any kind of code postprocessing is used, for example, if an annotation processor\nlater replaces the method body with something useful. To avoid false-positive warnings, suppress the automatic\ncontract inference with explicit `@org.jetbrains.annotations.Contract` annotation from\n`org.jetbrains:annotations` package:\n\n\n void run() {\n performAction();\n System.out.println(\"Action is performed\"); // No warning anymore\n }\n\n @Contract(\"-> _\") // implementation will be replaced\n static void performAction() {\n throw new AssertionError();\n }\n\nInspection ID: UnreachableCode\n\nNew in 2024.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnreachableCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlTagCanBeJavadocTag", + "shortDescription": { + "text": "'' can be replaced with '{@code …}'" + }, + "fullDescription": { + "text": "Reports usages of '' tags in Javadoc comments. Since Java 5, these tags can be replaced with '{@code ...}' constructs. This allows using angle brackets '<' and '>' inside the comment instead of HTML character entities. Example: '/**\n * @return empty ArrayList<Integer>\n */\n List getList(){ ... }' After the quick-fix is applied: '/**\n * @return empty {@code ArrayList}\n */\n List getList(){ ... }' Inspection ID: HtmlTagCanBeJavadocTag", + "markdown": "Reports usages of `` tags in Javadoc comments. Since Java 5, these tags can be replaced with `{@code ...}` constructs. This allows using angle brackets `<` and `>` inside the comment instead of HTML character entities.\n\n**Example:**\n\n\n /**\n * @return empty ArrayList<Integer>\n */\n List getList(){ ... }\n\nAfter the quick-fix is applied:\n\n\n /**\n * @return empty {@code ArrayList}\n */\n List getList(){ ... }\n\nInspection ID: HtmlTagCanBeJavadocTag" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlTagCanBeJavadocTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassEscapesItsScope", + "shortDescription": { + "text": "Class is exposed outside of its visibility scope" + }, + "fullDescription": { + "text": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference. Example: 'public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }' Additionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages. However, if a member that is part of the exported API references a non-exported class in its signature, such a member cannot be used outside of the module. Configure the inspection: Use the Report non-exported classes exposed in module API (Java 9+) option to report module API members that expose non-exported classes. Note that the language level of the project or module needs to be 9 or higher for this option. Use the Report non-accessible classes exposed in public API option to report on public members that expose classes with a smaller visibility scope. Use the Report private classes exposed in package-local API option to report on package-local members that expose 'private' classes. Inspection ID: ClassEscapesItsScope", + "markdown": "Reports usages of classes in a field or method signature where the class has less visibility than the member that uses it. While legal Java, such members cannot be used outside of the visibility scope of the class type they reference.\n\n**Example:**\n\n\n public class Parent {\n public Child getChild() {\n return new Child();\n }\n\n private class Child {}\n }\n\n\nAdditionally, in Java 9 and higher, a module may hide some of its classes from other modules by not exporting their packages.\nHowever, if a member that is part of the exported API references a non-exported class in its signature,\nsuch a member cannot be used outside of the module.\n\nConfigure the inspection:\n\n* Use the **Report non-exported classes exposed in module API (Java 9+)** option to report module API members that expose non-exported classes. \n Note that the language level of the project or module needs to be 9 or higher for this option.\n* Use the **Report non-accessible classes exposed in public API** option to report on public members that expose classes with a smaller visibility scope.\n* Use the **Report private classes exposed in package-local API** option to report on package-local members that expose `private` classes.\n\nInspection ID: ClassEscapesItsScope" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ClassEscapesDefinedScope", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringBufferField", + "shortDescription": { + "text": "'StringBuilder' field" + }, + "fullDescription": { + "text": "Reports fields of type 'java.lang.StringBuffer' or 'java.lang.StringBuilder'. Such fields can grow without limit and are often the cause of memory leaks. Example: 'public class Example {\n private StringBuilder builder = new StringBuilder();\n\n }' Inspection ID: StringBufferField", + "markdown": "Reports fields of type `java.lang.StringBuffer` or `java.lang.StringBuilder`. Such fields can grow without limit and are often the cause of memory leaks.\n\n**Example:**\n\n\n public class Example {\n private StringBuilder builder = new StringBuilder();\n\n }\n\nInspection ID: StringBufferField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringBufferField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Memory", + "index": 69, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantMethodOverride", + "shortDescription": { + "text": "Method is identical to its super method" + }, + "fullDescription": { + "text": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed. Use the first checkbox below to run the inspection for the methods that override library methods. Checking library methods may slow down the inspection. Use the second checkbox below to ignore methods that only delegate calls to their super methods. Inspection ID: RedundantMethodOverride", + "markdown": "Reports methods that are identical to their super methods. Such methods have the same signature as their super method and either have an identical body or only their body consists only of a call to the super method. These methods are redundant and can be removed.\n\n\nUse the first checkbox below to run the inspection for the methods that override library methods.\nChecking library methods may slow down the inspection.\n\n\nUse the second checkbox below to ignore methods that only delegate calls to their super methods.\n\nInspection ID: RedundantMethodOverride" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantMethodOverride", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EqualsUsesNonFinalVariable", + "shortDescription": { + "text": "Non-final field referenced in 'equals()'" + }, + "fullDescription": { + "text": "Reports implementations of 'equals()' that access non-'final' variables. Such access may result in 'equals()' returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes. Example: 'public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }'\n Inspection ID: EqualsUsesNonFinalVariable", + "markdown": "Reports implementations of `equals()` that access non-`final` variables. Such access may result in `equals()` returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes.\n\n**Example:**\n\n\n public class Person {\n private String lastName;\n\n @Override\n public boolean equals(Object obj) {\n ...\n Person other = (Person) obj;\n if (lastName == null) {\n if (!lastName.equals(other.lastName)) {\n return false;\n ...\n }\n }\n }\n \nInspection ID: EqualsUsesNonFinalVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonFinalFieldReferenceInEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassNameSameAsAncestorName", + "shortDescription": { + "text": "Class name same as ancestor name" + }, + "fullDescription": { + "text": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing. Example: 'package util;\n abstract class Iterable implements java.lang.Iterable {}' A quick-fix that renames such classes is available only in the editor. Inspection ID: ClassNameSameAsAncestorName", + "markdown": "Reports classes that have the same name as one of their superclasses, while their fully qualified names remain different. Such class names may be very confusing.\n\n**Example:**\n\n\n package util;\n abstract class Iterable implements java.lang.Iterable {}\n\nA quick-fix that renames such classes is available only in the editor.\n\nInspection ID: ClassNameSameAsAncestorName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassNameSameAsAncestorName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Class", + "index": 68, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ContinueStatementWithLabel", + "shortDescription": { + "text": "'continue' statement with label" + }, + "fullDescription": { + "text": "Reports 'continue' statements with labels. Labeled 'continue' statements complicate refactoring and can be confusing. Example: 'void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) continue outer;\n handleChar(ch);\n }\n }\n }' Inspection ID: ContinueStatementWithLabel", + "markdown": "Reports `continue` statements with labels.\n\nLabeled `continue` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) continue outer;\n handleChar(ch);\n }\n }\n }\n\nInspection ID: ContinueStatementWithLabel" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ContinueStatementWithLabel", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedAssignment", + "shortDescription": { + "text": "Nested assignment" + }, + "fullDescription": { + "text": "Reports assignment expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing. Example: 'String userName;\n // Warning: result of assignment to 'userName' is used\n String message = \"Hello \" + (userName = \"Alice\") + \"!\"\n System.out.println(message);\n System.out.println(\"Goodbye \" + userName);' Inspection ID: NestedAssignment", + "markdown": "Reports assignment expressions that are nested inside other expressions.\n\nSuch expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing.\n\n**Example:**\n\n\n String userName;\n // Warning: result of assignment to 'userName' is used\n String message = \"Hello \" + (userName = \"Alice\") + \"!\"\n System.out.println(message);\n System.out.println(\"Goodbye \" + userName);\n\nInspection ID: NestedAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifiableBooleanExpression", + "shortDescription": { + "text": "Simplifiable boolean expression" + }, + "fullDescription": { + "text": "Reports boolean expressions that can be simplified. Example: 'void f(boolean foo, boolean bar) {\n boolean b = !(foo ^ bar);\n }' After the quick-fix is applied: 'void f(boolean foo, boolean bar) {\n boolean b = foo == bar;\n }' Example: 'void f(boolean foo, boolean bar) {\n boolean b = (foo && bar) || !foo;\n }' After the quick-fix is applied: 'void f(boolean foo, boolean bar) {\n boolean b = !foo || bar;\n }' Inspection ID: SimplifiableBooleanExpression", + "markdown": "Reports boolean expressions that can be simplified.\n\nExample:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = !(foo ^ bar);\n }\n\nAfter the quick-fix is applied:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = foo == bar;\n }\n\nExample:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = (foo && bar) || !foo;\n }\n \nAfter the quick-fix is applied:\n\n\n void f(boolean foo, boolean bar) {\n boolean b = !foo || bar;\n }\n \nInspection ID: SimplifiableBooleanExpression" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SimplifiableBooleanExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AutoUnboxing", + "shortDescription": { + "text": "Auto-unboxing" + }, + "fullDescription": { + "text": "Reports expressions that are affected by unboxing conversion (automatic unwrapping of objects into primitive values). Try not to use objects instead of primitives. It might significantly affect the performance. Example: 'int x = new Integer(42);' The quick-fix makes the conversion explicit: 'int x = new Integer(42).intValue();' AutoUnboxing appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: AutoUnboxing", + "markdown": "Reports expressions that are affected by unboxing conversion (automatic unwrapping of objects into primitive values). Try not to use objects instead of primitives. It might significantly affect the performance.\n\n**Example:**\n\n int x = new Integer(42);\n\nThe quick-fix makes the conversion explicit:\n\n int x = new Integer(42).intValue();\n\n\n*AutoUnboxing* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: AutoUnboxing" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AutoUnboxing", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringConcatenationInMessageFormatCall", + "shortDescription": { + "text": "String concatenation as argument to 'MessageFormat.format()' call" + }, + "fullDescription": { + "text": "Reports non-constant string concatenations used as an argument to a call to 'MessageFormat.format()'. While occasionally intended, this is usually a misuse of the formatting method and may even cause unexpected exceptions if the variables used in the concatenated string contain special characters like '{'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }' Here, the 'userName' will be interpreted as a part of the format string, which may result in 'IllegalArgumentException' (for example, if 'userName' is '\"{\"'). This call should be probably replaced with 'MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)'. Inspection ID: StringConcatenationInMessageFormatCall", + "markdown": "Reports non-constant string concatenations used as an argument to a call to `MessageFormat.format()`.\n\n\nWhile occasionally intended, this is usually a misuse of the formatting method\nand may even cause unexpected exceptions if the variables used in the concatenated string contain\nspecial characters like `{`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n String formatGreeting(String userName, int balance) {\n return MessageFormat.format(\"Hello, \" + userName + \"! Your balance is {0}.\", balance);\n }\n\n\nHere, the `userName` will be interpreted as a part of the format string, which may result\nin `IllegalArgumentException` (for example, if `userName` is `\"{\"`).\nThis call should be probably replaced with `MessageFormat.format(\"Hello, {0}! Your balance is {1}.\", userName, balance)`.\n\nInspection ID: StringConcatenationInMessageFormatCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringConcatenationInMessageFormatCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonFinalFieldInImmutable", + "shortDescription": { + "text": "Non-final field in '@Immutable' class" + }, + "fullDescription": { + "text": "Reports any non-final field in a class with the '@Immutable' annotation. This violates the contract of the '@Immutable' annotation. Example: 'import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy' Inspection ID: NonFinalFieldInImmutable", + "markdown": "Reports any non-final field in a class with the `@Immutable` annotation. This violates the contract of the `@Immutable` annotation.\n\nExample:\n\n\n import javax.annotation.concurrent.Immutable;\n @Immutable\n class Foo {\n String bar = \"foo\";\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`\n\nInspection ID: NonFinalFieldInImmutable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonFinalFieldInImmutable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Concurrency annotation issues", + "index": 60, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CallToStringConcatCanBeReplacedByOperator", + "shortDescription": { + "text": "Call to 'String.concat()' can be replaced with '+'" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.String.concat()'. Such calls can be replaced with the '+' operator for clarity and possible increased performance if the method was invoked on a constant with a constant argument. Example: 'String foo(String name) {\n return name.concat(\"foo\");\n }' After the quick-fix is applied: 'String foo(String name) {\n return name + \"foo\";\n }' Inspection ID: CallToStringConcatCanBeReplacedByOperator", + "markdown": "Reports calls to `java.lang.String.concat()`.\n\n\nSuch calls can be replaced with the `+` operator for clarity and possible increased\nperformance if the method was invoked on a constant with a constant argument.\n\n**Example:**\n\n\n String foo(String name) {\n return name.concat(\"foo\");\n }\n\nAfter the quick-fix is applied:\n\n\n String foo(String name) {\n return name + \"foo\";\n }\n\nInspection ID: CallToStringConcatCanBeReplacedByOperator" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToStringConcatCanBeReplacedByOperator", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SignalWithoutCorrespondingAwait", + "shortDescription": { + "text": "'signal()' without corresponding 'await()'" + }, + "fullDescription": { + "text": "Reports calls to 'Condition.signal()' or 'Condition.signalAll()' for which no call to a corresponding 'Condition.await()' can be found. Only calls that target fields of the current class are reported by this inspection. Example: 'class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n isEmpty.signal(); // warning: Call to 'signal()' without corresponding 'await()'\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n // isEmpty.await();\n // ...\n }\n }' Inspection ID: SignalWithoutCorrespondingAwait", + "markdown": "Reports calls to `Condition.signal()` or `Condition.signalAll()` for which no call to a corresponding `Condition.await()` can be found.\n\nOnly calls that target fields of the current class are reported by this inspection.\n\n**Example:**\n\n\n class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n isEmpty.signal(); // warning: Call to 'signal()' without corresponding 'await()'\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n // isEmpty.await();\n // ...\n }\n }\n\nInspection ID: SignalWithoutCorrespondingAwait" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SignalWithoutCorrespondingAwait", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FoldExpressionIntoStream", + "shortDescription": { + "text": "Expression can be folded into Stream chain" + }, + "fullDescription": { + "text": "Reports expressions with a repeating pattern that could be replaced with Stream API or a 'String.join()' call. Example: 'boolean allStartWith(String a, String b, String c, String d, String prefix) {\n return a.startsWith(prefix) && b.startsWith(prefix) && c.startsWith(prefix) && d.startsWith(prefix);\n }' After the quick-fix is applied: 'boolean foo(String a, String b, String c, String d, String prefix) {\n return Stream.of(a, b, c, d).allMatch(s -> s.startsWith(prefix));\n }' Example: 'String joinAll(String a, String b, String c, String d) {\n return a + \",\" + b + \",\" + c + \",\" + d;\n }' After the quick-fix is applied: 'String joinAll(String a, String b, String c, String d) {\n return String.join(\",\", a, b, c, d);\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: FoldExpressionIntoStream New in 2018.2", + "markdown": "Reports expressions with a repeating pattern that could be replaced with *Stream API* or a `String.join()` call.\n\nExample:\n\n\n boolean allStartWith(String a, String b, String c, String d, String prefix) {\n return a.startsWith(prefix) && b.startsWith(prefix) && c.startsWith(prefix) && d.startsWith(prefix);\n }\n\nAfter the quick-fix is applied:\n\n\n boolean foo(String a, String b, String c, String d, String prefix) {\n return Stream.of(a, b, c, d).allMatch(s -> s.startsWith(prefix));\n }\n\nExample:\n\n\n String joinAll(String a, String b, String c, String d) {\n return a + \",\" + b + \",\" + c + \",\" + d;\n }\n\nAfter the quick-fix is applied:\n\n\n String joinAll(String a, String b, String c, String d) {\n return String.join(\",\", a, b, c, d);\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: FoldExpressionIntoStream\n\nNew in 2018.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "FoldExpressionIntoStream", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HardcodedFileSeparators", + "shortDescription": { + "text": "Hardcoded file separator" + }, + "fullDescription": { + "text": "Reports the forward ('/') or backward ('\\') slash in a string or character literal. These characters are commonly used as file separators, and portability may suffer if they are hardcoded. The inspection will not report backward slashes inside escape sequences and forward slashes immediately following the '<' character or immediately preceding the '>' character, as those often indicate XML or HTML tags rather than file names. Strings representing a 'java.util.TimeZone' ID, strings that are valid regular expressions, or strings that equal IANA-registered MIME media types will not be reported either. Example: 'new File(\"C:\\\\Users\\\\Name\");' Use the option to include 'example/*' in the set of recognized media types. Normally, usage of the 'example/*' MIME media type outside of an example (e.g. in a 'Content-Type' header) is an error. Inspection ID: HardcodedFileSeparators", + "markdown": "Reports the forward (`/`) or backward (`\\`) slash in a string or character literal. These characters are commonly used as file separators, and portability may suffer if they are hardcoded.\n\n\nThe inspection will not report backward slashes inside escape sequences and forward slashes immediately following the '\\<' character\nor immediately preceding the '\\>' character, as those often indicate XML or HTML tags rather than file names.\nStrings representing a `java.util.TimeZone` ID, strings that are valid regular expressions,\nor strings that equal IANA-registered MIME media types will not be reported either.\n\n**Example:**\n\n\n new File(\"C:\\\\Users\\\\Name\");\n\n\nUse the option to include `example/*` in the set of recognized media types.\nNormally, usage of the `example/*` MIME media type outside of an example (e.g. in a `Content-Type`\nheader) is an error.\n\nInspection ID: HardcodedFileSeparators" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HardcodedFileSeparator", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerializableDeserializableClassInSecureContext", + "shortDescription": { + "text": "Serializable class in secure context" + }, + "fullDescription": { + "text": "Reports classes that may be serialized or deserialized. A class may be serialized if it supports the 'Serializable' interface, and its 'readObject()' and 'writeObject()' methods are not defined to always throw an exception. Serializable classes may be dangerous in code intended for secure use. Example: 'class DeserializableClass implements Serializable { // the class doesn't contain 'writeObject()' method throwing an exception\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n}' After the quick-fix is applied: 'class DeserializableClass implements Serializable {\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n\n private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {\n throw new java.io.NotSerializableException(\"DeserializableClass\");\n }\n }' Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Note that it still may be more secure to add 'readObject()' and 'writeObject()' methods which always throw an exception, instead of ignoring those classes. Whether to ignore serializable anonymous classes. Inspection ID: SerializableDeserializableClassInSecureContext", + "markdown": "Reports classes that may be serialized or deserialized.\n\n\nA class may be serialized if it supports the `Serializable` interface,\nand its `readObject()` and `writeObject()` methods are not defined to always\nthrow an exception. Serializable classes may be dangerous in code intended for secure use.\n\n**Example:**\n\n\n class DeserializableClass implements Serializable { // the class doesn't contain 'writeObject()' method throwing an exception\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class DeserializableClass implements Serializable {\n private int sensitive = 736326;\n\n private void readObject(ObjectInputStream in) {\n throw new Error();\n }\n\n private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {\n throw new java.io.NotSerializableException(\"DeserializableClass\");\n }\n }\n\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization. Note that it still may be more secure to add `readObject()` and `writeObject()` methods which always throw an exception, instead of ignoring those classes.\n* Whether to ignore serializable anonymous classes.\n\nInspection ID: SerializableDeserializableClassInSecureContext" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SerializableDeserializableClassInSecureContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConfusingFloatingPointLiteral", + "shortDescription": { + "text": "Confusing floating-point literal" + }, + "fullDescription": { + "text": "Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point. Such literals may be confusing, and violate several coding standards. Example: 'double d = .03;' After the quick-fix is applied: 'double d = 0.03;' Use the Ignore floating point literals in scientific notation option to ignore floating point numbers in scientific notation. Inspection ID: ConfusingFloatingPointLiteral", + "markdown": "Reports any floating point numbers that don't have a decimal point, numbers before the decimal point, or numbers after the decimal point.\n\nSuch literals may be confusing, and violate several coding standards.\n\n**Example:**\n\n double d = .03;\n\nAfter the quick-fix is applied:\n\n double d = 0.03;\n\n\nUse the **Ignore floating point literals in scientific notation** option to ignore floating point numbers in scientific notation.\n\nInspection ID: ConfusingFloatingPointLiteral" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConfusingFloatingPointLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaModuleNaming", + "shortDescription": { + "text": "Java module name violates convention" + }, + "fullDescription": { + "text": "Reports module names in 'module-info.java' that violate the Java Platform Module System recommendation to avoid encoding version information in module names by ending the name with one or more digits. Example: 'module foo.bar2 {}' After the quick-fix is applied: 'module foo.bar {}' Inspection ID: JavaModuleNaming", + "markdown": "Reports module names in `module-info.java` that violate the Java Platform Module System [recommendation](http://mail.openjdk.org/pipermail/jpms-spec-experts/2017-March/000659.html) to avoid encoding version information in module names by ending the name with one or more digits.\n\n**Example:**\n\n\n module foo.bar2 {}\n\nAfter the quick-fix is applied:\n\n\n module foo.bar {}\n\nInspection ID: JavaModuleNaming" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "module", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavadocReference", + "shortDescription": { + "text": "Declaration has problems in Javadoc references" + }, + "fullDescription": { + "text": "Reports unresolved references inside Javadoc comments. In the following example, the 'someParam' parameter is missing, so it will be highlighted: 'class A {\n /**\n * @param someParam description\n **/\n void foo() {\n }\n}' Disable the Report inaccessible symbols option to ignore the tags that reference missing method parameters, classes, fields and methods. Inspection ID: JavadocReference", + "markdown": "Reports unresolved references inside Javadoc comments.\n\nIn the following example, the `someParam` parameter is missing, so it will be highlighted:\n\n\n class A {\n /**\n * @param someParam description\n **/\n void foo() {\n }\n }\n\n\nDisable the **Report inaccessible symbols** option to ignore the tags that reference missing method parameters,\nclasses, fields and methods.\n\nInspection ID: JavadocReference" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JavadocReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnaryPlus", + "shortDescription": { + "text": "Unary plus" + }, + "fullDescription": { + "text": "Reports usages of the '+' unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in '+++') or with the equal operator (like in '=+'). Example: 'void unaryPlus(int i) {\n int x = + +i;\n }' The following quick fixes are suggested: Remove '+' operators before the 'i' variable: 'void unaryPlus(int i) {\n int x = i;\n }' Replace '+' operators with the prefix increment operator: 'void unaryPlus(int i) {\n int x = ++i;\n }' Use the checkbox below to report unary pluses that are used together with a binary or another unary expression. It means the inspection will not report situations when a unary plus expression is used in array initializer expressions or as a method argument. Inspection ID: UnaryPlus", + "markdown": "Reports usages of the `+` unary operator. The unary plus is usually a null operation, and its presence might represent a coding error. For example, in a combination with the increment operator (like in `+++`) or with the equal operator (like in `=+`).\n\n**Example:**\n\n\n void unaryPlus(int i) {\n int x = + +i;\n }\n\nThe following quick fixes are suggested:\n\n* Remove `+` operators before the `i` variable:\n\n\n void unaryPlus(int i) {\n int x = i;\n }\n\n* Replace `+` operators with the prefix increment operator:\n\n\n void unaryPlus(int i) {\n int x = ++i;\n }\n\n\nUse the checkbox below to report unary pluses that are used together with a binary or another unary expression.\nIt means the inspection will not report situations when a unary plus expression is used in array\ninitializer expressions or as a method argument.\n\nInspection ID: UnaryPlus" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnaryPlus", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstructorCount", + "shortDescription": { + "text": "Class with too many constructors" + }, + "fullDescription": { + "text": "Reports classes whose number of constructors exceeds the specified maximum. Classes with too many constructors are prone to initialization errors, and often modeling such a class as multiple subclasses is preferable. Configure the inspection: Use the Constructor count limit field to specify the maximum allowed number of constructors in a class. Use the Ignore deprecated constructors option to avoid adding deprecated constructors to the total count. Inspection ID: ConstructorCount", + "markdown": "Reports classes whose number of constructors exceeds the specified maximum.\n\nClasses with too many constructors are prone to initialization errors, and often modeling such a class as multiple subclasses is preferable.\n\nConfigure the inspection:\n\n* Use the **Constructor count limit** field to specify the maximum allowed number of constructors in a class.\n* Use the **Ignore deprecated constructors** option to avoid adding deprecated constructors to the total count.\n\nInspection ID: ConstructorCount" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithTooManyConstructors", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class metrics", + "index": 90, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncrementDecrementUsedAsExpression", + "shortDescription": { + "text": "Result of '++' or '--' used" + }, + "fullDescription": { + "text": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing. The quick-fix extracts the increment or decrement operation to a separate expression statement. Example: 'int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }' After the quick-fix is applied: 'int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;' Inspection ID: IncrementDecrementUsedAsExpression", + "markdown": "Reports increment or decrement expressions that are nested inside other expressions. Such expressions may be confusing and violate the general design principle, which states that any construct should do precisely one thing.\n\nThe quick-fix extracts the increment or decrement operation to a separate expression statement.\n\n**Example:**\n\n\n int i = 10;\n while (i-- > 0) {\n System.out.println(i);\n }\n\nAfter the quick-fix is applied:\n\n\n int i = 10;\n while (i > 0) {\n i--;\n System.out.println(i);\n }\n i--;\n\nInspection ID: IncrementDecrementUsedAsExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ValueOfIncrementOrDecrementUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DisjointPackage", + "shortDescription": { + "text": "Package with disjoint dependency graph" + }, + "fullDescription": { + "text": "Reports packages whose classes can be separated into mutually independent subsets. Such disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: DisjointPackage", + "markdown": "Reports packages whose classes can be separated into mutually independent subsets.\n\nSuch disjoint packages indicate ad-hoc packaging or a lack of conceptual cohesion.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: DisjointPackage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DisjointPackage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Packaging issues", + "index": 38, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodOverloadsParentMethod", + "shortDescription": { + "text": "Possibly unintended overload of method from superclass" + }, + "fullDescription": { + "text": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type. In this case, the method in a subclass will be overloading the method from the superclass instead of overriding it. If it is unintended, it may result in latent bugs. Example: 'public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }' Use the option to choose whether the inspection should also report cases where parameter types are not compatible. Inspection ID: MethodOverloadsParentMethod", + "markdown": "Reports instance methods with the same name and the same number of parameters as a method in a superclass, but where at least one of the parameters is of a different incompatible type.\n\n\nIn this case, the method in a subclass will be overloading the method from the superclass\ninstead of overriding it. If it is unintended, it may result in latent bugs.\n\n**Example:**\n\n\n public class Foo {\n void foo(int x) {}\n }\n\n public class Bar extends Foo {\n void foo(Number x) {} // Method 'foo()' overloads a compatible method of a superclass,\n // when overriding might have been intended\n }\n\n\nUse the option to choose whether the inspection should also report cases where parameter types are not compatible.\n\n\nInspection ID: MethodOverloadsParentMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodOverloadsMethodOfSuperclass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UpperCaseFieldNameNotConstant", + "shortDescription": { + "text": "Non-constant field with upper-case name" + }, + "fullDescription": { + "text": "Reports non-'static' non-'final' fields whose names are all in upper case. Such fields may cause confusion by breaking a common naming convention and are often used by mistake. Example: 'public static int THE_ANSWER = 42; //a warning here: final modifier is missing' A quick-fix that renames such fields is available only in the editor. Inspection ID: UpperCaseFieldNameNotConstant", + "markdown": "Reports non-`static` non-`final` fields whose names are all in upper case.\n\nSuch fields may cause confusion by breaking a common naming convention and\nare often used by mistake.\n\n**Example:**\n\n\n public static int THE_ANSWER = 42; //a warning here: final modifier is missing\n\nA quick-fix that renames such fields is available only in the editor.\n\nInspection ID: UpperCaseFieldNameNotConstant" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonConstantFieldWithUpperCaseName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodMayBeSynchronized", + "shortDescription": { + "text": "Method with single 'synchronized' block can be replaced with 'synchronized' method" + }, + "fullDescription": { + "text": "Reports methods whose body contains a single 'synchronized' statement. A lock expression for this 'synchronized' statement must be equal to 'this' for instance methods or '[ClassName].class' for static methods. To improve readability of such methods, you can remove the 'synchronized' wrapper and mark the method as 'synchronized'. Example: 'public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }' After the quick-fix is applied: 'public synchronized int generateInt(int x) {\n return 1;\n }' Inspection ID: MethodMayBeSynchronized", + "markdown": "Reports methods whose body contains a single `synchronized` statement. A lock expression for this `synchronized` statement must be equal to `this` for instance methods or `[ClassName].class` for static methods.\n\n\nTo improve readability of such methods,\nyou can remove the `synchronized` wrapper and mark the method as `synchronized`.\n\n**Example:**\n\n\n public int generateInt(int x) {\n synchronized (this) {\n return 1;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public synchronized int generateInt(int x) {\n return 1;\n }\n\nInspection ID: MethodMayBeSynchronized" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodMayBeSynchronized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoggingPlaceholderCountMatchesArgumentCount", + "shortDescription": { + "text": "Number of placeholders does not match number of arguments in logging call" + }, + "fullDescription": { + "text": "Reports SLF4J, Log4j2 and akka.event.LoggingAdapter logging calls, such as 'logger.info(\"{}: {}\", key)' where the number of '{}' placeholders in the logger message doesn't match the number of other arguments to the logging call. Use the inspection option to specify which implementation SLF4J uses. If Check automatically is chosen, then 'org.apache.logging.slf4j.Log4jLogger' is searched in the classpath. If this file is founded or Yes is chosen, then cases, when the last parameter with an exception type has a placeholder, will not be reported for SLFJ4 API. For example: '//this case will not be reported with \"Yes\" option\nlog.error(\"For id {}: {}\", \"1\", new RuntimeException());' In this case 'new RuntimeException()' will be printed using 'toString()', (its stacktrace will not be printed): 'For id 1: java.lang.RuntimeException' Otherwise, it will be highlighted because the last placeholder is not used: 'For id 1: {}\njava.lang.RuntimeException: null' No option can be used to always highlight such cases when a placeholder is used for an exception even if 'org.apache.logging.slf4j.Log4jLogger' is used as a backend. This option works only for SLF4J. Inspection ID: LoggingPlaceholderCountMatchesArgumentCount", + "markdown": "Reports SLF4J, Log4j2 and akka.event.LoggingAdapter logging calls, such as `logger.info(\"{}: {}\", key)` where the number of `{}` placeholders in the logger message doesn't match the number of other arguments to the logging call.\n\n\nUse the inspection option to specify which implementation SLF4J uses.\nIf **Check automatically** is chosen, then `org.apache.logging.slf4j.Log4jLogger` is searched in the classpath.\nIf this file is founded or **Yes** is chosen, then cases, when the last parameter with an exception type has a placeholder,\nwill not be reported for SLFJ4 API. \n\nFor example:\n\n\n //this case will not be reported with \"Yes\" option\n log.error(\"For id {}: {}\", \"1\", new RuntimeException());\n\nIn this case 'new RuntimeException()' will be printed using 'toString()', (its stacktrace will not be printed):\n\n\n For id 1: java.lang.RuntimeException\n\nOtherwise, it will be highlighted because the last placeholder is not used:\n\n\n For id 1: {}\n java.lang.RuntimeException: null\n\n**No** option can be used to always highlight such cases when a placeholder is used for an exception even if `org.apache.logging.slf4j.Log4jLogger` is used as a backend. \nThis option works only for SLF4J.\n\n\nInspection ID: LoggingPlaceholderCountMatchesArgumentCount" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "LoggingPlaceholderCountMatchesArgumentCount", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Logging", + "index": 46, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Convert2streamapi", + "shortDescription": { + "text": "Loop can be collapsed with Stream API" + }, + "fullDescription": { + "text": "Reports loops which can be replaced with stream API calls using lambda expressions. Such a replacement changes the style from imperative to more functional and makes the code more compact. Example: 'boolean check(List data) {\n for (String e : data) {\n String trimmed = e.trim();\n if (!trimmed.startsWith(\"xyz\")) {\n return false;\n }\n }\n return true;\n }' After the quick-fix is applied: 'boolean check(List data) {\n return data.stream().map(String::trim).allMatch(trimmed -> trimmed.startsWith(\"xyz\"));\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: Convert2streamapi", + "markdown": "Reports loops which can be replaced with stream API calls using lambda expressions.\n\nSuch a replacement changes the style from imperative to more functional and makes the code more compact.\n\nExample:\n\n\n boolean check(List data) {\n for (String e : data) {\n String trimmed = e.trim();\n if (!trimmed.startsWith(\"xyz\")) {\n return false;\n }\n }\n return true;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean check(List data) {\n return data.stream().map(String::trim).allMatch(trimmed -> trimmed.startsWith(\"xyz\"));\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: Convert2streamapi" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "Convert2streamapi", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerialPersistentFieldsWithWrongSignature", + "shortDescription": { + "text": "'serialPersistentFields' field not declared 'private static final ObjectStreamField[]'" + }, + "fullDescription": { + "text": "Reports 'Serializable' classes whose 'serialPersistentFields' field is not declared as 'private static final ObjectStreamField[]'. If a 'serialPersistentFields' field is not declared with those modifiers, the serialization behavior will be as if the field was not declared at all. Example: 'class List implements Serializable {\n private List next;\n\n ObjectStreamField[] serialPersistentFields = {new ObjectStreamField(\"next\", List.class)};\n\n }' Inspection ID: SerialPersistentFieldsWithWrongSignature", + "markdown": "Reports `Serializable` classes whose `serialPersistentFields` field is not declared as `private static final ObjectStreamField[]`.\n\n\nIf a `serialPersistentFields` field is not declared with those modifiers,\nthe serialization behavior will be as if the field was not declared at all.\n\n**Example:**\n\n\n class List implements Serializable {\n private List next;\n\n ObjectStreamField[] serialPersistentFields = {new ObjectStreamField(\"next\", List.class)};\n\n }\n\nInspection ID: SerialPersistentFieldsWithWrongSignature" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SerialPersistentFieldsWithWrongSignature", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComparatorResultComparison", + "shortDescription": { + "text": "Suspicious usage of compare method" + }, + "fullDescription": { + "text": "Reports comparisons of the result of 'Comparator.compare()' or 'Comparable.compareTo()' calls with non-zero constants. By contract, these methods can return any integer (not just -1, 0 or 1), so comparing against particular numbers is bad practice. Some widely used comparison methods (e.g. 'String.compareTo()') actually return values outside the [-1..1] range, and such a comparison may cause incorrect program behavior. Example: 'void validate(String s1, String s2) {\n // Comparing to 1 is incorrect\n if (s1.compareTo(s2) == 1) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }' After the quick-fix is applied: 'void validate(String s1, String s2) {\n if (s1.compareTo(s2) > 0) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }' Inspection ID: ComparatorResultComparison New in 2017.2", + "markdown": "Reports comparisons of the result of `Comparator.compare()` or `Comparable.compareTo()` calls with non-zero constants. By contract, these methods can return any integer (not just -1, 0 or 1), so comparing against particular numbers is bad practice. Some widely used comparison methods (e.g. `String.compareTo()`) actually return values outside the \\[-1..1\\] range, and such a comparison may cause incorrect program behavior.\n\nExample:\n\n\n void validate(String s1, String s2) {\n // Comparing to 1 is incorrect\n if (s1.compareTo(s2) == 1) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void validate(String s1, String s2) {\n if (s1.compareTo(s2) > 0) {\n throw new IllegalArgumentException(\"Incorrect order\");\n }\n }\n\nInspection ID: ComparatorResultComparison\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ComparatorResultComparison", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ListIndexOfReplaceableByContains", + "shortDescription": { + "text": "'List.indexOf()' expression can be replaced with 'contains()'" + }, + "fullDescription": { + "text": "Reports any 'List.indexOf()' expressions that can be replaced with the 'List.contains()' method. Example: 'boolean hasEmptyString(List list) {\n // Warning: can be simplified\n return list.indexOf(\"\") >= 0;\n }' The provided quick-fix replaces the 'indexOf' call with the 'contains' call: 'boolean hasEmptyString(List list) {\n // Quick-fix is applied\n return list.contains(\"\");\n }' Inspection ID: ListIndexOfReplaceableByContains", + "markdown": "Reports any `List.indexOf()` expressions that can be replaced with the `List.contains()` method.\n\nExample:\n\n\n boolean hasEmptyString(List list) {\n // Warning: can be simplified\n return list.indexOf(\"\") >= 0;\n }\n\nThe provided quick-fix replaces the `indexOf` call with the `contains` call:\n\n\n boolean hasEmptyString(List list) {\n // Quick-fix is applied\n return list.contains(\"\");\n }\n\nInspection ID: ListIndexOfReplaceableByContains" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ListIndexOfReplaceableByContains", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonStrictComparisonCanBeEquality", + "shortDescription": { + "text": "Non-strict inequality '>=' or '<=' can be replaced with '=='" + }, + "fullDescription": { + "text": "Reports inequality conditions that, according to data flow analysis, can be satisfied only for a single operand value. Such conditions could be replaced with equality conditions to make the code clearer. Example: 'if (x >= 10) {\n ...\n if (x <= 10) { // can be replaced with 'x == 10'\n }\n }' Inspection ID: NonStrictComparisonCanBeEquality New in 2022.2", + "markdown": "Reports inequality conditions that, according to data flow analysis, can be satisfied only for a single operand value. Such conditions could be replaced with equality conditions to make the code clearer.\n\nExample:\n\n\n if (x >= 10) {\n ...\n if (x <= 10) { // can be replaced with 'x == 10'\n }\n }\n\nInspection ID: NonStrictComparisonCanBeEquality\n\nNew in 2022.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "NonStrictComparisonCanBeEquality", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryParentheses", + "shortDescription": { + "text": "Unnecessary parentheses" + }, + "fullDescription": { + "text": "Reports any instance of unnecessary parentheses. Parentheses are considered unnecessary if the evaluation order of an expression remains unchanged after you remove the parentheses. Example: 'int n = 3 + (9 * 8);' After quick-fix is applied: 'int n = 3 + 9 * 8;' Configure the inspection: Use the Ignore clarifying parentheses option to ignore parentheses that help clarify a binary expression. Parentheses are clarifying if the parenthesized expression is an 'instanceof' expression that is a part of a larger expression or has a different operator than the parent expression. Use the Ignore parentheses around the condition of conditional expressions option to ignore any parentheses around the condition of conditional expressions. Some coding standards specify that all such conditions must be surrounded by parentheses. Use the Ignore parentheses around single no formal type lambda parameter option to ignore parentheses around a single lambda parameter within a lambda expression. Inspection ID: UnnecessaryParentheses", + "markdown": "Reports any instance of unnecessary parentheses.\n\nParentheses are considered unnecessary if the evaluation order of an expression remains\nunchanged after you remove the parentheses.\n\nExample:\n\n\n int n = 3 + (9 * 8);\n\nAfter quick-fix is applied:\n\n\n int n = 3 + 9 * 8;\n\nConfigure the inspection:\n\n* Use the **Ignore clarifying parentheses** option to ignore parentheses that help clarify a binary expression. Parentheses are clarifying if the parenthesized expression is an `instanceof` expression that is a part of a larger expression or has a different operator than the parent expression.\n* Use the **Ignore parentheses around the condition of conditional expressions** option to ignore any parentheses around the condition of conditional expressions. Some coding standards specify that all such conditions must be surrounded by parentheses.\n* Use the **Ignore parentheses around single no formal type lambda parameter** option to ignore parentheses around a single lambda parameter within a lambda expression.\n\nInspection ID: UnnecessaryParentheses" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UnnecessaryParentheses", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ImplicitArrayToString", + "shortDescription": { + "text": "Call to 'toString()' on array" + }, + "fullDescription": { + "text": "Reports arrays used in 'String' concatenations or passed as parameters to 'java.io.PrintStream' methods, such as 'System.out.println()'. Usually, the content of the array is meant to be used and not the array object itself. Example: 'void print(Object[] objects) {\n System.out.println(objects);\n }' After the quick-fix is applied: 'void print(Object[] objects) {\n System.out.println(Arrays.toString(objects));\n }' Inspection ID: ImplicitArrayToString", + "markdown": "Reports arrays used in `String` concatenations or passed as parameters to `java.io.PrintStream` methods, such as `System.out.println()`.\n\n\nUsually, the content of the array is meant to be used and not the array object itself.\n\n**Example:**\n\n\n void print(Object[] objects) {\n System.out.println(objects);\n }\n\nAfter the quick-fix is applied:\n\n\n void print(Object[] objects) {\n System.out.println(Arrays.toString(objects));\n }\n\nInspection ID: ImplicitArrayToString" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ImplicitArrayToString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReuseOfLocalVariable", + "shortDescription": { + "text": "Reuse of local variable" + }, + "fullDescription": { + "text": "Reports local variables that are \"reused\" overwriting their values with new values unrelated to their original use. Such a local variable reuse may be confusing, as the intended semantics of the local variable may vary with each use. It may also be prone to bugs if due to the code changes, the values that have been considered overwritten actually appear to be alive. It is a good practice to keep variable lifetimes as short as possible, and not to reuse local variables for the sake of brevity. Example: 'void x() {\n String s = \"one\";\n System.out.println(\"s = \" + s);\n s = \"two\"; //reuse of local variable 's'\n System.out.println(\"s = \" + s);\n }' Inspection ID: ReuseOfLocalVariable", + "markdown": "Reports local variables that are \"reused\" overwriting their values with new values unrelated to their original use.\n\nSuch a local variable reuse may be confusing,\nas the intended semantics of the local variable may vary with each use. It may also be\nprone to bugs if due to the code changes, the values that have been considered overwritten actually\nappear to be alive. It is a good practice to keep variable lifetimes as short as possible, and not\nto reuse local variables for the sake of brevity.\n\nExample:\n\n\n void x() {\n String s = \"one\";\n System.out.println(\"s = \" + s);\n s = \"two\"; //reuse of local variable 's'\n System.out.println(\"s = \" + s);\n }\n\nInspection ID: ReuseOfLocalVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReuseOfLocalVariable", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Data flow", + "index": 22, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BooleanMethodNameMustStartWithQuestion", + "shortDescription": { + "text": "Boolean method name must start with question word" + }, + "fullDescription": { + "text": "Reports boolean methods whose names do not start with a question word. Boolean methods that override library methods are ignored by this inspection. Example: 'boolean empty(List list) {\n return list.isEmpty();\n}' A quick-fix that renames such methods is available only in the editor. Configure the inspection: Use the Boolean method name prefixes list to specify acceptable question words to start boolean method names with. Use the Ignore methods with 'java.lang.Boolean' return type option to ignore methods with the 'java.lang.Boolean' return type. Use the Ignore boolean methods in an @interface option to ignore boolean methods in annotation types ('@interface'). Use the Ignore methods overriding/implementing a super method to ignore methods the have supers. Inspection ID: BooleanMethodNameMustStartWithQuestion", + "markdown": "Reports boolean methods whose names do not start with a question word.\n\nBoolean methods that override library methods are ignored by this inspection.\n\n**Example:**\n\n boolean empty(List list) {\n return list.isEmpty();\n }\n\nA quick-fix that renames such methods is available only in the editor.\n\nConfigure the inspection:\n\n* Use the **Boolean method name prefixes** list to specify acceptable question words to start boolean method names with.\n* Use the **Ignore methods with 'java.lang.Boolean' return type** option to ignore methods with the `java.lang.Boolean` return type.\n* Use the **Ignore boolean methods in an @interface** option to ignore boolean methods in annotation types (`@interface`).\n* Use the **Ignore methods overriding/implementing a super method** to ignore methods the have supers.\n\nInspection ID: BooleanMethodNameMustStartWithQuestion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BooleanMethodNameMustStartWithQuestion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Method", + "index": 91, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousToArrayCall", + "shortDescription": { + "text": "Suspicious 'Collection.toArray()' call" + }, + "fullDescription": { + "text": "Reports suspicious calls to 'Collection.toArray()'. The following types of calls are considered suspicious: when the type of the array argument is not the same as the array type to which the result is casted. when the type of the array argument does not match the type parameter in the collection declaration. Example: 'void m1(List list) {\n Number[] ns = (Number[]) list.toArray(new String[0]);\n}\n\nvoid m2(List list) {\n Number[] ns = list.toArray(new String[0]);\n}' Inspection ID: SuspiciousToArrayCall", + "markdown": "Reports suspicious calls to `Collection.toArray()`.\n\nThe following types of calls are considered suspicious:\n\n* when the type of the array argument is not the same as the array type to which the result is casted.\n* when the type of the array argument does not match the type parameter in the collection declaration.\n\n**Example:**\n\n\n void m1(List list) {\n Number[] ns = (Number[]) list.toArray(new String[0]);\n }\n\n void m2(List list) {\n Number[] ns = list.toArray(new String[0]);\n }\n\nInspection ID: SuspiciousToArrayCall" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousToArrayCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringToUpperWithoutLocale", + "shortDescription": { + "text": "Call to 'String.toUpperCase()' or 'toLowerCase()' without locale" + }, + "fullDescription": { + "text": "Reports 'toUpperCase()' or 'toLowerCase()' calls on 'String' objects that do not specify a 'java.util.Locale'. In these cases the default system locale is used, which can cause problems in an internationalized environment. For example the code '\"i\".toUpperCase().equals(\"I\")' returns 'false' in the Turkish and Azerbaijani locales, where the dotted and dotless 'i' are separate letters. Calling 'toUpperCase()' on an English string containing an 'i', when running in a Turkish locale, will return incorrect results. Alternatively, when dealing with strings that should be treated as locale-independent, like HTML tags, this can lead to errors. Inspection ID: StringToUpperWithoutLocale", + "markdown": "Reports `toUpperCase()` or `toLowerCase()` calls on `String` objects that do not specify a `java.util.Locale`. In these cases the default system locale is used, which can cause problems in an internationalized environment.\n\n\nFor example the code `\"i\".toUpperCase().equals(\"I\")` returns `false` in the Turkish and Azerbaijani locales, where\nthe dotted and dotless 'i' are separate letters. Calling `toUpperCase()` on an English string containing an 'i', when running\nin a Turkish locale, will return incorrect results. Alternatively, when dealing with strings that should be treated as locale-independent,\nlike HTML tags, this can lead to errors.\n\nInspection ID: StringToUpperWithoutLocale" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringToUpperCaseOrToLowerCaseWithoutLocale", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExplicitToImplicitClassMigration", + "shortDescription": { + "text": "Explicit class declaration can be converted into a compact source file" + }, + "fullDescription": { + "text": "Reports ordinary classes, which can be converted into compact source files Example: 'public class Sample {\n public static void main(String[] args) {\n System.out.println(\"Hello, world!\");\n }\n }' After the quick-fix is applied: 'void main() {\n IO.println(\"Hello, world!\");\n }' Configure the inspection: Select Replace 'System.out.print()' and 'System.out.println()' with methods from 'java.lang.IO' class to convert these calls to IO methods. This inspection depends on the Java feature 'Compact source files', which is available since Java 21-preview. Inspection ID: ExplicitToImplicitClassMigration New in 2024.1", + "markdown": "Reports ordinary classes, which can be converted into compact source files\n\n**Example:**\n\n\n public class Sample {\n public static void main(String[] args) {\n System.out.println(\"Hello, world!\");\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void main() {\n IO.println(\"Hello, world!\");\n }\n\nConfigure the inspection:\n\n* Select **Replace 'System.out.print()' and 'System.out.println()' with methods from 'java.lang.IO' class** to convert these calls to IO methods.\n\nThis inspection depends on the Java feature 'Compact source files', which is available since Java 21-preview.\n\nInspection ID: ExplicitToImplicitClassMigration\n\nNew in 2024.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExplicitToImplicitClassMigration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 25", + "index": 92, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SynchronizationOnLocalVariableOrMethodParameter", + "shortDescription": { + "text": "Synchronization on local variable or method parameter" + }, + "fullDescription": { + "text": "Reports synchronization on a local variable or parameter. It is very difficult to guarantee correct operation when such synchronization is used. It may be possible to improve such code, for example, by controlling access using a synchronized wrapper class or by synchronizing on a field. Example: 'void bar() {\n final Object lock = new Object();\n synchronized (lock) { }\n }' Inspection ID: SynchronizationOnLocalVariableOrMethodParameter", + "markdown": "Reports synchronization on a local variable or parameter.\n\n\nIt is very difficult to guarantee correct operation when such synchronization is used.\nIt may be possible to improve such code, for example, by controlling access using a synchronized wrapper class or by synchronizing on a\nfield.\n\n**Example:**\n\n\n void bar() {\n final Object lock = new Object();\n synchronized (lock) { }\n }\n\nInspection ID: SynchronizationOnLocalVariableOrMethodParameter" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SynchronizationOnLocalVariableOrMethodParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedMethodCall", + "shortDescription": { + "text": "Nested method call" + }, + "fullDescription": { + "text": "Reports method calls used as parameters to another method call. The quick-fix introduces a variable to make the code simpler and easier to debug. Example: 'public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int x = f(y());\n }' After the quick-fix is applied: 'public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int y = y();\n int x = f(y);\n }' Use the inspection options to toggle the reporting of: method calls in field initializers calls to static methods calls to simple getters Inspection ID: NestedMethodCall", + "markdown": "Reports method calls used as parameters to another method call.\n\nThe quick-fix introduces a variable to make the code simpler and easier to debug.\n\n**Example:**\n\n\n public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int x = f(y());\n }\n\nAfter the quick-fix is applied:\n\n\n public int y() { return 1; }\n public int f(int x) { return 2 * x; }\n\n public void foo() {\n int y = y();\n int x = f(y);\n }\n\n\nUse the inspection options to toggle the reporting of:\n\n* method calls in field initializers\n* calls to static methods\n* calls to simple getters\n\nInspection ID: NestedMethodCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedMethodCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NegatedConditionalExpression", + "shortDescription": { + "text": "Negated conditional expression" + }, + "fullDescription": { + "text": "Reports conditional expressions which are negated with a prefix expression, as such constructions may be confusing. There is a fix that propagates the outer negation to both branches. Example: '!(i == 1 ? a : b)' After the quick-fix is applied: 'i == 1 ? !a : !b' Inspection ID: NegatedConditionalExpression", + "markdown": "Reports conditional expressions which are negated with a prefix expression, as such constructions may be confusing.\n\nThere is a fix that propagates the outer negation to both branches.\n\nExample:\n\n\n !(i == 1 ? a : b)\n\nAfter the quick-fix is applied:\n\n\n i == 1 ? !a : !b\n\n\nInspection ID: NegatedConditionalExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NegatedConditionalExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FinalMethod", + "shortDescription": { + "text": "Method can't be overridden" + }, + "fullDescription": { + "text": "Reports methods that are declared 'final'. Such methods can't be overridden and may indicate a lack of object-oriented design. Some coding standards discourage 'final' methods. Inspection ID: FinalMethod", + "markdown": "Reports methods that are declared `final`. Such methods can't be overridden and may indicate a lack of object-oriented design. Some coding standards discourage `final` methods.\n\nInspection ID: FinalMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FinalMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithTooManyTransitiveDependents", + "shortDescription": { + "text": "Class with too many transitive dependents" + }, + "fullDescription": { + "text": "Reports a class on which too many other classes are directly or indirectly dependent. Any modification to such a class may require changing many other classes, which may be expensive. Only top-level classes are reported. Use the Maximum number of transitive dependents field to specify the maximum allowed number of direct or indirect dependents for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassWithTooManyTransitiveDependents", + "markdown": "Reports a class on which too many other classes are directly or indirectly dependent.\n\nAny modification to such a class may require changing many other classes, which may be expensive.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of transitive dependents** field to specify the maximum allowed number of direct or indirect dependents\nfor a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassWithTooManyTransitiveDependents" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithTooManyTransitiveDependents", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Dependency issues", + "index": 93, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CompareToUsesNonFinalVariable", + "shortDescription": { + "text": "Non-final field referenced in 'compareTo()'" + }, + "fullDescription": { + "text": "Reports access to a non-'final' field inside a 'compareTo()' implementation. Such access may result in 'compareTo()' returning different results at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes, for example 'java.util.TreeSet'. A quick-fix to make the field 'final' is available only when there is no write access to the field, otherwise no fixes are suggested. Example: 'class Foo implements Comparable{\n private int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }' After the quick-fix is applied: 'class Foo implements Comparable{\n private final int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }' Inspection ID: CompareToUsesNonFinalVariable", + "markdown": "Reports access to a non-`final` field inside a `compareTo()` implementation.\n\n\nSuch access may result in `compareTo()`\nreturning different results at different points in the object's lifecycle, which may in turn cause problems when\nusing the standard collections classes, for example `java.util.TreeSet`.\n\n\nA quick-fix to make the field `final` is available\nonly when there is no write access to the field, otherwise no fixes are suggested.\n\n**Example:**\n\n\n class Foo implements Comparable{\n private int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Comparable{\n private final int index;\n Foo(int idx) {\n index = idx;\n }\n @Override\n public int compareTo(Foo foo) {\n return Integer.compare(this.index, foo.index);\n }\n }\n\nInspection ID: CompareToUsesNonFinalVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CompareToUsesNonFinalVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousSystemArraycopy", + "shortDescription": { + "text": "Suspicious 'System.arraycopy()' call" + }, + "fullDescription": { + "text": "Reports suspicious calls to 'System.arraycopy()'. Such calls are suspicious when: the source or destination is not of an array type the source and destination are of different types the copied chunk length is greater than 'src.length - srcPos' the copied chunk length is greater than 'dest.length - destPos' the ranges always intersect when the source and destination are the same array Example: 'void foo() {\n int[] src = new int[] { 1, 2, 3, 4 };\n System.arraycopy(src, 0, src, 1, 2); // warning: Copying to the same array with intersecting ranges\n }' Inspection ID: SuspiciousSystemArraycopy", + "markdown": "Reports suspicious calls to `System.arraycopy()`.\n\nSuch calls are suspicious when:\n\n* the source or destination is not of an array type\n* the source and destination are of different types\n* the copied chunk length is greater than `src.length - srcPos`\n* the copied chunk length is greater than `dest.length - destPos`\n* the ranges always intersect when the source and destination are the same array\n\n**Example:**\n\n\n void foo() {\n int[] src = new int[] { 1, 2, 3, 4 };\n System.arraycopy(src, 0, src, 1, 2); // warning: Copying to the same array with intersecting ranges\n }\n\n\nInspection ID: SuspiciousSystemArraycopy" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousSystemArraycopy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavacQuirks", + "shortDescription": { + "text": "Javac quirks" + }, + "fullDescription": { + "text": "Reports known Javac issues, performance problems, and incompatibilities. For example, type inference may be slow when it has to process many nested calls. The following code triggers a warning, as the vararg method call has 50+ poly arguments: 'Arrays.asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));' The quick-fix adds explicit type arguments, which makes compilation and IDE processing much faster: '//noinspection RedundantTypeArguments\n Arrays.>asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));' Inspection ID: JavacQuirks", + "markdown": "Reports known Javac issues, performance problems, and incompatibilities. For example, type inference may be slow when it has to process many nested calls.\n\nThe following code triggers a warning, as the vararg method call has 50+ poly arguments:\n\n\n Arrays.asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));\n\nThe quick-fix adds explicit type arguments, which makes compilation and IDE processing much faster:\n\n\n //noinspection RedundantTypeArguments\n Arrays.>asList(\n Arrays.asList(\"a1\", \"b1\"),\n Arrays.asList(\"a2\", \"b2\"),\n ...\n Arrays.asList(\"a100\", \"b100\"));\n\nInspection ID: JavacQuirks" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "JavacQuirks", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Compiler issues", + "index": 94, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwitchStatement", + "shortDescription": { + "text": "'switch' statement" + }, + "fullDescription": { + "text": "Reports 'switch' statements. 'switch' statements often (but not always) indicate a poor object-oriented design. Example: 'switch (i) {\n // code\n }' Inspection ID: SwitchStatement", + "markdown": "Reports `switch` statements.\n\n`switch` statements often (but not always) indicate a poor object-oriented design.\n\nExample:\n\n\n switch (i) {\n // code\n }\n\nInspection ID: SwitchStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SwitchStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AbsoluteAlignmentInUserInterface", + "shortDescription": { + "text": "Absolute alignment in AWT/Swing code" + }, + "fullDescription": { + "text": "Reports usages of absolute alignment constants from AWT and Swing. Internationalized applications use relative alignment because it respects the locale component orientation settings. Example: 'JPanel panel = new JPanel(new BorderLayout(2, 2));\n JLabel label = new JLabel(\"Hello World\");\n panel.add(label, BorderLayout.NORTH);' After the quick-fix is applied: 'JPanel panel = new JPanel(new BorderLayout(2, 2));\n JLabel label = new JLabel(\"Hello World\");\n panel.add(label, BorderLayout.PAGE_START);' Inspection ID: AbsoluteAlignmentInUserInterface", + "markdown": "Reports usages of absolute alignment constants from AWT and Swing. Internationalized applications use relative alignment because it respects the locale component orientation settings.\n\n**Example:**\n\n\n JPanel panel = new JPanel(new BorderLayout(2, 2));\n JLabel label = new JLabel(\"Hello World\");\n panel.add(label, BorderLayout.NORTH);\n\nAfter the quick-fix is applied:\n\n\n JPanel panel = new JPanel(new BorderLayout(2, 2));\n JLabel label = new JLabel(\"Hello World\");\n panel.add(label, BorderLayout.PAGE_START);\n\nInspection ID: AbsoluteAlignmentInUserInterface" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AbsoluteAlignmentInUserInterface", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringBufferReplaceableByString", + "shortDescription": { + "text": "'StringBuilder' can be replaced with 'String'" + }, + "fullDescription": { + "text": "Reports usages of 'StringBuffer', 'StringBuilder', or 'StringJoiner' which can be replaced with a single 'String' concatenation. Using 'String' concatenation makes the code shorter and simpler. This inspection only reports when the suggested replacement does not result in significant performance drawback on modern JVMs. In many cases, 'String' concatenation may perform better. Example: 'StringBuilder result = new StringBuilder();\n result.append(\"i = \");\n result.append(i);\n result.append(\";\");\n return result.toString();' After the quick-fix is applied: 'String result = \"i = \" + i + \";\";\n return result;' Inspection ID: StringBufferReplaceableByString", + "markdown": "Reports usages of `StringBuffer`, `StringBuilder`, or `StringJoiner` which can be replaced with a single `String` concatenation.\n\nUsing `String` concatenation\nmakes the code shorter and simpler.\n\n\nThis inspection only reports when the suggested replacement does not result in significant\nperformance drawback on modern JVMs. In many cases, `String` concatenation may perform better.\n\n**Example:**\n\n\n StringBuilder result = new StringBuilder();\n result.append(\"i = \");\n result.append(i);\n result.append(\";\");\n return result.toString();\n\nAfter the quick-fix is applied:\n\n\n String result = \"i = \" + i + \";\";\n return result;\n\nInspection ID: StringBufferReplaceableByString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringBufferReplaceableByString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SourceToSinkFlow", + "shortDescription": { + "text": "Non-safe string is passed to safe method" + }, + "fullDescription": { + "text": "Reports cases when a non-safe object is passed to a method with a parameter marked with '@Untainted' annotations, returned from annotated methods or assigned to annotated fields, parameters, or local variables. Kotlin 'set' and 'get' methods for fields are not supported as entry points. A safe object (in the same class) is: a string literal, interface instance, or enum object a result of a call of a method that is marked as '@Untainted' a private field, which is assigned only with a string literal and has a safe initializer a final field, which has a safe initializer local variable or parameter that are marked as '@Untainted' and are not assigned from non-safe objects This field, local variable, or parameter must not be passed as arguments to methods or used as a qualifier or must be a primitive, its wrapper or immutable. Also static final fields are considered as safe. The analysis is performed only inside one file. To process dependencies from other classes, use options. The analysis extends to private or static methods and has a limit of depth propagation. Example: 'void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n if (b) s1 = s;\n sink(s);\n }\n\n String sink(@Untainted String s) {}'\n Here we do not have non-safe string assignments to 's' so a warning is not produced. On the other hand: 'void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n s1 = foo();\n if (b) s = s1;\n sink(s); // warning here\n }\n\n String foo();\n\n String sink(@Untainted String s) {}'\n Here we have a warning since 's1' has an unknown state after 'foo' call result assignment. Inspection ID: SourceToSinkFlow New in 2021.2", + "markdown": "Reports cases when a non-safe object is passed to a method with a parameter marked with `@Untainted` annotations, returned from annotated methods or assigned to annotated fields, parameters, or local variables. Kotlin `set` and `get` methods for fields are not supported as entry points.\n\n\nA safe object (in the same class) is:\n\n* a string literal, interface instance, or enum object\n* a result of a call of a method that is marked as `@Untainted`\n* a private field, which is assigned only with a string literal and has a safe initializer\n* a final field, which has a safe initializer\n* local variable or parameter that are marked as `@Untainted` and are not assigned from non-safe objects\nThis field, local variable, or parameter must not be passed as arguments to methods or used as a qualifier or must be a primitive, its wrapper or immutable.\n\nAlso static final fields are considered as safe.\n\n\nThe analysis is performed only inside one file. To process dependencies from other classes, use options.\nThe analysis extends to private or static methods and has a limit of depth propagation.\n\n\nExample:\n\n\n void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n if (b) s1 = s;\n sink(s);\n }\n\n String sink(@Untainted String s) {}\n\n\nHere we do not have non-safe string assignments to `s` so a warning is not produced. On the other hand:\n\n\n void doSmth(boolean b) {\n String s = safe();\n String s1 = \"other\";\n s1 = foo();\n if (b) s = s1;\n sink(s); // warning here\n }\n\n String foo();\n\n String sink(@Untainted String s) {}\n\n\nHere we have a warning since `s1` has an unknown state after `foo` call result assignment.\n\nInspection ID: SourceToSinkFlow\n\nNew in 2021.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "tainting", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RecordCanBeClass", + "shortDescription": { + "text": "Record can be converted to class" + }, + "fullDescription": { + "text": "Reports record classes and suggests converting them to ordinary classes. This inspection makes it possible to move a Java record to a codebase using an earlier Java version by applying the quick-fix to this record. Note that the resulting class is not completely equivalent to the original record: The resulting class no longer extends 'java.lang.Record', so 'instanceof Record' returns 'false'. Reflection methods like 'Class.isRecord()' and 'Class.getRecordComponents()' produce different results. The generated 'hashCode()' implementation may produce a different result because the formula to calculate record 'hashCode' is deliberately not specified. Record serialization mechanism differs from that of an ordinary class. Refer to Java Object Serialization Specification for details. Example: 'record Point(int x, int y) {}' After the quick-fix is applied: 'final class Point {\n private final int x;\n private final int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n public int x() { return x; }\n\n public int y() { return y; }\n\n @Override\n public boolean equals(Object obj) {\n if (obj == this) return true;\n if (obj == null || obj.getClass() != this.getClass()) return false;\n var that = (Point)obj;\n return this.x == that.x &&\n this.y == that.y;\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(x, y);\n }\n\n @Override\n public String toString() {\n return \"Point[\" +\n \"x=\" + x + \", \" +\n \"y=\" + y + ']';\n }\n }' This inspection depends on the Java feature 'Records', which is available since Java 16. Inspection ID: RecordCanBeClass New in 2020.3", + "markdown": "Reports record classes and suggests converting them to ordinary classes.\n\nThis inspection makes it possible to move a Java record to a codebase using an earlier Java version\nby applying the quick-fix to this record.\n\n\nNote that the resulting class is not completely equivalent to the original record:\n\n* The resulting class no longer extends `java.lang.Record`, so `instanceof Record` returns `false`.\n* Reflection methods like `Class.isRecord()` and `Class.getRecordComponents()` produce different results.\n* The generated `hashCode()` implementation may produce a different result because the formula to calculate record `hashCode` is deliberately not specified.\n* Record serialization mechanism differs from that of an ordinary class. Refer to *Java Object Serialization Specification* for details.\n\nExample:\n\n\n record Point(int x, int y) {}\n\nAfter the quick-fix is applied:\n\n\n final class Point {\n private final int x;\n private final int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n public int x() { return x; }\n\n public int y() { return y; }\n\n @Override\n public boolean equals(Object obj) {\n if (obj == this) return true;\n if (obj == null || obj.getClass() != this.getClass()) return false;\n var that = (Point)obj;\n return this.x == that.x &&\n this.y == that.y;\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(x, y);\n }\n\n @Override\n public String toString() {\n return \"Point[\" +\n \"x=\" + x + \", \" +\n \"y=\" + y + ']';\n }\n }\n\nThis inspection depends on the Java feature 'Records', which is available since Java 16.\n\nInspection ID: RecordCanBeClass\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RecordCanBeClass", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantLambdaParameterType", + "shortDescription": { + "text": "Redundant lambda parameter types" + }, + "fullDescription": { + "text": "Reports lambda formal parameter types that are redundant because they can be inferred from the context. Example: 'Map map = ...\n map.forEach((String s, Integer i) -> log.info(s + \"=\" + i));' The quick-fix removes the parameter types from the lambda. 'Map map = ...\n map.forEach((s, i) -> log.info(s + \"=\" + i));' Inspection ID: RedundantLambdaParameterType", + "markdown": "Reports lambda formal parameter types that are redundant because they can be inferred from the context.\n\n**Example:**\n\n\n Map map = ...\n map.forEach((String s, Integer i) -> log.info(s + \"=\" + i));\n\nThe quick-fix removes the parameter types from the lambda.\n\n\n Map map = ...\n map.forEach((s, i) -> log.info(s + \"=\" + i));\n\nInspection ID: RedundantLambdaParameterType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantLambdaParameterType", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MalformedFormatString", + "shortDescription": { + "text": "Malformed format string" + }, + "fullDescription": { + "text": "Reports format strings that don't comply with the standard Java syntax. By default, the inspection considers a compile-time constant a format string if it's used as an argument to the corresponding methods on 'java.util.Formatter', 'java.lang.String', 'java.io.PrintWriter' or 'java.io.PrintStream'. Example: 'String.format(\"x = %d, y = %d\", 42);' Use the inspection settings to mark additional classes and methods as related to string formatting. As an alternative, you can use the 'org.intellij.lang.annotations.PrintFormat' annotation to mark the format string method parameter. In this case, the format arguments parameter must immediately follow the format string and be the last method parameter. Example: 'void myFormatMethod(int mode, @PrintFormat String formatString, Object... args) {...}' Methods annotated in this way will also be recognized by this inspection. Inspection ID: MalformedFormatString", + "markdown": "Reports format strings that don't comply with the standard Java syntax.\n\nBy default, the inspection considers a compile-time constant a format string if it's used as an argument to the corresponding methods on\n`java.util.Formatter`, `java.lang.String`, `java.io.PrintWriter` or `java.io.PrintStream`.\n\n**Example:**\n\n\n String.format(\"x = %d, y = %d\", 42);\n\nUse the inspection settings to mark additional classes and methods as related to string formatting.\n\nAs an alternative, you can use the `org.intellij.lang.annotations.PrintFormat` annotation\nto mark the format string method parameter. In this case,\nthe format arguments parameter must immediately follow the format string and be the last method parameter. Example:\n\n\n void myFormatMethod(int mode, @PrintFormat String formatString, Object... args) {...}\n\n\nMethods annotated in this way will also be recognized by this inspection.\n\nInspection ID: MalformedFormatString" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MalformedFormatString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionalExpression", + "shortDescription": { + "text": "Conditional expression" + }, + "fullDescription": { + "text": "Reports usages of the ternary condition operator and suggests converting them to 'if'/'else' statements. Some code standards prohibit the use of the condition operator. Example: 'Object result = (condition) ? foo() : bar();' After the quick-fix is applied: 'Object result;\n if (condition) {\n comp = foo();\n }\n else {\n comp = bar();\n }' Configure the inspection: Use the Ignore for simple assignments and returns option to ignore simple assignments and returns and allow the following constructs: 'String s = (foo == null) ? \"\" : foo.toString();' Use the Ignore places where an if statement is not possible option to ignore conditional expressions in contexts in which automatic replacement with an if statement is not possible (for example, when the conditional expression is used as an argument to a 'super()' constructor call). Inspection ID: ConditionalExpression", + "markdown": "Reports usages of the ternary condition operator and suggests converting them to `if`/`else` statements.\n\nSome code standards prohibit the use of the condition operator.\n\nExample:\n\n\n Object result = (condition) ? foo() : bar();\n\nAfter the quick-fix is applied:\n\n\n Object result;\n if (condition) {\n comp = foo();\n }\n else {\n comp = bar();\n }\n\nConfigure the inspection:\n\nUse the **Ignore for simple assignments and returns** option to ignore simple assignments and returns and allow the following constructs:\n\n\n String s = (foo == null) ? \"\" : foo.toString();\n\n\nUse the **Ignore places where an if statement is not possible** option to ignore conditional expressions in contexts in which automatic\nreplacement with an if statement is not possible (for example, when the conditional expression is used as an argument to a\n`super()` constructor call).\n\nInspection ID: ConditionalExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConditionalExpression", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousReturnByteInputStream", + "shortDescription": { + "text": "Suspicious byte value returned from 'InputStream.read()'" + }, + "fullDescription": { + "text": "Reports expressions of 'byte' type returned from a method implementing the 'InputStream.read()' method. This is suspicious because 'InputStream.read()' should return a value in the range from '0' to '255', while an expression of byte type contains a value from '-128' to '127'. The quick-fix converts the expression into an unsigned 'byte' by applying the bitmask '0xFF'. Example: 'class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++]; // problem\n }\n}' After applying the quick-fix: 'class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++] & 0xFF;\n }\n}' Inspection ID: SuspiciousReturnByteInputStream New in 2023.2", + "markdown": "Reports expressions of `byte` type returned from a method implementing the `InputStream.read()` method.\n\n\nThis is suspicious because `InputStream.read()` should return a value in the range from `0` to `255`,\nwhile an expression of byte type contains a value from `-128` to `127`.\nThe quick-fix converts the expression into an unsigned `byte` by applying the bitmask `0xFF`.\n\n**Example:**\n\n\n class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++]; // problem\n }\n }\n\nAfter applying the quick-fix:\n\n\n class MyInputStream extends InputStream {\n int pos = 0;\n byte[] data;\n\n MyInputStream(byte[] input) {\n data = input;\n }\n\n @Override\n public int read() {\n if (pos == data.length) {\n return -1;\n }\n return data[pos++] & 0xFF;\n }\n }\n\nInspection ID: SuspiciousReturnByteInputStream\n\nNew in 2023.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousReturnByteInputStream", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadYield", + "shortDescription": { + "text": "Call to 'Thread.yield()'" + }, + "fullDescription": { + "text": "Reports calls to 'Thread.yield()'. The behavior of 'yield()' is non-deterministic and platform-dependent, and it is rarely appropriate to use this method. Its use should be combined with detailed profiling and benchmarking to ensure that it actually has the desired effect. Example: 'public static void main(String[] args) {\n Runnable r = () -> {\n for (int i = 0; i < 10; i++) {\n System.out.println(i);\n Thread.yield();\n }\n };\n new Thread(r).start();\n new Thread(r).start();\n }' Inspection ID: ThreadYield", + "markdown": "Reports calls to `Thread.yield()`.\n\n\nThe behavior of `yield()` is non-deterministic and platform-dependent, and it is rarely appropriate to use this method.\nIts use should be combined with detailed profiling and benchmarking to ensure that it actually has the desired effect.\n\n**Example:**\n\n\n public static void main(String[] args) {\n Runnable r = () -> {\n for (int i = 0; i < 10; i++) {\n System.out.println(i);\n Thread.yield();\n }\n };\n new Thread(r).start();\n new Thread(r).start();\n }\n\nInspection ID: ThreadYield" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToThreadYield", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfClone", + "shortDescription": { + "text": "Use of 'clone()' or 'Cloneable'" + }, + "fullDescription": { + "text": "Reports implementations of, and calls to, the 'clone()' method and uses of the 'java.lang.Cloneable' interface. Some coding standards prohibit the use of 'clone()', and recommend using a copy constructor or a 'static' factory method instead. The inspection ignores calls to 'clone()' on arrays because it's a correct and compact way to copy an array. Example: 'class Copy implements Cloneable /*warning*/ {\n\n public Copy clone() /*warning*/ {\n try {\n return (Copy) super.clone(); // warning\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' Inspection ID: UseOfClone", + "markdown": "Reports implementations of, and calls to, the `clone()` method and uses of the `java.lang.Cloneable` interface.\n\nSome coding standards prohibit the use of `clone()`, and recommend using a copy constructor or\na `static` factory method instead.\n\nThe inspection ignores calls to `clone()` on arrays because it's a correct and compact way to copy an array.\n\n**Example:**\n\n\n class Copy implements Cloneable /*warning*/ {\n\n public Copy clone() /*warning*/ {\n try {\n return (Copy) super.clone(); // warning\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nInspection ID: UseOfClone" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfClone", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Cloning issues", + "index": 82, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingFinalNewline", + "shortDescription": { + "text": "Missing final new line" + }, + "fullDescription": { + "text": "Reports if manifest files do not end with a final newline as required by the JAR file specification. Inspection ID: MissingFinalNewline", + "markdown": "Reports if manifest files do not end with a final newline as required by the JAR file specification.\n\nInspection ID: MissingFinalNewline" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MissingFinalNewline", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Manifest", + "index": 97, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LambdaCanBeMethodCall", + "shortDescription": { + "text": "Lambda can be replaced with method call" + }, + "fullDescription": { + "text": "Reports lambda expressions which can be replaced with a call to a JDK method. For example, an expression 'x -> x' of type 'Function' can be replaced with a 'Function.identity()' call. This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: LambdaCanBeMethodCall New in 2017.1", + "markdown": "Reports lambda expressions which can be replaced with a call to a JDK method.\n\nFor example, an expression `x -> x` of type `Function`\ncan be replaced with a `Function.identity()` call.\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: LambdaCanBeMethodCall\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LambdaCanBeMethodCall", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedTryStatement", + "shortDescription": { + "text": "Nested 'try' statement" + }, + "fullDescription": { + "text": "Reports nested 'try' statements. Nested 'try' statements may result in unclear code and should probably have their 'catch' and 'finally' sections merged. Inspection ID: NestedTryStatement", + "markdown": "Reports nested `try` statements.\n\nNested `try` statements\nmay result in unclear code and should probably have their `catch` and `finally` sections\nmerged.\n\nInspection ID: NestedTryStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedTryStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EndlessStream", + "shortDescription": { + "text": "Non-short-circuit operation consumes infinite stream" + }, + "fullDescription": { + "text": "Reports non-short-circuit operations consuming an infinite stream. Such operations can be completed only by throwing an exception. Example: 'Stream.iterate(0, i -> i + 1).collect(Collectors.toList())' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: EndlessStream", + "markdown": "Reports non-short-circuit operations consuming an infinite stream. Such operations can be completed only by throwing an exception.\n\nExample:\n\n\n Stream.iterate(0, i -> i + 1).collect(Collectors.toList())\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: EndlessStream" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EndlessStream", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonStaticFinalLogger", + "shortDescription": { + "text": "Non-constant logger" + }, + "fullDescription": { + "text": "Reports logger fields that are not declared 'static' and/or 'final'. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application. A quick-fix is provided to change the logger modifiers to 'static final'. Example: 'public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }' After the quick-fix is applied: 'public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }' Configure the inspection: Use the Logger class name table to specify logger class names. The inspection will report the fields that are not 'static' and 'final' and are of the type equal to one of the specified class names. Inspection ID: NonStaticFinalLogger", + "markdown": "Reports logger fields that are not declared `static` and/or `final`. Ensuring that every class logger is effectively constant and bound to that class simplifies the task of providing a unified logging implementation for an application.\n\nA quick-fix is provided to change the logger modifiers to `static final`.\n\n**Example:**\n\n\n public class Significant {\n private Logger LOG = Logger.getLogger(Critical.class);\n }\n\nAfter the quick-fix is applied:\n\n\n public class Significant {\n private static final Logger LOG = Logger.getLogger(Critical.class);\n }\n\n\nConfigure the inspection:\n\n* Use the **Logger class name** table to specify logger class names. The inspection will report the fields that are not `static` and `final` and are of the type equal to one of the specified class names.\n\nInspection ID: NonStaticFinalLogger" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonConstantLogger", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Logging", + "index": 98, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonFinalUtilityClass", + "shortDescription": { + "text": "Utility class is not 'final'" + }, + "fullDescription": { + "text": "Reports utility classes that aren't 'final' or 'abstract'. Utility classes have all fields and methods declared as 'static'. Making them 'final' prevents them from being accidentally subclassed. Example: 'public class UtilityClass {\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n public static void foo() {}\n }' Inspection ID: NonFinalUtilityClass", + "markdown": "Reports utility classes that aren't `final` or `abstract`.\n\nUtility classes have all fields and methods declared as `static`.\nMaking them `final` prevents them from being accidentally subclassed.\n\n**Example:**\n\n\n public class UtilityClass {\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n public static void foo() {}\n }\n\nInspection ID: NonFinalUtilityClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonFinalUtilityClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Singleton", + "shortDescription": { + "text": "Singleton" + }, + "fullDescription": { + "text": "Reports singleton classes. Singleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing, and their presence may indicate a lack of object-oriented design. Example: 'class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }' Inspection ID: Singleton", + "markdown": "Reports singleton classes.\n\nSingleton classes are declared in a way that only one instance of the class can ever be instantiated. Singleton classes complicate testing,\nand their presence may indicate a lack of object-oriented design.\n\n**Example:**\n\n\n class Singleton {\n private static final Singleton ourInstance = new Singleton();\n\n private Singleton() {\n }\n\n public Singleton getInstance() {\n return ourInstance;\n }\n }\n\nInspection ID: Singleton" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Singleton", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FuseStreamOperations", + "shortDescription": { + "text": "Subsequent steps can be fused into Stream API chain" + }, + "fullDescription": { + "text": "Detects transformations outside a Stream API chain that could be incorporated into it. Example: 'List list = stream.collect(Collectors.toList());\n list.sort(null);\n return list.toArray(new String[list.size()]);' After the conversion: 'return stream.sorted().toArray(String[]::new);' Note that sometimes the converted stream chain may replace explicit 'ArrayList' with 'Collectors.toList()' or explicit 'HashSet' with 'Collectors.toSet()'. The current library implementation uses these collections internally. However, this approach is not very reliable and might change in the future altering the semantics of your code. If you are concerned about it, use the Do not suggest 'toList()' or 'toSet()' collectors option to suggest 'Collectors.toCollection()' instead of 'toList' and 'toSet' collectors. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: FuseStreamOperations", + "markdown": "Detects transformations outside a Stream API chain that could be incorporated into it.\n\nExample:\n\n\n List list = stream.collect(Collectors.toList());\n list.sort(null);\n return list.toArray(new String[list.size()]);\n\nAfter the conversion:\n\n\n return stream.sorted().toArray(String[]::new);\n\n\nNote that sometimes the converted stream chain may replace explicit `ArrayList` with `Collectors.toList()` or explicit\n`HashSet` with `Collectors.toSet()`. The current library implementation uses these collections internally. However,\nthis approach is not very reliable and might change in the future altering the semantics of your code.\n\nIf you are concerned about it, use the **Do not suggest 'toList()' or 'toSet()' collectors** option to suggest\n`Collectors.toCollection()` instead of `toList` and `toSet` collectors.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: FuseStreamOperations" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FuseStreamOperations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionalExpressionWithIdenticalBranches", + "shortDescription": { + "text": "Conditional expression with identical branches" + }, + "fullDescription": { + "text": "Reports conditional expressions with identical 'then' and 'else' branches. Such expressions almost certainly indicate bugs. The inspection provides a fix that collapses conditional expressions. Example: 'int y = x == 10 ? 4 : 4;' After the quick-fix is applied: 'int y = 4;' Inspection ID: ConditionalExpressionWithIdenticalBranches", + "markdown": "Reports conditional expressions with identical `then` and `else` branches.\n\nSuch expressions almost certainly indicate bugs. The inspection provides a fix that collapses conditional expressions.\n\nExample:\n\n\n int y = x == 10 ? 4 : 4;\n\nAfter the quick-fix is applied:\n\n\n int y = 4;\n\n\nInspection ID: ConditionalExpressionWithIdenticalBranches" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ConditionalExpressionWithIdenticalBranches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DefaultNotLastCaseInSwitch", + "shortDescription": { + "text": "'default' not last case in 'switch'" + }, + "fullDescription": { + "text": "Reports 'switch' statements or expressions in which the 'default' branch is positioned before another case. Such a construct is unnecessarily confusing. A quick-fix is provided to move the 'default' branch to the last position, if possible. Example: 'switch (n) {\n default:\n System.out.println();\n break;\n case 1:\n break;\n }' After the quick-fix is applied: 'switch (n) {\n case 1:\n break;\n default:\n System.out.println();\n break;\n }' Inspection ID: DefaultNotLastCaseInSwitch", + "markdown": "Reports `switch` statements or expressions in which the `default` branch is positioned before another case. Such a construct is unnecessarily confusing. A quick-fix is provided to move the `default` branch to the last position, if possible.\n\n**Example:**\n\n\n switch (n) {\n default:\n System.out.println();\n break;\n case 1:\n break;\n }\n\nAfter the quick-fix is applied:\n\n\n switch (n) {\n case 1:\n break;\n default:\n System.out.println();\n break;\n }\n\n\nInspection ID: DefaultNotLastCaseInSwitch" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DefaultNotLastCaseInSwitch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NullThrown", + "shortDescription": { + "text": "'null' thrown" + }, + "fullDescription": { + "text": "Reports 'null' literals that are used as the argument of a 'throw' statement. Such constructs produce a 'java.lang.NullPointerException' that usually should not be thrown programmatically. Inspection ID: NullThrown", + "markdown": "Reports `null` literals that are used as the argument of a `throw` statement.\n\nSuch constructs produce a `java.lang.NullPointerException` that usually should not be thrown programmatically.\n\nInspection ID: NullThrown" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NullThrown", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LocalCanBeFinal", + "shortDescription": { + "text": "Local variable or parameter can be 'final'" + }, + "fullDescription": { + "text": "Reports parameters or local variables that may have the 'final' modifier added to their declaration. Example: 'ArrayList list = new ArrayList();\n fill(list);\n return list;' After the quick-fix is applied: 'final ArrayList list = new ArrayList();\n fill(list);\n return list;' Use the inspection's options to define whether parameters or local variables should be reported. Inspection ID: LocalCanBeFinal", + "markdown": "Reports parameters or local variables that may have the `final` modifier added to their declaration.\n\nExample:\n\n\n ArrayList list = new ArrayList();\n fill(list);\n return list;\n\nAfter the quick-fix is applied:\n\n\n final ArrayList list = new ArrayList();\n fill(list);\n return list;\n\n\nUse the inspection's options to define whether parameters or local variables should be reported.\n\nInspection ID: LocalCanBeFinal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LocalCanBeFinal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldMayBeStatic", + "shortDescription": { + "text": "Field can be made 'static'" + }, + "fullDescription": { + "text": "Reports instance variables that can safely be made 'static'. A field can be static if it is declared 'final' and initialized with a constant. Example: 'public final String str = \"sample\";' The inspection does not report final fields that can be implicitly written. Use the \"Annotations\" button to modify the list of annotations that assume implicit field write. Inspection ID: FieldMayBeStatic", + "markdown": "Reports instance variables that can safely be made `static`. A field can be static if it is declared `final` and initialized with a constant.\n\n**Example:**\n\n\n public final String str = \"sample\";\n\n\nThe inspection does not report final fields that can be implicitly written. Use the \"Annotations\" button to modify\nthe list of annotations that assume implicit field write.\n\nInspection ID: FieldMayBeStatic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FieldMayBeStatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrayEquals", + "shortDescription": { + "text": "'equals()' called on array" + }, + "fullDescription": { + "text": "Reports 'equals()' calls that compare two arrays. Calling 'equals()' on an array compares identity and is equivalent to using '=='. Use 'Arrays.equals()' to compare the contents of two arrays, or 'Arrays.deepEquals()' for multi-dimensional arrays. Example: 'void sample(int[] first, int[] second){\n if (first.equals(second)) return;\n }' After the quick-fix is applied: 'void sample(int[] first, int[] second){\n if (Arrays.equals(first, second)) return;\n }' Inspection ID: ArrayEquals", + "markdown": "Reports `equals()` calls that compare two arrays.\n\nCalling `equals()` on an array compares identity and is equivalent to using `==`.\nUse `Arrays.equals()` to compare the contents of two arrays, or `Arrays.deepEquals()` for\nmulti-dimensional arrays.\n\n**Example:**\n\n\n void sample(int[] first, int[] second){\n if (first.equals(second)) return;\n }\n\nAfter the quick-fix is applied:\n\n\n void sample(int[] first, int[] second){\n if (Arrays.equals(first, second)) return;\n }\n\nInspection ID: ArrayEquals" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ArrayEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ProblematicVarargsMethodOverride", + "shortDescription": { + "text": "Non-varargs method overrides varargs method" + }, + "fullDescription": { + "text": "Reports methods that override a variable arity (a.k.a. varargs) method but replace the variable arity parameter with an array parameter. Though this code is valid, it may be confusing and should be avoided. Inspection ID: ProblematicVarargsMethodOverride", + "markdown": "Reports methods that override a variable arity (a.k.a. varargs) method but replace the variable arity parameter with an array parameter. Though this code is valid, it may be confusing and should be avoided.\n\n\nInspection ID: ProblematicVarargsMethodOverride" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ProblematicVarargsMethodOverride", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MisspelledHeader", + "shortDescription": { + "text": "Unknown or misspelled header name" + }, + "fullDescription": { + "text": "Reports any unknown and probably misspelled header names and provides possible variants. Inspection ID: MisspelledHeader", + "markdown": "Reports any unknown and probably misspelled header names and provides possible variants.\n\nInspection ID: MisspelledHeader" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MisspelledHeader", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Manifest", + "index": 97, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OnlyOneElementUsed", + "shortDescription": { + "text": "Only one element is used" + }, + "fullDescription": { + "text": "Reports lists, arrays, and strings where exactly one element is queried right upon the creation. Such expressions may appear after refactoring and usually could be replaced with an accessed element. Example: 'System.out.println(new int[] {1,2,3,4,5}[2]);' After the quick-fix is applied: 'System.out.println(3);' Inspection ID: OnlyOneElementUsed New in 2022.3", + "markdown": "Reports lists, arrays, and strings where exactly one element is queried right upon the creation. Such expressions may appear after refactoring and usually could be replaced with an accessed element.\n\nExample:\n\n\n System.out.println(new int[] {1,2,3,4,5}[2]);\n\nAfter the quick-fix is applied:\n\n\n System.out.println(3);\n\nInspection ID: OnlyOneElementUsed\n\nNew in 2022.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OnlyOneElementUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AtomicFieldUpdaterIssues", + "shortDescription": { + "text": "Inconsistent 'AtomicFieldUpdater' declaration" + }, + "fullDescription": { + "text": "Reports issues with 'AtomicLongFieldUpdater', 'AtomicIntegerFieldUpdater', or 'AtomicReferenceFieldUpdater' fields (the 'java.util.concurrent.atomic' package). The reported issues are identical to the runtime problems that can happen with atomic field updaters: specified field not found, specified field not accessible, specified field has a wrong type, and so on. Examples: 'class A {\n private static volatile int value = 0;\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater((A.class), \"value\"); // warning: Field 'value' has 'static' modifier\n }' 'class B {\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater(B.class, \"value\"); // warning: No field named 'value' found in class 'B'\n }' Inspection ID: AtomicFieldUpdaterIssues", + "markdown": "Reports issues with `AtomicLongFieldUpdater`, `AtomicIntegerFieldUpdater`, or `AtomicReferenceFieldUpdater` fields (the `java.util.concurrent.atomic` package).\n\nThe reported issues are identical to the runtime problems that can happen with atomic field updaters:\nspecified field not found, specified field not accessible, specified field has a wrong type, and so on.\n\n**Examples:**\n\n*\n\n\n class A {\n private static volatile int value = 0;\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater((A.class), \"value\"); // warning: Field 'value' has 'static' modifier\n }\n \n*\n\n\n class B {\n private static final AtomicIntegerFieldUpdater updater =\n AtomicIntegerFieldUpdater.newUpdater(B.class, \"value\"); // warning: No field named 'value' found in class 'B'\n }\n \n\nInspection ID: AtomicFieldUpdaterIssues" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AtomicFieldUpdaterIssues", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryBoxing", + "shortDescription": { + "text": "Unnecessary boxing" + }, + "fullDescription": { + "text": "Reports explicit boxing, that is wrapping of primitive values in objects. Explicit manual boxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = new Integer(1);' → 'Integer i = Integer.valueOf(1);' 'int i = Integer.valueOf(1);' → 'int i = 1;' Use the Only report truly superfluously boxed expressions option to report only truly superfluous boxing, where a boxed value is immediately unboxed either implicitly or explicitly. In this case, the entire boxing-unboxing step can be removed. The inspection doesn't report simple explicit boxing. This inspection only reports if the language level of the project or module is 5 or higher. Inspection ID: UnnecessaryBoxing", + "markdown": "Reports explicit boxing, that is wrapping of primitive values in objects.\n\nExplicit manual boxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = new Integer(1);` → `Integer i = Integer.valueOf(1);`\n* `int i = Integer.valueOf(1);` → `int i = 1;`\n\n\nUse the **Only report truly superfluously boxed expressions** option to report only truly superfluous boxing,\nwhere a boxed value is immediately unboxed either implicitly or explicitly.\nIn this case, the entire boxing-unboxing step can be removed. The inspection doesn't report simple explicit boxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher.\n\nInspection ID: UnnecessaryBoxing" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryBoxing", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadExceptionThrown", + "shortDescription": { + "text": "Prohibited exception thrown" + }, + "fullDescription": { + "text": "Reports 'throw' statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as 'java.lang.Exception' or 'java.io.IOException'. Example: 'void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }' Use the Prohibited exceptions list to specify which exceptions should be reported. Inspection ID: BadExceptionThrown", + "markdown": "Reports `throw` statements that throw an inappropriate exception. For example an exception can be inappropriate because it is overly generic, such as `java.lang.Exception` or `java.io.IOException`.\n\n**Example:**\n\n\n void setup(Mode mode) {\n if (mode == null)\n throw new RuntimeException(\"Problem during setup\"); // warning: Prohibited exception 'RuntimeException' thrown\n ...\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported.\n\n\nInspection ID: BadExceptionThrown" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ProhibitedExceptionThrown", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageNamingConvention", + "shortDescription": { + "text": "Package naming convention" + }, + "fullDescription": { + "text": "Reports packages whose names are either too short, too long, or do not follow the specified regular expression pattern. Example: 'package io;' Use the options to specify the minimum and maximum length of the package name as well as a regular expression that matches valid package names (regular expressions are in standard 'java.util.regex' format). Inspection ID: PackageNamingConvention", + "markdown": "Reports packages whose names are either too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:**\n\n\n package io;\n\n\nUse the options to specify the minimum and maximum length of the package name\nas well as a regular expression that matches valid package names\n(regular expressions are in standard `java.util.regex` format).\n\nInspection ID: PackageNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PackageNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Anonymous2MethodRef", + "shortDescription": { + "text": "Anonymous type can be replaced with method reference" + }, + "fullDescription": { + "text": "Reports anonymous classes which can be replaced with method references. Note that if an anonymous class is converted into an unbound method reference, the same method reference object can be reused by the Java runtime during subsequent invocations. On the other hand, when an anonymous class is used, separate objects are created every time. Thus, applying the quick-fix can cause the semantics change in rare cases, e.g. when anonymous class instances are used as 'HashMap' keys. Example: 'Runnable r = new Runnable() {\n @Override\n public void run() {\n System.out.println();\n }\n };' After the quick-fix is applied: 'Runnable r = System.out::println;' Use the Report when interface is not annotated with @FunctionalInterface option to enable this inspection for interfaces which are not annotated with '@FunctionalInterface'. This inspection depends on the Java feature 'Method references', which is available since Java 8. Inspection ID: Anonymous2MethodRef", + "markdown": "Reports anonymous classes which can be replaced with method references.\n\n\nNote that if an anonymous class is converted into an unbound method reference, the same method reference object\ncan be reused by the Java runtime during subsequent invocations. On the other hand, when an anonymous class is used,\nseparate objects are created every time. Thus, applying the quick-fix can cause the semantics change in rare cases,\ne.g. when anonymous class instances are used as `HashMap` keys.\n\n**Example:**\n\n\n Runnable r = new Runnable() {\n @Override\n public void run() {\n System.out.println();\n }\n };\n\nAfter the quick-fix is applied:\n\n\n Runnable r = System.out::println;\n\nUse the **Report when interface is not annotated with @FunctionalInterface** option to enable this inspection for\ninterfaces which are not annotated with `@FunctionalInterface`.\n\nThis inspection depends on the Java feature 'Method references', which is available since Java 8.\n\nInspection ID: Anonymous2MethodRef" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Anonymous2MethodRef", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicMethodNotExposedInInterface", + "shortDescription": { + "text": "'public' method not exposed in interface" + }, + "fullDescription": { + "text": "Reports 'public' methods in classes which are not exposed in an interface. Exposing all 'public' methods via an interface is important for maintaining loose coupling, and may be necessary for certain component-based programming styles. Example: 'interface Person {\n String getName();\n}\n\nclass PersonImpl implements Person {\n private String name;\n\n // ok: method is exposed in interface\n @Override\n public String getName() {\n return name;\n }\n\n // warning: method is public\n // but not exposed in interface\n public void setName() {\n this.name = name;\n }\n}' Use the Ignore if annotated by list to specify special annotations. Methods annotated with one of these annotations will be ignored by this inspection. Use the Ignore if the containing class does not implement a non-library interface option to ignore methods from classes which do not implement any interface from the project. Inspection ID: PublicMethodNotExposedInInterface", + "markdown": "Reports `public` methods in classes which are not exposed in an interface.\n\nExposing all `public` methods via an interface is important for\nmaintaining loose coupling, and may be necessary for certain component-based programming styles.\n\nExample:\n\n\n interface Person {\n String getName();\n }\n\n class PersonImpl implements Person {\n private String name;\n\n // ok: method is exposed in interface\n @Override\n public String getName() {\n return name;\n }\n\n // warning: method is public\n // but not exposed in interface\n public void setName() {\n this.name = name;\n }\n }\n\n\nUse the **Ignore if annotated by** list to specify special annotations. Methods annotated with one of\nthese annotations will be ignored by this inspection.\n\n\nUse the **Ignore if the containing class does not implement a non-library interface** option to ignore methods from classes which do not\nimplement any interface from the project.\n\n\nInspection ID: PublicMethodNotExposedInInterface" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PublicMethodNotExposedInInterface", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerializableHasSerialVersionUIDField", + "shortDescription": { + "text": "Serializable class without 'serialVersionUID'" + }, + "fullDescription": { + "text": "Reports classes that implement 'Serializable' and do not declare a 'serialVersionUID' field. Without a 'serialVersionUID' field, any change to the class will make previously serialized versions unreadable. Example: 'class Main implements Serializable {\n }' After the quick-fix is applied: 'class Main implements Serializable {\n private static final long serialVersionUID = -1446398935944895849L;\n }' When using a language level of JDK 14 or higher, the quickfix will also add the 'java.io.Serial' annotation. Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Whether to ignore 'Serializable' anonymous classes. Inspection ID: SerializableHasSerialVersionUIDField", + "markdown": "Reports classes that implement `Serializable` and do not declare a `serialVersionUID` field.\n\n\nWithout a `serialVersionUID` field, any change to the class will make previously serialized versions unreadable.\n\n**Example:**\n\n\n class Main implements Serializable {\n }\n\nAfter the quick-fix is applied:\n\n\n class Main implements Serializable {\n private static final long serialVersionUID = -1446398935944895849L;\n }\n\nWhen using a language level of JDK 14 or higher, the quickfix will also add the `java.io.Serial` annotation.\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization.\n* Whether to ignore `Serializable` anonymous classes.\n\nInspection ID: SerializableHasSerialVersionUIDField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "serial", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThrowableNotThrown", + "shortDescription": { + "text": "'Throwable' not thrown" + }, + "fullDescription": { + "text": "Reports instantiations of 'Throwable' or its subclasses, where the created 'Throwable' is never actually thrown. Additionally, this inspection reports method calls that return instances of 'Throwable' or its subclasses, when the result of the method call is not thrown. Calls to methods annotated with the Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation will not be reported. Example: 'void check(String s) {\n if (s == null) {\n new NullPointerException(\"s\");\n }\n // ...\n }' Inspection ID: ThrowableNotThrown", + "markdown": "Reports instantiations of `Throwable` or its subclasses, where the created `Throwable` is never actually thrown. Additionally, this inspection reports method calls that return instances of `Throwable` or its subclasses, when the result of the method call is not thrown.\n\nCalls to methods annotated with the Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation will not be reported.\n\n**Example:**\n\n\n void check(String s) {\n if (s == null) {\n new NullPointerException(\"s\");\n }\n // ...\n }\n\nInspection ID: ThrowableNotThrown" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ThrowableNotThrown", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CapturingCleaner", + "shortDescription": { + "text": "Cleaner captures object reference" + }, + "fullDescription": { + "text": "Reports 'Runnable' passed to a 'Cleaner.register()' capturing reference being registered. If the reference is captured, it will never be phantom reachable and the cleaning action will never be invoked. Possible sources of this problem: Lambda using non-static methods, fields, or 'this' itself Non-static inner class (anonymous or not) always captures this reference in java up to 18 version Instance method reference Access to outer class non-static members from non-static inner class Sample of code that will be reported: 'int fileDescriptor;\n Cleaner.Cleanable cleanable = Cleaner.create().register(this, () -> {\n System.out.println(\"adsad\");\n //this is captured via fileDescriptor\n fileDescriptor = 0;\n });' This inspection only reports if the language level of the project or module is 9 or higher. Inspection ID: CapturingCleaner New in 2018.1", + "markdown": "Reports `Runnable` passed to a `Cleaner.register()` capturing reference being registered. If the reference is captured, it will never be phantom reachable and the cleaning action will never be invoked.\n\nPossible sources of this problem:\n\n* Lambda using non-static methods, fields, or `this` itself\n* Non-static inner class (anonymous or not) always captures this reference in java up to 18 version\n* Instance method reference\n* Access to outer class non-static members from non-static inner class\n\nSample of code that will be reported:\n\n\n int fileDescriptor;\n Cleaner.Cleanable cleanable = Cleaner.create().register(this, () -> {\n System.out.println(\"adsad\");\n //this is captured via fileDescriptor\n fileDescriptor = 0;\n });\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nInspection ID: CapturingCleaner\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CapturingCleaner", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadStartInConstruction", + "shortDescription": { + "text": "Call to 'Thread.start()' during object construction" + }, + "fullDescription": { + "text": "Reports calls to 'start()' on 'java.lang.Thread' or any of its subclasses during object construction. While occasionally useful, such constructs should be avoided due to inheritance issues. Subclasses of a class that launches a thread during the object construction will not have finished any initialization logic of their own before the thread has launched. This inspection does not report if the class that starts a thread is declared 'final'. Example: 'class MyThread extends Thread {\n MyThread() {\n start();\n }\n }' Inspection ID: ThreadStartInConstruction", + "markdown": "Reports calls to `start()` on `java.lang.Thread` or any of its subclasses during object construction.\n\n\nWhile occasionally useful, such constructs should be avoided due to inheritance issues.\nSubclasses of a class that launches a thread during the object construction will not have finished\nany initialization logic of their own before the thread has launched.\n\nThis inspection does not report if the class that starts a thread is declared `final`.\n\n**Example:**\n\n\n class MyThread extends Thread {\n MyThread() {\n start();\n }\n }\n\nInspection ID: ThreadStartInConstruction" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToThreadStartDuringObjectConstruction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TestCaseWithNoTestMethods", + "shortDescription": { + "text": "Test class without tests" + }, + "fullDescription": { + "text": "Reports non-'abstract' test cases without any test methods. Such test cases usually indicate unfinished code or could be a refactoring leftover that should be removed. Example: 'public class CrucialTest {\n @Before\n public void setUp() {\n System.out.println(\"setting up\");\n }\n }' Inspection ID: TestCaseWithNoTestMethods", + "markdown": "Reports non-`abstract` test cases without any test methods. Such test cases usually indicate unfinished code or could be a refactoring leftover that should be removed.\n\nExample:\n\n\n public class CrucialTest {\n @Before\n public void setUp() {\n System.out.println(\"setting up\");\n }\n }\n\nInspection ID: TestCaseWithNoTestMethods" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JUnitTestCaseWithNoTests", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Test frameworks", + "index": 100, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwitchStatementWithTooManyBranches", + "shortDescription": { + "text": "Maximum 'switch' branches" + }, + "fullDescription": { + "text": "Reports 'switch' statements or expressions with too many 'case' labels. Such a long switch statement may be confusing and should probably be refactored. Sometimes, it is not a problem (for example, a domain is very complicated and has enums with a lot of constants). Example: 'switch (x) {\n case 1 -> {}\n case 2 -> {}\n case 3 -> {}\n case 4 -> {}\n case 5 -> {}\n case 6 -> {}\n case 7 -> {}\n case 8 -> {}\n case 9 -> {}\n case 10 -> {}\n case 11,12,13 -> {}\n default -> {}\n }' Use the Maximum number of branches field to specify the maximum number of 'case' labels expected. Inspection ID: SwitchStatementWithTooManyBranches", + "markdown": "Reports `switch` statements or expressions with too many `case` labels.\n\nSuch a long switch statement may be confusing and should probably be refactored.\nSometimes, it is not a problem (for example, a domain is very complicated and has enums with a lot of constants).\n\nExample:\n\n\n switch (x) {\n case 1 -> {}\n case 2 -> {}\n case 3 -> {}\n case 4 -> {}\n case 5 -> {}\n case 6 -> {}\n case 7 -> {}\n case 8 -> {}\n case 9 -> {}\n case 10 -> {}\n case 11,12,13 -> {}\n default -> {}\n }\n\nUse the **Maximum number of branches** field to specify the maximum number of `case` labels expected.\n\n\nInspection ID: SwitchStatementWithTooManyBranches" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SwitchStatementWithTooManyBranches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MismatchedArrayReadWrite", + "shortDescription": { + "text": "Mismatched read and write of array" + }, + "fullDescription": { + "text": "Reports arrays whose contents are read but not updated, or updated but not read. Such inconsistent reads and writes are pointless and probably indicate dead, incomplete or erroneous code. Example: 'final int[] bar = new int[3];\n bar[2] = 3;' Inspection ID: MismatchedArrayReadWrite", + "markdown": "Reports arrays whose contents are read but not updated, or updated but not read. Such inconsistent reads and writes are pointless and probably indicate dead, incomplete or erroneous code.\n\n**Example:**\n\n\n final int[] bar = new int[3];\n bar[2] = 3;\n\n\nInspection ID: MismatchedArrayReadWrite" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MismatchedReadAndWriteOfArray", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessarilyQualifiedStaticUsage", + "shortDescription": { + "text": "Unnecessarily qualified static access" + }, + "fullDescription": { + "text": "Reports usages of static members unnecessarily qualified with the class name. Qualification with the class is unnecessary when the static member is available in a surrounding class or in a super class of a surrounding class. Such qualification may be safely removed. Example: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }' After the quick-fix is applied: 'class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }' Use the inspection options to toggle the reporting for: Static fields access: 'void bar() { System.out.println(Foo.x); }' Calls to static methods: 'void bar() { Foo.foo(); }' Also, you can configure the inspection to only report static member usage in a static context. In this case, only 'static void baz() { Foo.foo(); }' will be reported. Inspection ID: UnnecessarilyQualifiedStaticUsage", + "markdown": "Reports usages of static members unnecessarily qualified with the class name.\n\n\nQualification with the class is unnecessary when the static member is available in a surrounding class\nor in a super class of a surrounding class. Such qualification may be safely removed.\n\n**Example:**\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n Foo.foo();\n System.out.println(Foo.x);\n }\n\n static void baz() { Foo.foo(); }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n static void foo() {}\n static int x;\n\n void bar() {\n foo();\n System.out.println(x);\n }\n\n static void baz() { foo(); }\n }\n\n\nUse the inspection options to toggle the reporting for:\n\n* Static fields access: \n `void bar() { System.out.println(Foo.x); }`\n\n* Calls to static methods: \n `void bar() { Foo.foo(); }`\n\n\nAlso, you can configure the inspection to only report static member usage\nin a static context. In this case, only `static void baz() { Foo.foo(); }` will be reported.\n\nInspection ID: UnnecessarilyQualifiedStaticUsage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessarilyQualifiedStaticUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoopConditionNotUpdatedInsideLoop", + "shortDescription": { + "text": "Loop variable not updated inside loop" + }, + "fullDescription": { + "text": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop. Such variables and parameters are usually used by mistake as they may cause an infinite loop if they are executed. Example: 'void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }' Configure the inspection: Use the Ignore possible non-local changes option to disable this inspection if the condition can be updated indirectly (e.g. via the called method or concurrently from another thread). Inspection ID: LoopConditionNotUpdatedInsideLoop", + "markdown": "Reports any variables and parameters that are used in a loop condition and are not updated inside the loop.\n\nSuch variables and parameters are usually used by mistake as they\nmay cause an infinite loop if they are executed.\n\nExample:\n\n\n void loopDoesNotLoop(boolean b) {\n while (b) {\n System.out.println();\n break;\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore possible non-local changes** option to disable this inspection\nif the condition can be updated indirectly (e.g. via the called method or concurrently from another thread).\n\nInspection ID: LoopConditionNotUpdatedInsideLoop" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "LoopConditionNotUpdatedInsideLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CollectionsMustHaveInitialCapacity", + "shortDescription": { + "text": "Collection without initial capacity" + }, + "fullDescription": { + "text": "Reports attempts to instantiate a new 'Collection' object without specifying an initial capacity. If no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing to specify initial capacities for collections may result in performance issues if space needs to be reallocated and memory copied when the initial capacity is exceeded. This inspection checks allocations of classes listed in the inspection's settings. Example: 'new HashMap();' Use the following options to configure the inspection: List collection classes that should be checked. Whether to ignore field initializers. Inspection ID: CollectionsMustHaveInitialCapacity", + "markdown": "Reports attempts to instantiate a new `Collection` object without specifying an initial capacity.\n\n\nIf no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing\nto specify initial capacities for collections may result in performance issues if space needs to be reallocated and\nmemory copied when the initial capacity is exceeded.\nThis inspection checks allocations of classes listed in the inspection's settings.\n\n**Example:**\n\n\n new HashMap();\n\nUse the following options to configure the inspection:\n\n* List collection classes that should be checked.\n* Whether to ignore field initializers.\n\nInspection ID: CollectionsMustHaveInitialCapacity" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CollectionWithoutInitialCapacity", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SystemGetProperty", + "shortDescription": { + "text": "Call to 'System.getProperty(str)' could be simplified" + }, + "fullDescription": { + "text": "Reports the usage of method 'System.getProperty(str)' and suggests a fix in 2 cases: 'System.getProperty(\"path.separator\")' -> 'File.pathSeparator' 'System.getProperty(\"line.separator\")' -> 'System.lineSeparator()' The second one is not only less error-prone but is likely to be faster, as 'System.lineSeparator()' returns cached value, while 'System.getProperty(\"line.separator\")' each time calls to Properties (Hashtable or CHM depending on implementation). Inspection ID: SystemGetProperty", + "markdown": "Reports the usage of method `System.getProperty(str)` and suggests a fix in 2 cases:\n\n* `System.getProperty(\"path.separator\")` -\\> `File.pathSeparator`\n* `System.getProperty(\"line.separator\")` -\\> `System.lineSeparator()`\n\nThe second one is not only less error-prone but is likely to be faster, as `System.lineSeparator()` returns cached value, while `System.getProperty(\"line.separator\")` each time calls to Properties (Hashtable or CHM depending on implementation).\n\nInspection ID: SystemGetProperty" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SystemGetProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DoubleCheckedLocking", + "shortDescription": { + "text": "Double-checked locking" + }, + "fullDescription": { + "text": "Reports double-checked locking. Double-checked locking tries to initialize a field on demand and in a thread-safe manner, while avoiding the cost of synchronization. Unfortunately it is not thread-safe when used on a field that is not declared 'volatile'. When using Java 1.4 or earlier, double-checked locking doesn't work even with a 'volatile' field. Read the article linked above for a detailed explanation of the problem. Example of incorrect double-checked locking: 'class Foo {\n private Helper helper = null;\n public Helper getHelper() {\n if (helper == null)\n synchronized(this) {\n if (helper == null) helper = new Helper();\n }\n return helper;\n }\n }\n // other functions and members...\n }' Inspection ID: DoubleCheckedLocking", + "markdown": "Reports [double-checked locking](https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html).\n\n\nDouble-checked locking tries to initialize a field on demand and in a thread-safe manner, while avoiding the cost of synchronization.\nUnfortunately it is not thread-safe when used on a field that is not declared `volatile`.\nWhen using Java 1.4 or earlier, double-checked locking doesn't work even with a `volatile` field.\nRead the article linked above for a detailed explanation of the problem.\n\nExample of incorrect double-checked locking:\n\n\n class Foo {\n private Helper helper = null;\n public Helper getHelper() {\n if (helper == null)\n synchronized(this) {\n if (helper == null) helper = new Helper();\n }\n return helper;\n }\n }\n // other functions and members...\n }\n\nInspection ID: DoubleCheckedLocking" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DoubleCheckedLocking", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassOnlyUsedInOneModule", + "shortDescription": { + "text": "Class only used from one other module" + }, + "fullDescription": { + "text": "Reports classes that: do not depend on any other class in their module depend on classes from a different module are a dependency only for classes from this other module Such classes could be moved into the module on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassOnlyUsedInOneModule", + "markdown": "Reports classes that:\n\n* do not depend on any other class in their module\n* depend on classes from a different module\n* are a dependency only for classes from this other module\n\nSuch classes could be moved into the module on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassOnlyUsedInOneModule" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassOnlyUsedInOneModule", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Modularization issues", + "index": 66, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TryStatementWithMultipleResources", + "shortDescription": { + "text": "'try' statement with multiple resources can be split" + }, + "fullDescription": { + "text": "Reports 'try' statements with multiple resources that can be automatically split into multiple try-with-resources statements. This conversion can be useful for further refactoring (for example, for extracting the nested 'try' statement into a separate method). Example: 'try (FileInputStream in = new FileInputStream(\"in.txt\");\n FileOutputStream out = new FileOutputStream(\"out.txt\")) {\n /*read and write*/\n }' After the quick-fix is applied: 'try (FileInputStream in = new FileInputStream(\"in.txt\")) {\n try (FileOutputStream out = new FileOutputStream(\"out.txt\")) {\n /*read and write*/\n }\n }' Inspection ID: TryStatementWithMultipleResources", + "markdown": "Reports `try` statements with multiple resources that can be automatically split into multiple try-with-resources statements.\n\nThis conversion can be useful for further refactoring\n(for example, for extracting the nested `try` statement into a separate method).\n\nExample:\n\n\n try (FileInputStream in = new FileInputStream(\"in.txt\");\n FileOutputStream out = new FileOutputStream(\"out.txt\")) {\n /*read and write*/\n }\n\nAfter the quick-fix is applied:\n\n\n try (FileInputStream in = new FileInputStream(\"in.txt\")) {\n try (FileOutputStream out = new FileOutputStream(\"out.txt\")) {\n /*read and write*/\n }\n }\n\nInspection ID: TryStatementWithMultipleResources" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TryStatementWithMultipleResources", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CloneableImplementsClone", + "shortDescription": { + "text": "Cloneable class without 'clone()' method" + }, + "fullDescription": { + "text": "Reports classes implementing the 'Cloneable' interface that don't override the 'clone()' method. Such classes use the default implementation of 'clone()', which isn't 'public' but 'protected', and which does not copy the mutable state of the class. A quick-fix is available to generate a basic 'clone()' method, which can be used as a basis for a properly functioning 'clone()' method expected from a 'Cloneable' class. Example: 'public class Data implements Cloneable {\n private String[] names;\n }' After the quick-fix is applied: 'public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' Use the Ignore classes cloneable due to inheritance option to ignore classes that are 'Cloneable' because they inherit from the 'Cloneable' class. Use the Ignore when Cloneable is necessary to call clone() method of super class option to ignore classes that require implementing 'Cloneable' because they call the 'clone()' method from a superclass. Inspection ID: CloneableImplementsClone", + "markdown": "Reports classes implementing the `Cloneable` interface that don't override the `clone()` method.\n\nSuch classes use the default implementation of `clone()`,\nwhich isn't `public` but `protected`, and which does not copy the mutable state of the class.\n\nA quick-fix is available to generate a basic `clone()` method,\nwhich can be used as a basis for a properly functioning `clone()` method\nexpected from a `Cloneable` class.\n\n**Example:**\n\n\n public class Data implements Cloneable {\n private String[] names;\n }\n\nAfter the quick-fix is applied:\n\n\n public class Data implements Cloneable {\n private String[] names;\n\n @Override\n public Data clone() {\n try {\n Data clone = (Data) super.clone();\n // TODO: copy mutable state here, so the clone can't change the internals of the original\n return clone;\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nUse the **Ignore classes cloneable due to inheritance** option to ignore classes that are\n`Cloneable` because they inherit from the `Cloneable` class.\n\nUse the **Ignore when Cloneable is necessary to call clone() method of super class**\noption to ignore classes that require implementing `Cloneable` because they call the `clone()` method from a superclass.\n\nInspection ID: CloneableImplementsClone" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CloneableClassWithoutClone", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Cloning issues", + "index": 82, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeMayBeWeakened", + "shortDescription": { + "text": "Type may be weakened" + }, + "fullDescription": { + "text": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable. Example: '// Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }' Enable the Only weaken to an interface checkbox below to only report a problem when the type can be weakened to an interface type. Enable the Do not suggest weakening variable declared as 'var' checkbox below to prevent reporting on local variables declared using the 'var' keyword (Java 10+) Stop classes are intended to prevent weakening to classes lower than stop classes, even if it is possible. In some cases, this may improve readability. Inspection ID: TypeMayBeWeakened", + "markdown": "Reports variable and method return types that can be changed to a more abstract (weaker) type. This allows making the code more abstract, hence more reusable.\n\nExample:\n\n\n // Type of parameter can be weakened to java.util.List\n void processList(ArrayList list) {\n if (list.isEmpty()) return;\n System.out.println(\"Processing\");\n for (String s : list) {\n System.out.println(\"String: \" + s);\n }\n }\n\n\nEnable the **Only weaken to an interface** checkbox below\nto only report a problem when the type can be weakened to an interface type.\n\n\nEnable the **Do not suggest weakening variable declared as 'var'** checkbox below\nto prevent reporting on local variables declared using the 'var' keyword (Java 10+)\n\n\n**Stop classes** are intended to prevent weakening to classes\nlower than stop classes, even if it is possible.\nIn some cases, this may improve readability.\n\nInspection ID: TypeMayBeWeakened" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TypeMayBeWeakened", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OctalAndDecimalIntegersMixed", + "shortDescription": { + "text": "Octal and decimal integers in same array" + }, + "fullDescription": { + "text": "Reports mixed octal and decimal integer literals in a single array initializer. This situation might happen when you copy a list of numbers into an array initializer. Some numbers in the array might be zero-padded and the compiler will interpret them as octal. Example: 'int[] elapsed = {1, 13, 052};' After the quick-fix that removes a leading zero is applied: 'int[] elapsed = {1, 13, 52};' If it is an octal number (for example, after a variable inline), then you can use another quick-fix that converts octal to decimal: 'int[] elapsed = {1, 13, 42};' Inspection ID: OctalAndDecimalIntegersMixed", + "markdown": "Reports mixed octal and decimal integer literals in a single array initializer. This situation might happen when you copy a list of numbers into an array initializer. Some numbers in the array might be zero-padded and the compiler will interpret them as octal.\n\n**Example:**\n\n int[] elapsed = {1, 13, 052};\n\nAfter the quick-fix that removes a leading zero is applied:\n\n int[] elapsed = {1, 13, 52};\n\nIf it is an octal number (for example, after a variable inline), then you can use another quick-fix that converts octal to decimal:\n`int[] elapsed = {1, 13, 42};`\n\n\nInspection ID: OctalAndDecimalIntegersMixed" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OctalAndDecimalIntegersInSameArray", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Deprecation", + "shortDescription": { + "text": "Deprecated API usage" + }, + "fullDescription": { + "text": "Reports usages of deprecated classes, fields, and methods. A quick-fix is available to automatically convert the deprecated usage, when the necessary information can be extracted from the Javadoc of the deprecated member. Example: 'class Interesting {\n\n /**\n * @deprecated Use {@link #newHotness()} instead\n */\n @Deprecated\n public void oldAndBusted() {}\n\n public void newHotness() {}\n }\n class ElseWhere {\n void x(Interesting i) {\n i.oldAndBusted(); // deprecated warning here\n }\n }' After the quick-fix is applied: 'class Interesting {\n\n /**\n * @deprecated Use {@link #newHotness()} instead\n */\n @Deprecated\n public void oldAndBusted() {}\n\n public void newHotness() {}\n }\n class ElseWhere {\n void x(Interesting i) {\n i.newHotness();\n }\n }' By default, the inspection doesn't produce a warning if it's impossible or hard to avoid it. For example, the following code won't be reported: 'abstract class A { //library code\n @Deprecated\n abstract void m();\n }\n class B extends A { //project code\n @Override\n void m() {\n //doSmth;\n }\n }' Configure the inspection: Use the options to disable this inspection inside deprecated members, overrides of abstract deprecated methods, non-static import statements, methods of deprecated classes, or same top-level classes. Inspection ID: Deprecation", + "markdown": "Reports usages of deprecated classes, fields, and methods. A quick-fix is available to automatically convert the deprecated usage, when the necessary information can be extracted from the Javadoc of the deprecated member.\n\n**Example:**\n\n\n class Interesting {\n\n /**\n * @deprecated Use {@link #newHotness()} instead\n */\n @Deprecated\n public void oldAndBusted() {}\n\n public void newHotness() {}\n }\n class ElseWhere {\n void x(Interesting i) {\n i.oldAndBusted(); // deprecated warning here\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Interesting {\n\n /**\n * @deprecated Use {@link #newHotness()} instead\n */\n @Deprecated\n public void oldAndBusted() {}\n\n public void newHotness() {}\n }\n class ElseWhere {\n void x(Interesting i) {\n i.newHotness();\n }\n }\n\nBy default, the inspection doesn't produce a warning if it's impossible or hard to avoid it. For example,\nthe following code won't be reported:\n\n\n abstract class A { //library code\n @Deprecated\n abstract void m();\n }\n class B extends A { //project code\n @Override\n void m() {\n //doSmth;\n }\n }\n\nConfigure the inspection:\n\n\nUse the options to disable this inspection inside deprecated members,\noverrides of abstract deprecated methods, non-static import statements, methods of deprecated classes, or same top-level classes.\n\nInspection ID: Deprecation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "deprecation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MisspelledMethodName", + "shortDescription": { + "text": "Method names differing only by case" + }, + "fullDescription": { + "text": "Reports cases in which multiple methods of a class have the names that differ only by case. Such names may be very confusing. Example: 'public int hashcode() { // reported, should be hashCode probably?\n return 0;\n }' A quick-fix that renames such methods is available only in the editor. Use the Ignore methods overriding/implementing a super method option to ignore methods overriding or implementing a method from the superclass. Inspection ID: MisspelledMethodName", + "markdown": "Reports cases in which multiple methods of a class have the names that differ only by case. Such names may be very confusing.\n\n**Example:**\n\n\n public int hashcode() { // reported, should be hashCode probably?\n return 0;\n }\n\nA quick-fix that renames such methods is available only in the editor.\n\nUse the **Ignore methods overriding/implementing a super method** option to ignore methods overriding or implementing a method from\nthe superclass.\n\n\nInspection ID: MisspelledMethodName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodNamesDifferingOnlyByCase", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Method", + "index": 91, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonSerializableObjectBoundToHttpSession", + "shortDescription": { + "text": "Non-serializable object bound to 'HttpSession'" + }, + "fullDescription": { + "text": "Reports objects of classes not implementing 'java.io.Serializable' used as arguments to 'javax.servlet.http.HttpSession.setAttribute()' or 'javax.servlet.http.HttpSession.putValue()'. Such objects will not be serialized if the 'HttpSession' is passivated or migrated, and may result in difficult-to-diagnose bugs. This inspection assumes objects of the types 'java.util.Collection' and 'java.util.Map' to be 'Serializable', unless type parameters are non-'Serializable'. Example: 'void foo(HttpSession session) {\n session.setAttribute(\"foo\", new NonSerializable());\n }\n static class NonSerializable {}' Inspection ID: NonSerializableObjectBoundToHttpSession", + "markdown": "Reports objects of classes not implementing `java.io.Serializable` used as arguments to `javax.servlet.http.HttpSession.setAttribute()` or `javax.servlet.http.HttpSession.putValue()`.\n\n\nSuch objects will not be serialized if the `HttpSession` is passivated or migrated,\nand may result in difficult-to-diagnose bugs.\n\n\nThis inspection assumes objects of the types `java.util.Collection` and\n`java.util.Map` to be `Serializable`,\nunless type parameters are non-`Serializable`.\n\n**Example:**\n\n\n void foo(HttpSession session) {\n session.setAttribute(\"foo\", new NonSerializable());\n }\n static class NonSerializable {}\n\nInspection ID: NonSerializableObjectBoundToHttpSession" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonSerializableObjectBoundToHttpSession", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionSignal", + "shortDescription": { + "text": "Call to 'signal()' instead of 'signalAll()'" + }, + "fullDescription": { + "text": "Reports calls to 'java.util.concurrent.locks.Condition.signal()'. While occasionally useful, in almost all cases 'signalAll()' is a better and safer choice. Inspection ID: ConditionSignal", + "markdown": "Reports calls to `java.util.concurrent.locks.Condition.signal()`. While occasionally useful, in almost all cases `signalAll()` is a better and safer choice.\n\nInspection ID: ConditionSignal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToSignalInsteadOfSignalAll", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadLocalNotStaticFinal", + "shortDescription": { + "text": "'ThreadLocal' field not declared 'static final'" + }, + "fullDescription": { + "text": "Reports fields of type 'java.lang.ThreadLocal' that are not declared 'static final'. In the most common case, a 'java.lang.ThreadLocal' instance associates state with a thread. A non-static non-final 'java.lang.ThreadLocal' field associates state with an instance-thread combination. This is usually unnecessary and quite often is a bug that can cause memory leaks and incorrect behavior. A quick-fix is suggested to make the field 'static final'. Example: 'private ThreadLocal tl = ThreadLocal.withInitial(() -> Boolean.TRUE);' Inspection ID: ThreadLocalNotStaticFinal", + "markdown": "Reports fields of type `java.lang.ThreadLocal` that are not declared `static final`.\n\n\nIn the most common case, a `java.lang.ThreadLocal` instance associates state with a thread.\nA non-static non-final `java.lang.ThreadLocal` field associates state with an instance-thread combination.\nThis is usually unnecessary and quite often is a bug that can cause memory leaks and incorrect behavior.\n\n\nA quick-fix is suggested to make the field `static final`.\n\n\n**Example:**\n\n\n private ThreadLocal tl = ThreadLocal.withInitial(() -> Boolean.TRUE);\n\nInspection ID: ThreadLocalNotStaticFinal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ThreadLocalNotStaticFinal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AccessStaticViaInstance", + "shortDescription": { + "text": "Access static member via instance reference" + }, + "fullDescription": { + "text": "Reports references to 'static' methods and fields via a class instance rather than the class itself. Even though referring to static members via instance variables is allowed by The Java Language Specification, this makes the code confusing as the reader may think that the result of the method depends on the instance. The quick-fix replaces the instance variable with the class name. Example: 'String s1 = s.valueOf(0);' After the quick-fix is applied: 'String s = String.valueOf(0);' Inspection ID: AccessStaticViaInstance", + "markdown": "Reports references to `static` methods and fields via a class instance rather than the class itself.\n\nEven though referring to static members via instance variables is allowed by The Java Language Specification,\nthis makes the code confusing as the reader may think that the result of the method depends on the instance.\n\nThe quick-fix replaces the instance variable with the class name.\n\nExample:\n\n\n String s1 = s.valueOf(0);\n\nAfter the quick-fix is applied:\n\n\n String s = String.valueOf(0);\n\n\nInspection ID: AccessStaticViaInstance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AccessStaticViaInstance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicMethodWithoutLogging", + "shortDescription": { + "text": "'public' method without logging" + }, + "fullDescription": { + "text": "Reports any public methods that do not contain a logging statement. This inspection does not report simple getters and setters. For example: 'public class Crucial {\n private static final Logger LOG = LoggerFactory.getLogger(Crucial.class);\n public void doImportantStuff() {\n // warning on this method\n }\n\n public void doOtherStuff() {\n LOG.info(\"do other stuff\");\n }\n }' Use the table below to specify Logger class names. Public methods that do not use instance methods of the specified classes will be reported by this inspection. Inspection ID: PublicMethodWithoutLogging", + "markdown": "Reports any public methods that do not contain a logging statement. This inspection does not report simple getters and setters.\n\nFor example:\n\n\n public class Crucial {\n private static finalLogger LOG = LoggerFactory.getLogger(Crucial.class);\n public void doImportantStuff() {\n // warning on this method\n }\n\n public void doOtherStuff() {\n LOG.info(\"do other stuff\");\n }\n }\n\n\nUse the table below to specify Logger class names.\nPublic methods that do not use instance methods of the specified classes will be reported by this inspection.\n\nInspection ID: PublicMethodWithoutLogging" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PublicMethodWithoutLogging", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Logging", + "index": 98, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassNestingDepth", + "shortDescription": { + "text": "Inner class too deeply nested" + }, + "fullDescription": { + "text": "Reports classes whose number of nested inner classes exceeds the specified maximum. Nesting inner classes inside other inner classes is confusing and indicates that a refactoring may be necessary. Use the Nesting limit field to specify the maximum allowed nesting depth for a class. Inspection ID: ClassNestingDepth", + "markdown": "Reports classes whose number of nested inner classes exceeds the specified maximum.\n\nNesting inner classes inside other inner classes is confusing and indicates that a refactoring may be necessary.\n\nUse the **Nesting limit** field to specify the maximum allowed nesting depth for a class.\n\n\nInspection ID: ClassNestingDepth" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InnerClassTooDeeplyNested", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class metrics", + "index": 90, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CallToNativeMethodWhileLocked", + "shortDescription": { + "text": "Call to a 'native' method while locked" + }, + "fullDescription": { + "text": "Reports calls 'native' methods within a 'synchronized' block or method. When possible, it's better to keep calls to 'native' methods out of the synchronized context because such calls cause an expensive context switch and may lead to performance issues. Example: 'native void nativeMethod();\n\n void example(){\n synchronized (lock){\n nativeMethod();//warning\n }\n }' Inspection ID: CallToNativeMethodWhileLocked", + "markdown": "Reports calls `native` methods within a `synchronized` block or method.\n\n\nWhen possible, it's better to keep calls to `native` methods out of the synchronized context\nbecause such calls cause an expensive context switch and may lead to performance issues.\n\n**Example:**\n\n\n native void nativeMethod();\n\n void example(){\n synchronized (lock){\n nativeMethod();//warning\n }\n }\n\nInspection ID: CallToNativeMethodWhileLocked" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToNativeMethodWhileLocked", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Dependency", + "shortDescription": { + "text": "Illegal package dependencies" + }, + "fullDescription": { + "text": "Reports illegal dependencies between scopes according to the dependency rules given. Dependency rules can be used to prohibit usage from a scope to another scope. Use the Configure dependency rules button below to customize validation rules. Inspection ID: Dependency", + "markdown": "Reports illegal dependencies between scopes according to the dependency rules given. Dependency rules can be used to prohibit usage from a scope to another scope.\n\nUse the **Configure dependency rules** button below to customize validation rules.\n\nInspection ID: Dependency" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "Dependency", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestingDepth", + "shortDescription": { + "text": "Overly nested method" + }, + "fullDescription": { + "text": "Reports methods whose body contain too deeply nested statements. Methods with too deep statement nesting may be confusing and are a good sign that refactoring may be necessary. Use the Nesting depth limit field to specify the maximum allowed nesting depth for a method. Inspection ID: NestingDepth", + "markdown": "Reports methods whose body contain too deeply nested statements.\n\nMethods with too deep statement\nnesting may be confusing and are a good sign that refactoring may be necessary.\n\nUse the **Nesting depth limit** field to specify the maximum allowed nesting depth for a method.\n\n\nInspection ID: NestingDepth" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyNestedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LambdaParameterTypeCanBeSpecified", + "shortDescription": { + "text": "Lambda parameter type can be specified" + }, + "fullDescription": { + "text": "Reports lambda parameters that do not have their type specified and suggests adding the missing type declarations. Example: 'Function length = a -> a.length();' After the quick-fix is applied: 'Function length = (String a) -> a.length();' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: LambdaParameterTypeCanBeSpecified", + "markdown": "Reports lambda parameters that do not have their type specified and suggests adding the missing type declarations.\n\nExample:\n\n\n Function length = a -> a.length();\n\nAfter the quick-fix is applied:\n\n\n Function length = (String a) -> a.length();\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: LambdaParameterTypeCanBeSpecified" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LambdaParameterTypeCanBeSpecified", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TextLabelInSwitchStatement", + "shortDescription": { + "text": "Text label in 'switch' statement" + }, + "fullDescription": { + "text": "Reports labeled statements inside of 'switch' statements. While occasionally intended, this construction is often the result of a typo. Example: 'switch (x) {\n case 1:\n case2: //warning: Text label 'case2:' in 'switch' statement\n case 3:\n break;\n }' Inspection ID: TextLabelInSwitchStatement", + "markdown": "Reports labeled statements inside of `switch` statements. While occasionally intended, this construction is often the result of a typo.\n\n**Example:**\n\n\n switch (x) {\n case 1:\n case2: //warning: Text label 'case2:' in 'switch' statement\n case 3:\n break;\n }\n\nInspection ID: TextLabelInSwitchStatement" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "TextLabelInSwitchStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageVisibleInnerClass", + "shortDescription": { + "text": "Package-visible nested class" + }, + "fullDescription": { + "text": "Reports nested classes that are declared without any access modifier (also known as package-private). Example: 'public class Outer {\n static class Nested {} // warning\n class Inner {} // warning\n enum Mode {} // warning depends on the setting\n interface I {} // warning depends on the setting\n }' Configure the inspection: Use the Ignore package-visible inner enums option to ignore package-private inner enums. Use the Ignore package-visible inner interfaces option to ignore package-private inner interfaces. Inspection ID: PackageVisibleInnerClass", + "markdown": "Reports nested classes that are declared without any access modifier (also known as package-private).\n\n**Example:**\n\n\n public class Outer {\n static class Nested {} // warning\n class Inner {} // warning\n enum Mode {} // warning depends on the setting\n interface I {} // warning depends on the setting\n }\n\nConfigure the inspection:\n\n* Use the **Ignore package-visible inner enums** option to ignore package-private inner enums.\n* Use the **Ignore package-visible inner interfaces** option to ignore package-private inner interfaces.\n\nInspection ID: PackageVisibleInnerClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PackageVisibleInnerClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Encapsulation", + "index": 59, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryUnaryMinus", + "shortDescription": { + "text": "Unnecessary unary minus" + }, + "fullDescription": { + "text": "Reports unnecessary unary minuses. Such expressions might be hard to understand and might contain errors. For example: 'void unaryMinus(int i) {\n int x = - -i;\n }' The following quick fixes are suggested here: Remove '-' operators before the 'i' variable: 'void unaryMinus(int i) {\n int x = i;\n }' Replace '-' operators with the prefix decrement operator: 'void unaryMinus(int i) {\n int x = --i;\n }' Another example: 'void unaryMinus(int i) {\n i += - 8;\n }' After the quick-fix is applied: 'void unaryMinus(int i) {\n i -= 8;\n }' Inspection ID: UnnecessaryUnaryMinus", + "markdown": "Reports unnecessary unary minuses. Such expressions might be hard to understand and might contain errors.\n\n**For example:**\n\n void unaryMinus(int i) {\n int x = - -i;\n }\n\nThe following quick fixes are suggested here:\n\n* Remove `-` operators before the `i` variable:\n\n void unaryMinus(int i) {\n int x = i;\n }\n\n* Replace `-` operators with the prefix decrement operator:\n\n void unaryMinus(int i) {\n int x = --i;\n }\n\n**Another example:**\n\n void unaryMinus(int i) {\n i += - 8;\n }\n\nAfter the quick-fix is applied:\n\n void unaryMinus(int i) {\n i -= 8;\n }\n\nInspection ID: UnnecessaryUnaryMinus" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryUnaryMinus", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WriteOnlyObject", + "shortDescription": { + "text": "Write-only object" + }, + "fullDescription": { + "text": "Reports objects that are modified but never queried. The inspection relies on the method mutation contract, which could be inferred or pre-annotated for some library methods. This inspection does not report collections, maps, and string builders, as these types are reported by other more precise inspections. Example: 'AtomicReference ref = new AtomicReference<>();\n ref.set(\"hello\"); // ref is never used again' Use the Ignore impure constructors option to control whether to process objects created by constructor or method whose purity is not known. Unchecking the option may introduce some false-positives if the object reference is intentionally leaked during the construction. New in 2021.2 Inspection ID: WriteOnlyObject", + "markdown": "Reports objects that are modified but never queried.\n\nThe inspection relies on the method mutation contract, which could be inferred\nor pre-annotated for some library methods. This inspection does not report collections, maps, and string builders, as these types\nare reported by other more precise inspections.\n\nExample:\n\n\n AtomicReference ref = new AtomicReference<>();\n ref.set(\"hello\"); // ref is never used again\n\n\nUse the **Ignore impure constructors** option to control whether to process objects created by constructor or method whose purity is not known.\nUnchecking the option may introduce some false-positives if the object reference is intentionally leaked during the construction.\n**New in 2021.2**\n\nInspection ID: WriteOnlyObject" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "WriteOnlyObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodMayBeStatic", + "shortDescription": { + "text": "Method can be made 'static'" + }, + "fullDescription": { + "text": "Reports methods that can safely be made 'static'. Making methods static when possible can reduce memory consumption and improve your code quality. A method can be 'static' if: it is not 'synchronized', 'native' or 'abstract', does not reference any of non-static methods and non-static fields from the containing class, is not an override and is not overridden in a subclass. Use the following options to configure the inspection: Whether to report only 'private' and 'final' methods, which increases the performance of this inspection. Whether to ignore empty methods. Whether to ignore default methods in interface when using Java 8 or higher. Whether to let the quick-fix replace instance qualifiers with class references in calls to methods which are made 'static', that is, call 'myClass.m()' would be replaced with 'MyClass.m()'. Inspection ID: MethodMayBeStatic", + "markdown": "Reports methods that can safely be made `static`. Making methods static when possible can reduce memory consumption and improve your code quality.\n\nA method can be `static` if:\n\n* it is not `synchronized`, `native` or `abstract`,\n* does not reference any of non-static methods and non-static fields from the containing class,\n* is not an override and is not overridden in a subclass.\n\nUse the following options to configure the inspection:\n\n* Whether to report only `private` and `final` methods, which increases the performance of this inspection.\n* Whether to ignore empty methods.\n* Whether to ignore default methods in interface when using Java 8 or higher.\n* Whether to let the quick-fix replace instance qualifiers with class references in calls to methods which are made `static`, that is, call `myClass.m()` would be replaced with `MyClass.m()`.\n\nInspection ID: MethodMayBeStatic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodMayBeStatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TestMethodWithoutAssertion", + "shortDescription": { + "text": "Test method without assertions" + }, + "fullDescription": { + "text": "Reports test methods that do not contain any assertions. Such methods may indicate either incomplete or weak test cases. Example: 'public class ExtensiveTest {\n\n @Test\n public void testAlive() {\n System.out.println(\"nothing\");\n }\n }' Configure the inspection: Use the table to specify the combinations of fully qualified class name and method name regular expression that should qualify as assertions. Class names also match subclasses. Use the 'assert' keyword is considered an assertion option to specify if the Java 'assert' statements using the 'assert' keyword should be considered an assertion. Use the Ignore test methods which declare exceptions option to ignore the test methods that declare exceptions. This can be useful when you have tests that will throw an exception on failure and thus don't need any assertions. Inspection ID: TestMethodWithoutAssertion", + "markdown": "Reports test methods that do not contain any assertions. Such methods may indicate either incomplete or weak test cases.\n\n**Example:**\n\n\n public class ExtensiveTest {\n\n @Test\n public void testAlive() {\n System.out.println(\"nothing\");\n }\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the combinations of fully qualified class name and method name regular expression that should qualify as assertions. Class names also match subclasses.\n* Use the **'assert' keyword is considered an assertion** option to specify if the Java `assert` statements using the `assert` keyword should be considered an assertion.\n* Use the **Ignore test methods which declare exceptions** option to ignore the test methods that declare exceptions. This can be useful when you have tests that will throw an exception on failure and thus don't need any assertions.\n\nInspection ID: TestMethodWithoutAssertion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TestMethodWithoutAssertion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Test frameworks", + "index": 100, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SocketResource", + "shortDescription": { + "text": "Socket opened but not safely closed" + }, + "fullDescription": { + "text": "Reports socket resources that are not safely closed. Socket resources reported by this inspection include 'java.net.Socket', 'java.net.DatagramSocket', and 'java.net.ServerSocket'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'byte[] getMessage(ServerSocket socket) throws IOException {\n Socket client = socket.accept(); //socket is not closed\n return client.getInputStream().readAllBytes();\n }' Use the following options to configure the inspection: Whether a socket is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: SocketResource", + "markdown": "Reports socket resources that are not safely closed. Socket resources reported by this inspection include `java.net.Socket`, `java.net.DatagramSocket`, and `java.net.ServerSocket`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n byte[] getMessage(ServerSocket socket) throws IOException {\n Socket client = socket.accept(); //socket is not closed\n return client.getInputStream().readAllBytes();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a socket is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: SocketResource" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SocketOpenedButNotSafelyClosed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Resource management", + "index": 47, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeParameterHidesVisibleType", + "shortDescription": { + "text": "Type parameter hides visible type" + }, + "fullDescription": { + "text": "Reports type parameters that have the same names as the visible types in the current scope. Such parameter names may be confusing. Example: 'abstract class MyList extends AbstractList {\n private List elements;\n // type parameter 'T' hides type parameter 'T'\n public T[] toArray(T[] array) {\n return elements.toArray(array);\n }\n}' Inspection ID: TypeParameterHidesVisibleType", + "markdown": "Reports type parameters that have the same names as the visible types in the current scope. Such parameter names may be confusing.\n\nExample:\n\n\n abstract class MyList extends AbstractList {\n private List elements;\n // type parameter 'T' hides type parameter 'T'\n public T[] toArray(T[] array) {\n return elements.toArray(array);\n }\n }\n\nInspection ID: TypeParameterHidesVisibleType" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "TypeParameterHidesVisibleType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MaskedAssertion", + "shortDescription": { + "text": "Assertion is suppressed by 'catch'" + }, + "fullDescription": { + "text": "Reports 'assert' statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown 'AssertionError' will be caught and silently ignored. Example 1: 'void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 2: '@Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Example 3: '@Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }' Inspection ID: MaskedAssertion New in 2020.3", + "markdown": "Reports `assert` statements and test framework assertions that are suppressed by a surrounding catch block. Such assertions will never fail, as the thrown `AssertionError` will be caught and silently ignored.\n\n**Example 1:**\n\n\n void javaAssertion() {\n try {\n ...\n assert 1 == 2;\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 2:**\n\n\n @Test\n void testWithAssertJ() {\n try {\n ...\n assertThat(1).as(\"test\").isEqualTo(2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\n**Example 3:**\n\n\n @Test\n void testWithJunit() {\n try {\n ...\n assertEquals(1, 2);\n } catch (AssertionError e) {\n // the assertion is silently ignored\n }\n }\n\nInspection ID: MaskedAssertion\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MaskedAssertion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Test frameworks", + "index": 102, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringTokenizerDelimiter", + "shortDescription": { + "text": "Duplicated delimiters in 'StringTokenizer'" + }, + "fullDescription": { + "text": "Reports 'StringTokenizer()' constructor calls or 'nextToken()' method calls that contain duplicate characters in the delimiter argument. Example: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }' After the quick-fix is applied: 'void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }' Inspection ID: StringTokenizerDelimiter", + "markdown": "Reports `StringTokenizer()` constructor calls or `nextToken()` method calls that contain duplicate characters in the delimiter argument.\n\n**Example:**\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void printTokens(String text) {\n StringTokenizer tokenizer = new StringTokenizer(text, \"\\n\");\n while (tokenizer.hasMoreTokens()) {\n System.out.println(tokenizer.nextToken());\n }\n }\n\nInspection ID: StringTokenizerDelimiter" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringTokenizerDelimiter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReflectionForUnavailableAnnotation", + "shortDescription": { + "text": "Reflective access to a source-only annotation" + }, + "fullDescription": { + "text": "Reports attempts to reflectively check for the presence of a non-runtime annotation. Using 'Class.isAnnotationPresent()' to test for an annotation whose retention policy is set to 'SOURCE' or 'CLASS' (the default) will always have a negative result. This mistake is easy to overlook. Example: '{\n getClass().isAnnotationPresent(SourceAnnotation.class); //always false\n }\n\n @Retention(RetentionPolicy.SOURCE)\n @interface SourceAnnotation {}' This inspection depends on the Java feature 'Annotations', which is available since Java 5. Inspection ID: ReflectionForUnavailableAnnotation", + "markdown": "Reports attempts to reflectively check for the presence of a non-runtime annotation.\n\nUsing `Class.isAnnotationPresent()` to test for an annotation\nwhose retention policy is set to `SOURCE` or `CLASS`\n(the default) will always have a negative result. This mistake is easy to overlook.\n\n**Example:**\n\n\n {\n getClass().isAnnotationPresent(SourceAnnotation.class); //always false\n }\n\n @Retention(RetentionPolicy.SOURCE)\n @interface SourceAnnotation {}\n\n\nThis inspection depends on the Java feature 'Annotations', which is available since Java 5.\n\nInspection ID: ReflectionForUnavailableAnnotation" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ReflectionForUnavailableAnnotation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InstantiatingObjectToGetClassObject", + "shortDescription": { + "text": "Instantiating object to get 'Class' object" + }, + "fullDescription": { + "text": "Reports code that instantiates a class to get its class object. It is more performant to access the class object directly by name. Example: 'Class c = new Sample().getClass();' After the quick-fix is applied: 'Class c = Sample.class;' Inspection ID: InstantiatingObjectToGetClassObject", + "markdown": "Reports code that instantiates a class to get its class object.\n\nIt is more performant to access the class object\ndirectly by name.\n\n**Example:**\n\n\n Class c = new Sample().getClass();\n\nAfter the quick-fix is applied:\n\n\n Class c = Sample.class;\n\nInspection ID: InstantiatingObjectToGetClassObject" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InstantiatingObjectToGetClassObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ShiftOutOfRange", + "shortDescription": { + "text": "Shift operation by inappropriate constant" + }, + "fullDescription": { + "text": "Reports shift operations where the shift value is a constant outside the reasonable range. Integer shift operations outside the range '0..31' and long shift operations outside the range '0..63' are reported. Shifting by negative or overly large values is almost certainly a coding error. Example: 'int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;' Inspection ID: ShiftOutOfRange", + "markdown": "Reports shift operations where the shift value is a constant outside the reasonable range.\n\nInteger shift operations outside the range `0..31` and long shift operations outside the\nrange `0..63` are reported. Shifting by negative or overly large values is almost certainly\na coding error.\n\n**Example:**\n\n\n int shiftSize = 32;\n // Warning: shift by 32 bits is equivalent to shift by 0 bits, so there's no shift at all.\n int mask = (1 << shiftSize) - 1;\n\nInspection ID: ShiftOutOfRange" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ShiftOutOfRange", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Bitwise operation issues", + "index": 103, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithMultipleLoggers", + "shortDescription": { + "text": "Class with multiple loggers" + }, + "fullDescription": { + "text": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application. For example: 'public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }' Use the table below to specify Logger class names. Classes which declare multiple fields that have the type of one of the specified classes will be reported by this inspection. Inspection ID: ClassWithMultipleLoggers", + "markdown": "Reports classes that have multiple loggers declared. Ensuring that every class has a single dedicated logger is an important step in providing a unified logging implementation for an application.\n\nFor example:\n\n\n public class Critical {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n protected static final Logger myLogger = Logger.getLogger(getClass());\n }\n\n\nUse the table below to specify Logger class names.\nClasses which declare multiple fields that have the type of one of the specified classes will be reported by this inspection.\n\n\nInspection ID: ClassWithMultipleLoggers" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithMultipleLoggers", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Logging", + "index": 98, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadRun", + "shortDescription": { + "text": "Call to 'Thread.run()'" + }, + "fullDescription": { + "text": "Reports calls to 'run()' on 'java.lang.Thread' or any of its subclasses. While occasionally intended, this is usually a mistake, because 'run()' doesn't start a new thread. To execute the code in a separate thread, 'start()' should be used. Inspection ID: ThreadRun", + "markdown": "Reports calls to `run()` on `java.lang.Thread` or any of its subclasses.\n\n\nWhile occasionally intended, this is usually a mistake, because `run()` doesn't start a new thread.\nTo execute the code in a separate thread, `start()` should be used.\n\n\nInspection ID: ThreadRun" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CallToThreadRun", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EscapedSpace", + "shortDescription": { + "text": "Non-terminal use of '\\s' escape sequence" + }, + "fullDescription": { + "text": "Reports '\\s' escape sequences anywhere except at text-block line endings or within a series of several escaped spaces. Such usages can be confusing or a mistake, especially if the string is interpreted as a regular expression. The '\\s' escape sequence is intended to encode a space at the end of text-block lines where normal spaces are trimmed. In other locations, as well as in regular string or char literals, '\\s' is identical to an ordinary space character ('\" \"'). Example: 'if (str.matches(\"\\s+\")) {...}' Here it's likely that '\"\\\\s+\"' was intended (to match any whitespace character). If not, using 'str.matches(\" +\")' would be less confusing. A quick-fix is provided that replaces '\\s' escapes with space characters. This inspection depends on the Java feature ''\\s' escape sequences', which is available since Java 15. Inspection ID: EscapedSpace New in 2022.3", + "markdown": "Reports `\\s` escape sequences anywhere except at text-block line endings or within a series of several escaped spaces. Such usages can be confusing or a mistake, especially if the string is interpreted as a regular expression. The `\\s` escape sequence is intended to encode a space at the end of text-block lines where normal spaces are trimmed. In other locations, as well as in regular string or char literals, `\\s` is identical to an ordinary space character (`\" \"`).\n\n**Example:**\n\n\n if (str.matches(\"\\s+\")) {...}\n\nHere it's likely that `\"\\\\s+\"` was intended (to match any whitespace character). If not, using `str.matches(\" +\")` would be less confusing.\n\n\nA quick-fix is provided that replaces `\\s` escapes with space characters.\n\nThis inspection depends on the Java feature ''\\\\s' escape sequences', which is available since Java 15.\n\nInspection ID: EscapedSpace\n\nNew in 2022.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EscapedSpace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExtendsThrowable", + "shortDescription": { + "text": "Class directly extends 'Throwable'" + }, + "fullDescription": { + "text": "Reports classes that directly extend 'java.lang.Throwable'. Extending 'java.lang.Throwable' directly is generally considered bad practice. It is usually enough to extend 'java.lang.RuntimeException', 'java.lang.Exception', or - in special cases - 'java.lang.Error'. Example: 'class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'' Inspection ID: ExtendsThrowable", + "markdown": "Reports classes that directly extend `java.lang.Throwable`.\n\nExtending `java.lang.Throwable` directly is generally considered bad practice.\nIt is usually enough to extend `java.lang.RuntimeException`, `java.lang.Exception`, or - in special\ncases - `java.lang.Error`.\n\n**Example:**\n\n\n class EnigmaThrowable extends Throwable {} // warning: Class 'EnigmaThrowable' directly extends 'java.lang.Throwable'\n\nInspection ID: ExtendsThrowable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExtendsThrowable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AutoBoxing", + "shortDescription": { + "text": "Auto-boxing" + }, + "fullDescription": { + "text": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance. Example: 'Integer x = 42;' The quick-fix makes the conversion explicit: 'Integer x = Integer.valueOf(42);' AutoBoxing appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: AutoBoxing", + "markdown": "Reports expressions that are affected by autoboxing conversion (automatic wrapping of primitive values as objects). Try not to use objects instead of primitives. It might significantly affect performance.\n\n**Example:**\n\n Integer x = 42;\n\nThe quick-fix makes the conversion explicit:\n\n Integer x = Integer.valueOf(42);\n\n\n*AutoBoxing* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: AutoBoxing" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AutoBoxing", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InterfaceNeverImplemented", + "shortDescription": { + "text": "Interface which has no concrete subclass" + }, + "fullDescription": { + "text": "Reports interfaces that have no concrete subclasses. Configure the inspection: Use the list below to add annotations. Interfaces declared with one of these annotations will be ignored by the inspection. Use the checkbox below to ignore interfaces that only declare constant fields. Such interfaces may still be usable even without implementations. Inspection ID: InterfaceNeverImplemented", + "markdown": "Reports interfaces that have no concrete subclasses.\n\nConfigure the inspection:\n\n* Use the list below to add annotations. Interfaces declared with one of these annotations will be ignored by the inspection.\n* Use the checkbox below to ignore interfaces that only declare constant fields. Such interfaces may still be usable even without implementations.\n\nInspection ID: InterfaceNeverImplemented" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InterfaceNeverImplemented", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ContinueStatement", + "shortDescription": { + "text": "'continue' statement" + }, + "fullDescription": { + "text": "Reports 'continue' statements. 'continue' statements complicate refactoring and can be confusing. Example: 'void foo(List strs) {\n for (String str : strs) {\n if (str.contains(\"skip\")) continue;\n handleStr(str);\n }\n }' Inspection ID: ContinueStatement", + "markdown": "Reports `continue` statements.\n\n`continue` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void foo(List strs) {\n for (String str : strs) {\n if (str.contains(\"skip\")) continue;\n handleStr(str);\n }\n }\n\nInspection ID: ContinueStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ContinueStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadDeathRethrown", + "shortDescription": { + "text": "'ThreadDeath' not rethrown" + }, + "fullDescription": { + "text": "Reports 'try' statements that catch 'java.lang.ThreadDeath' and do not rethrow the exception. Example: 'try {\n executeInParallel(request);\n } catch (ThreadDeath ex) { // warning: ThreadDeath 'ex' not rethrown\n return false;\n }' Inspection ID: ThreadDeathRethrown", + "markdown": "Reports `try` statements that catch `java.lang.ThreadDeath` and do not rethrow the exception.\n\n**Example:**\n\n\n try {\n executeInParallel(request);\n } catch (ThreadDeath ex) { // warning: ThreadDeath 'ex' not rethrown\n return false;\n }\n\nInspection ID: ThreadDeathRethrown" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ThreadDeathNotRethrown", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MisorderedAssertEqualsArguments", + "shortDescription": { + "text": "Misordered 'assertEquals()' arguments" + }, + "fullDescription": { + "text": "Reports calls to 'assertEquals()' that have the expected argument and the actual argument in the wrong order. For JUnit 3, 4, and 5 the correct order is '(expected, actual)'. For TestNG the correct order is '(actual, expected)'. Such calls will behave fine for assertions that pass, but may give confusing error reports on failure. Use the quick-fix to flip the order of the arguments. Example (JUnit): 'assertEquals(actual, expected)' After the quick-fix is applied: 'assertEquals(expected, actual)' Inspection ID: MisorderedAssertEqualsArguments", + "markdown": "Reports calls to `assertEquals()` that have the expected argument and the actual argument in the wrong order.\n\n\nFor JUnit 3, 4, and 5 the correct order is `(expected, actual)`.\nFor TestNG the correct order is `(actual, expected)`.\n\n\nSuch calls will behave fine for assertions that pass, but may give confusing error reports on failure.\nUse the quick-fix to flip the order of the arguments.\n\n**Example (JUnit):**\n\n\n assertEquals(actual, expected)\n\nAfter the quick-fix is applied:\n\n\n assertEquals(expected, actual)\n\nInspection ID: MisorderedAssertEqualsArguments" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MisorderedAssertEqualsArguments", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Test frameworks", + "index": 102, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticVariableInitialization", + "shortDescription": { + "text": "Static field may not be initialized" + }, + "fullDescription": { + "text": "Reports 'static' variables that may be uninitialized upon class initialization. Example: 'class Foo {\n public static int bar;\n\n static { }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report 'static' variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore primitive fields option to ignore uninitialized primitive fields. Inspection ID: StaticVariableInitialization", + "markdown": "Reports `static` variables that may be uninitialized upon class initialization.\n\n**Example:**\n\n\n class Foo {\n public static int bar;\n\n static { }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report `static` variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields.\n\nInspection ID: StaticVariableInitialization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticVariableMayNotBeInitialized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantAssertCondition", + "shortDescription": { + "text": "Constant condition in 'assert' statement" + }, + "fullDescription": { + "text": "Reports 'assert' statement conditions that are constants. 'assert' statements with constant conditions will either always fail or always succeed. Such statements might be left over after a refactoring and are probably not intended. Example: 'void foo() {\n assert true;\n }' This inspection depends on the Java feature 'Assertions', which is available since Java 1.4. Inspection ID: ConstantAssertCondition", + "markdown": "Reports `assert` statement conditions that are constants. `assert` statements with constant conditions will either always fail or always succeed. Such statements might be left over after a refactoring and are probably not intended.\n\n**Example:**\n\n\n void foo() {\n assert true;\n }\n\nThis inspection depends on the Java feature 'Assertions', which is available since Java 1.4.\n\nInspection ID: ConstantAssertCondition" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantAssertCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaReflectionInvocation", + "shortDescription": { + "text": "Reflective invocation arguments mismatch" + }, + "fullDescription": { + "text": "Reports cases in which the arguments provided to 'Method.invoke()' and 'Constructor.newInstance()' do not match the signature specified in 'Class.getMethod()' and 'Class.getConstructor()'. Example: 'Method m = myObj.getClass().getMethod(\"myMethod\", int.class);\n // the argument should be an int value\n m.invoke(myObj, \"abc\");' Inspection ID: JavaReflectionInvocation New in 2017.2", + "markdown": "Reports cases in which the arguments provided to `Method.invoke()` and `Constructor.newInstance()` do not match the signature specified in `Class.getMethod()` and `Class.getConstructor()`.\n\nExample:\n\n\n Method m = myObj.getClass().getMethod(\"myMethod\", int.class);\n // the argument should be an **int** value\n m.invoke(myObj, \"abc\");\n\nInspection ID: JavaReflectionInvocation\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "JavaReflectionInvocation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Reflective access", + "index": 104, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CaughtExceptionImmediatelyRethrown", + "shortDescription": { + "text": "Caught exception is immediately rethrown" + }, + "fullDescription": { + "text": "Reports 'catch' blocks that immediately rethrow the caught exception without performing any action on it. Such 'catch' blocks are unnecessary and have no error handling. Example: 'try {\n new FileInputStream(\"\");\n } catch (FileNotFoundException e) {\n throw e;\n }' Inspection ID: CaughtExceptionImmediatelyRethrown", + "markdown": "Reports `catch` blocks that immediately rethrow the caught exception without performing any action on it. Such `catch` blocks are unnecessary and have no error handling.\n\n**Example:**\n\n\n try {\n new FileInputStream(\"\");\n } catch (FileNotFoundException e) {\n throw e;\n }\n\nInspection ID: CaughtExceptionImmediatelyRethrown" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CaughtExceptionImmediatelyRethrown", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryModuleDependencyInspection", + "shortDescription": { + "text": "Unnecessary module dependency" + }, + "fullDescription": { + "text": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies. Inspection ID: UnnecessaryModuleDependencyInspection", + "markdown": "Reports dependencies on modules that are not used. The quick-fix safely removes such unused dependencies.\n\nInspection ID: UnnecessaryModuleDependencyInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryModuleDependencyInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CloneCallsConstructors", + "shortDescription": { + "text": "'clone()' instantiates objects with constructor" + }, + "fullDescription": { + "text": "Reports calls to object constructors inside 'clone()' methods. It is considered good practice to call 'clone()' to instantiate objects inside of a 'clone()' method instead of creating them directly to support later subclassing. This inspection will not report 'clone()' methods declared as 'final' or 'clone()' methods on 'final' classes. Inspection ID: CloneCallsConstructors", + "markdown": "Reports calls to object constructors inside `clone()` methods.\n\nIt is considered good practice to call `clone()` to instantiate objects inside of a `clone()` method\ninstead of creating them directly to support later subclassing.\nThis inspection will not report\n`clone()` methods declared as `final`\nor `clone()` methods on `final` classes.\n\nInspection ID: CloneCallsConstructors" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CloneCallsConstructors", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Cloning issues", + "index": 82, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrayHashCode", + "shortDescription": { + "text": "'hashCode()' called on array" + }, + "fullDescription": { + "text": "Reports incorrect hash code calculation for arrays. In order to correctly calculate the hash code for an array, use: 'Arrays.hashcode()' for linear arrays 'Arrays.deepHashcode()' for multidimensional arrays These methods should also be used with 'Objects.hash()' when the sequence of input values includes arrays, for example: 'Objects.hash(string, Arrays.hashcode(array))' Inspection ID: ArrayHashCode", + "markdown": "Reports incorrect hash code calculation for arrays.\n\nIn order to\ncorrectly calculate the hash code for an array, use:\n\n* `Arrays.hashcode()` for linear arrays\n* `Arrays.deepHashcode()` for multidimensional arrays\n\nThese methods should also be used with `Objects.hash()` when the sequence of input values includes arrays, for example: `Objects.hash(string, Arrays.hashcode(array))`\n\n\nInspection ID: ArrayHashCode" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ArrayHashCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArraysAsListWithZeroOrOneArgument", + "shortDescription": { + "text": "Call to 'Arrays.asList()' with too few arguments" + }, + "fullDescription": { + "text": "Reports calls to 'Arrays.asList()' with at most one argument. Such calls could be replaced with 'Collections.singletonList()', 'Collections.emptyList()', or 'List.of()' on JDK 9 and later, which will save some memory. In particular, 'Collections.emptyList()' and 'List.of()' with no arguments always return a shared instance, while 'Arrays.asList()' with no arguments creates a new object every time it's called. Note: the lists returned by 'Collections.singletonList()' and 'List.of()' are immutable, while the list returned 'Arrays.asList()' allows calling the 'set()' method. This may break the code in rare cases. Example: 'List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");' After the quick-fix is applied: 'List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");' Inspection ID: ArraysAsListWithZeroOrOneArgument", + "markdown": "Reports calls to `Arrays.asList()` with at most one argument.\n\n\nSuch calls could be replaced\nwith `Collections.singletonList()`, `Collections.emptyList()`,\nor `List.of()` on JDK 9 and later, which will save some memory.\n\nIn particular, `Collections.emptyList()` and `List.of()` with no arguments\nalways return a shared instance,\nwhile `Arrays.asList()` with no arguments creates a new object every time it's called.\n\nNote: the lists returned by `Collections.singletonList()` and `List.of()` are immutable,\nwhile the list returned `Arrays.asList()` allows calling the `set()` method.\nThis may break the code in rare cases.\n\n**Example:**\n\n\n List empty = Arrays.asList();\n List one = Arrays.asList(\"one\");\n\nAfter the quick-fix is applied:\n\n\n List empty = Collections.emptyList();\n List one = Collections.singletonList(\"one\");\n\n\nInspection ID: ArraysAsListWithZeroOrOneArgument" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ArraysAsListWithZeroOrOneArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WaitNotInLoop", + "shortDescription": { + "text": "'wait()' not called in loop" + }, + "fullDescription": { + "text": "Reports calls to 'wait()' that are not made inside a loop. 'wait()' is normally used to suspend a thread until some condition becomes true. As the thread could have been waken up for a different reason, the condition should be checked after the 'wait()' call returns. A loop is a simple way to achieve this. Example: 'class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n if (count >= 10) wait();\n ++count;\n }\n }' Good code should look like this: 'class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n while (count >= 10) wait();\n ++count;\n }\n }' Inspection ID: WaitNotInLoop", + "markdown": "Reports calls to `wait()` that are not made inside a loop.\n\n\n`wait()` is normally used to suspend a thread until some condition becomes true.\nAs the thread could have been waken up for a different reason,\nthe condition should be checked after the `wait()` call returns.\nA loop is a simple way to achieve this.\n\n**Example:**\n\n\n class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n if (count >= 10) wait();\n ++count;\n }\n }\n\nGood code should look like this:\n\n\n class BoundedCounter {\n private int count;\n synchronized void inc() throws InterruptedException {\n while (count >= 10) wait();\n ++count;\n }\n }\n\nInspection ID: WaitNotInLoop" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WaitNotInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExternalizableWithSerializationMethods", + "shortDescription": { + "text": "Externalizable class with 'readObject()' or 'writeObject()'" + }, + "fullDescription": { + "text": "Reports 'Externalizable' classes that define 'readObject()' or 'writeObject()' methods. These methods are not called for serialization of 'Externalizable' objects. Example: 'abstract class Crucial implements Externalizable {\n int value;\n private void readObject(ObjectInputStream in) {\n value = in.readInt();\n }\n }' Inspection ID: ExternalizableWithSerializationMethods", + "markdown": "Reports `Externalizable` classes that define `readObject()` or `writeObject()` methods. These methods are not called for serialization of `Externalizable` objects.\n\n**Example:**\n\n\n abstract class Crucial implements Externalizable {\n int value;\n private void readObject(ObjectInputStream in) {\n value = in.readInt();\n }\n }\n\nInspection ID: ExternalizableWithSerializationMethods" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExternalizableClassWithSerializationMethods", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnstableApiUsage", + "shortDescription": { + "text": "Unstable API Usage" + }, + "fullDescription": { + "text": "Reports usages of an API marked with one of the annotations as unstable. Such an API may be changed or removed in future versions, breaking the code that uses it. The annotations which are used to mark unstable APIs are shown in the list below. By default, the inspection ignores usages of unstable APIs if their declarations are located in sources of the same project. In such cases it'll be possible to update the usages when you change APIs. However, it may be inconvenient if the project is big, so one can switch off the Ignore API declared in this project option to report the usages of unstable APIs declared in both the project sources and libraries. Inspection ID: UnstableApiUsage", + "markdown": "Reports usages of an API marked with one of the annotations as unstable. Such an API may be changed or removed in future versions, breaking the code that uses it.\n\nThe annotations which are used to mark unstable APIs are shown in the list below.\n\nBy default, the inspection ignores usages of unstable APIs\nif their declarations are located in sources of the same project. In such cases it'll be possible to update the usages when you change APIs.\nHowever, it may be inconvenient if the project is big, so one can switch off the **Ignore API declared in this project** option to report\nthe usages of unstable APIs declared in both the project sources and libraries.\n\nInspection ID: UnstableApiUsage" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnstableApiUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SafeLock", + "shortDescription": { + "text": "Lock acquired but not safely unlocked" + }, + "fullDescription": { + "text": "Reports 'java.util.concurrent.locks.Lock' resources that are not acquired in front of a 'try' block or not unlocked in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. Example: 'lock.lock(); // will be reported since the 'finally' block is missing\n try {\n doSmthWithLock();\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n lock.unlock();' Inspection ID: SafeLock", + "markdown": "Reports `java.util.concurrent.locks.Lock` resources that are not acquired in front of a `try` block or not unlocked in the corresponding `finally` block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n**Example:**\n\n\n lock.lock(); // will be reported since the 'finally' block is missing\n try {\n doSmthWithLock();\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\n lock.unlock();\n\nInspection ID: SafeLock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LockAcquiredButNotSafelyReleased", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LambdaUnfriendlyMethodOverload", + "shortDescription": { + "text": "Lambda-unfriendly method overload" + }, + "fullDescription": { + "text": "Reports overloaded methods that take functional interfaces with conflicting abstract method signatures. Such overloads introduce ambiguity and require callers to cast lambdas to a specific type or specify lambda parameter types explicitly. It is preferable to give the overloaded methods different names to eliminate ambiguity. Example: 'interface MyExecutor {\n void execute(Supplier supplier);\n void execute(Callable callable);\n }' Here, 'Supplier' and 'Callable' are functional interfaces whose single abstract methods do not take any parameters and return a non-void value. As a result, the type of the lambda cannot be inferred at the call site unless an explicit cast is used. Inspection ID: LambdaUnfriendlyMethodOverload", + "markdown": "Reports overloaded methods that take functional interfaces with conflicting abstract method signatures.\n\nSuch overloads introduce ambiguity and require callers to cast lambdas to a specific type or specify lambda parameter types explicitly.\nIt is preferable to give the overloaded methods different names to eliminate ambiguity.\n\nExample:\n\n\n interface MyExecutor {\n void execute(Supplier supplier);\n void execute(Callable callable);\n }\n\n\nHere, `Supplier` and `Callable` are functional interfaces\nwhose single abstract methods do not take any parameters and return a non-void value.\nAs a result, the type of the lambda cannot be inferred at the call site unless an explicit cast is used.\n\nInspection ID: LambdaUnfriendlyMethodOverload" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LambdaUnfriendlyMethodOverload", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Method", + "index": 91, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaLangInvokeHandleSignature", + "shortDescription": { + "text": "MethodHandle/VarHandle type mismatch" + }, + "fullDescription": { + "text": "Reports 'MethodHandle' and 'VarHandle' factory method calls that don't match any method or field. Also reports arguments to 'MethodHandle.invoke()' and similar methods, that don't match the 'MethodHandle' signature and arguments to 'VarHandle.set()' that don't match the 'VarHandle' type. Examples: MethodHandle mh = MethodHandles.lookup().findVirtual(\n MyClass.class, \"foo\", MethodType.methodType(void.class, int.class));\n // the argument should be an int value\n mh.invoke(myObj, \"abc\");\n // the argument should be String.class\n VarHandle vh = MethodHandles.lookup().findVarHandle(\n MyClass.class, \"text\", int.class);\n VarHandle vh = MethodHandles.lookup().findVarHandle(\n MyClass.class, \"text\", String.class);\n // the argument should be a String value\n vh.set(myObj, 42);\n New in 2017.2 Inspection ID: JavaLangInvokeHandleSignature", + "markdown": "Reports `MethodHandle` and `VarHandle` factory method calls that don't match any method or field.\n\nAlso reports arguments to `MethodHandle.invoke()` and similar methods, that don't match the `MethodHandle` signature\nand arguments to `VarHandle.set()` that don't match the `VarHandle` type.\n\n\nExamples:\n\n```\n MethodHandle mh = MethodHandles.lookup().findVirtual(\n MyClass.class, \"foo\", MethodType.methodType(void.class, int.class));\n // the argument should be an int value\n mh.invoke(myObj, \"abc\");\n```\n\n```\n // the argument should be String.class\n VarHandle vh = MethodHandles.lookup().findVarHandle(\n MyClass.class, \"text\", int.class);\n```\n\n```\n VarHandle vh = MethodHandles.lookup().findVarHandle(\n MyClass.class, \"text\", String.class);\n // the argument should be a String value\n vh.set(myObj, 42);\n```\n\n\nNew in 2017.2\n\nInspection ID: JavaLangInvokeHandleSignature" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "JavaLangInvokeHandleSignature", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Reflective access", + "index": 104, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReturnThis", + "shortDescription": { + "text": "Return of 'this'" + }, + "fullDescription": { + "text": "Reports methods returning 'this'. While such a return is valid, it is rarely necessary, and usually indicates that the method is intended to be used as part of a chain of similar method calls (for example, 'buffer.append(\"foo\").append(\"bar\").append(\"baz\")'). Such chains are frowned upon by many coding standards. Example: 'public Builder append(String str) {\n // [...]\n return this;\n }' Inspection ID: ReturnThis", + "markdown": "Reports methods returning `this`.\n\n\nWhile such a return is valid, it is rarely necessary, and usually indicates that the method is intended to be used\nas part of a chain of similar method calls (for example, `buffer.append(\"foo\").append(\"bar\").append(\"baz\")`).\nSuch chains are frowned upon by many coding standards.\n\n**Example:**\n\n\n public Builder append(String str) {\n // [...]\n return this;\n }\n\nInspection ID: ReturnThis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReturnOfThis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanBeFinal", + "shortDescription": { + "text": "Declaration can have 'final' modifier" + }, + "fullDescription": { + "text": "Reports fields, methods, or classes that may have the 'final' modifier added to their declarations. Final classes can't be extended, final methods can't be overridden, and final fields can't be reassigned. Example: 'public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }' After the quick-fix is applied: 'public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }' Use the Report classes and Report methods options to define which declarations are to be reported. Inspection ID: CanBeFinal", + "markdown": "Reports fields, methods, or classes that may have the `final` modifier added to their declarations.\n\nFinal classes can't be extended, final methods can't be overridden, and final fields can't be reassigned.\n\n**Example:**\n\n\n public class Person {\n private String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public final class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public final String getName() {\n return name;\n }\n\n public final String toString() {\n return getName();\n }\n }\n\nUse the **Report classes** and **Report methods** options to define which declarations are to be reported.\n\nInspection ID: CanBeFinal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CanBeFinal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryLabelOnBreakStatement", + "shortDescription": { + "text": "Unnecessary label on 'break' statement" + }, + "fullDescription": { + "text": "Reports 'break' statements with unnecessary labels. Such labels do not change the control flow but make the code difficult to follow. Example: 'label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break label;\n //doSmth\n }' After the quick-fix is applied: 'label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break;\n //doSmth\n }' Inspection ID: UnnecessaryLabelOnBreakStatement", + "markdown": "Reports `break` statements with unnecessary labels. Such labels do not change the control flow but make the code difficult to follow.\n\n**Example:**\n\n\n label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break label;\n //doSmth\n }\n\nAfter the quick-fix is applied:\n\n\n label:\n for(int i = 0; i < 10; i++) {\n if (shouldBreak()) break;\n //doSmth\n }\n\nInspection ID: UnnecessaryLabelOnBreakStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryLabelOnBreakStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerializableRecordContainsIgnoredMembers", + "shortDescription": { + "text": "'record' contains ignored members" + }, + "fullDescription": { + "text": "Reports serialization methods or fields defined in a 'record' class. Serialization methods include 'writeObject()', 'readObject()', 'readObjectNoData()', 'writeExternal()', and 'readExternal()' and the field 'serialPersistentFields'. These members are not used for the serialization or deserialization of records and therefore unnecessary. Examples: 'record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }' 'record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }' This inspection depends on the Java feature 'Records', which is available since Java 16. Inspection ID: SerializableRecordContainsIgnoredMembers New in 2020.3", + "markdown": "Reports serialization methods or fields defined in a `record` class. Serialization methods include `writeObject()`, `readObject()`, `readObjectNoData()`, `writeExternal()`, and `readExternal()` and the field `serialPersistentFields`. These members are not used for the serialization or deserialization of records and therefore unnecessary.\n\n**Examples:**\n\n\n record R1() implements Serializable {\n // The field is ignored during record serialization\n @Serial\n private static final ObjectStreamField[] serialPersistentFields = new ObjectStreamField[0];\n\n // The method is ignored during record serialization\n @Serial\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\n\n record R2() implements Externalizable {\n // The method is ignored during record serialization\n @Override\n public void writeExternal(ObjectOutput out) throws IOException {\n }\n\n // The method is ignored during record serialization\n @Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n }\n }\n\nThis inspection depends on the Java feature 'Records', which is available since Java 16.\n\nInspection ID: SerializableRecordContainsIgnoredMembers\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SerializableRecordContainsIgnoredMembers", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NakedNotify", + "shortDescription": { + "text": "'notify()' or 'notifyAll()' without corresponding state change" + }, + "fullDescription": { + "text": "Reports 'Object.notify()' or 'Object.notifyAll()' being called without any detectable state change occurring. Normally, 'Object.notify()' and 'Object.notifyAll()' are used to inform other threads that a state change has occurred. That state change should occur in a synchronized context that contains the 'Object.notify()' or 'Object.notifyAll()' call, and prior to the call. While not having such a state change isn't necessarily incorrect, it is certainly worth examining. Example: 'synchronized (this) {\n notify();\n }\n // no state change\n synchronized (this) {\n notify(); // this notify might be redundant\n }' Inspection ID: NakedNotify", + "markdown": "Reports `Object.notify()` or `Object.notifyAll()` being called without any detectable state change occurring.\n\n\nNormally, `Object.notify()` and `Object.notifyAll()` are used to inform other threads that a state change has\noccurred. That state change should occur in a synchronized context that contains the `Object.notify()` or\n`Object.notifyAll()` call, and prior to the call. While not having such a state change isn't necessarily incorrect, it is\ncertainly worth examining.\n\n**Example:**\n\n\n synchronized (this) {\n notify();\n }\n // no state change\n synchronized (this) {\n notify(); // this notify might be redundant\n }\n\nInspection ID: NakedNotify" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NakedNotify", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassCoupling", + "shortDescription": { + "text": "Overly coupled class" + }, + "fullDescription": { + "text": "Reports classes that reference too many other classes. Classes with too high coupling can be very fragile, and should probably be split into smaller classes. Configure the inspection: Use the Class coupling limit field to specify the maximum allowed coupling for a class. Use the Include couplings to java system classes option to specify whether references to system classes (those in the 'java.'or 'javax.' packages) should be counted. Use the Include couplings to library classes option to specify whether references to any library classes should be counted. Inspection ID: ClassCoupling", + "markdown": "Reports classes that reference too many other classes.\n\nClasses with too high coupling can be very fragile, and should probably be split into smaller classes.\n\nConfigure the inspection:\n\n* Use the **Class coupling limit** field to specify the maximum allowed coupling for a class.\n* Use the **Include couplings to java system classes** option to specify whether references to system classes (those in the `java.`or `javax.` packages) should be counted.\n* Use the **Include couplings to library classes** option to specify whether references to any library classes should be counted.\n\nInspection ID: ClassCoupling" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyCoupledClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class metrics", + "index": 90, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessarilyQualifiedInnerClassAccess", + "shortDescription": { + "text": "Unnecessarily qualified inner class access" + }, + "fullDescription": { + "text": "Reports any references to inner classes that are unnecessarily qualified with the name of the enclosing class. Such a qualification can be safely removed, which sometimes adds an import for the inner class. Example: 'class X {\n X.Y foo;\n class Y{}\n }' After the quick-fix is applied: 'class X {\n Y foo;\n class Y{}\n }' Use the Ignore references for which an import is needed option to ignore references to inner classes, where removing the qualification adds an import. Inspection ID: UnnecessarilyQualifiedInnerClassAccess", + "markdown": "Reports any references to inner classes that are unnecessarily qualified with the name of the enclosing class.\n\nSuch a qualification can be safely removed, which sometimes adds an import for the inner class.\n\nExample:\n\n\n class X {\n X.Y foo;\n class Y{}\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n Y foo;\n class Y{}\n }\n\nUse the **Ignore references for which an import is needed** option to ignore references to inner classes, where\nremoving the qualification adds an import.\n\n\nInspection ID: UnnecessarilyQualifiedInnerClassAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UnnecessarilyQualifiedInnerClassAccess", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptySynchronizedStatement", + "shortDescription": { + "text": "Empty 'synchronized' statement" + }, + "fullDescription": { + "text": "Reports 'synchronized' statements with empty bodies. Empty 'synchronized' statements are sometimes used to wait for other threads to release a particular resource. However, there is no guarantee that the same resource won't be acquired again right after the empty 'synchronized' statement finishes. For proper synchronization, the resource should be utilized inside the 'synchronized' block. Also, an empty 'synchronized' block may appear after a refactoring when redundant code was removed. In this case, the 'synchronized' block itself will be redundant and should be removed as well. Example: 'synchronized(lock) {}' A quick-fix is suggested to remove the empty synchronized statement. This inspection is disabled in JSP files. Inspection ID: EmptySynchronizedStatement", + "markdown": "Reports `synchronized` statements with empty bodies.\n\n\nEmpty `synchronized` statements are sometimes used to wait for other threads to\nrelease a particular resource. However, there is no guarantee that the same resource\nwon't be acquired again right after the empty `synchronized` statement finishes.\nFor proper synchronization, the resource should be utilized inside the `synchronized` block.\n\n\nAlso, an empty `synchronized` block may appear after a refactoring\nwhen redundant code was removed. In this case, the `synchronized` block\nitself will be redundant and should be removed as well.\n\nExample:\n\n\n synchronized(lock) {}\n\n\nA quick-fix is suggested to remove the empty synchronized statement.\n\n\nThis inspection is disabled in JSP files.\n\n\nInspection ID: EmptySynchronizedStatement" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EmptySynchronizedStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TextBlockMigration", + "shortDescription": { + "text": "Text block can be used" + }, + "fullDescription": { + "text": "Reports 'String' concatenations that can be simplified by replacing them with text blocks. Requirements: '\\n' occurs two or more times. Text blocks are not concatenated. Use the Report single string literals option to highlight single literals containing line breaks. The quick-fix will still be available even when this option is disabled. Example: 'String html = \"\\n\" +\n \" \\n\" +\n \"

Hello, world

\\n\" +\n \" \\n\" +\n \"\\n\";' After the quick-fix is applied: 'String html = \"\"\"\n \n \n

Hello, world

\n \n \n \"\"\";' This inspection depends on the Java feature 'Text block literals', which is available since Java 15. Inspection ID: TextBlockMigration New in 2019.3", + "markdown": "Reports `String` concatenations that can be simplified by replacing them with text blocks.\n\nRequirements:\n\n* `\\n` occurs two or more times.\n* Text blocks are not concatenated.\n\n\nUse the **Report single string literals** option to highlight single literals containing line breaks.\nThe quick-fix will still be available even when this option is disabled.\n\n\n**Example:**\n\n\n String html = \"\\n\" +\n \" \\n\" +\n \"

Hello, world

\\n\" +\n \" \\n\" +\n \"\\n\";\n\nAfter the quick-fix is applied:\n\n\n String html = \"\"\"\n \n \n

Hello, world

\n \n \n \"\"\";\n\nThis inspection depends on the Java feature 'Text block literals', which is available since Java 15.\n\nInspection ID: TextBlockMigration\n\nNew in 2019.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TextBlockMigration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 15", + "index": 105, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectAllocationInLoop", + "shortDescription": { + "text": "Object allocation in loop" + }, + "fullDescription": { + "text": "Reports object or array allocations inside loops. While not necessarily a problem, an object allocation inside a loop is a great place to look for memory leaks and performance issues. The inspection reports the following constructs: Explicit allocations via 'new' operator Methods known to return new object Instance-bound method references Lambdas that capture variables or 'this' reference Example: '// Explicit allocation\n for (Status status : Status.values()) {\n declarationsMap.put(status, new ArrayList<>());\n }\n\n // Lambda captures variable\n String message = \"Engine running.\";\n for (Engine engine : engines) {\n if (!isRunning(engine)) {\n logger.warn(() -> {\n return String.format(message);\n });\n }\n }\n\n // Instance-bound method reference\n for(Node node : nodes) {\n descriptor = node.getDescription();\n descriptor.ifPresent(dynamicTestExecutor::execute);\n }'\n Inspection ID: ObjectAllocationInLoop", + "markdown": "Reports object or array allocations inside loops. While not necessarily a problem, an object allocation inside a loop is a great place to look for memory leaks and performance issues.\n\n\nThe inspection reports the following constructs:\n\n* Explicit allocations via `new` operator\n* Methods known to return new object\n* Instance-bound method references\n* Lambdas that capture variables or `this` reference\n\n**Example:**\n\n\n // Explicit allocation\n for (Status status : Status.values()) {\n declarationsMap.put(status, new ArrayList<>());\n }\n\n // Lambda captures variable\n String message = \"Engine running.\";\n for (Engine engine : engines) {\n if (!isRunning(engine)) {\n logger.warn(() -> {\n return String.format(message);\n });\n }\n }\n\n // Instance-bound method reference\n for(Node node : nodes) {\n descriptor = node.getDescription();\n descriptor.ifPresent(dynamicTestExecutor::execute);\n }\n\nInspection ID: ObjectAllocationInLoop" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ObjectAllocationInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavadocLinkAsPlainText", + "shortDescription": { + "text": "Link specified as plain text" + }, + "fullDescription": { + "text": "Reports plain text links in Javadoc comments. The quick-fix suggests to wrap the link in an '' tag. Example: 'class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }' After the quick-fix is applied: 'class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }' Inspection ID: JavadocLinkAsPlainText New in 2022.1", + "markdown": "Reports plain text links in Javadoc comments.\n\n\nThe quick-fix suggests to wrap the link in an `` tag.\n\n**Example:**\n\n\n class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n /**\n * https://en.wikipedia.org/\n */\n void foo() {}\n }\n\nInspection ID: JavadocLinkAsPlainText\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JavadocLinkAsPlainText", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonFinalClone", + "shortDescription": { + "text": "Non-final 'clone()' in secure context" + }, + "fullDescription": { + "text": "Reports 'clone()' methods without the 'final' modifier. Since 'clone()' can be used to instantiate objects without using a constructor, allowing the 'clone()' method to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the 'clone()' method or the enclosing class itself 'final'. Example: 'class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }' Inspection ID: NonFinalClone", + "markdown": "Reports `clone()` methods without the `final` modifier.\n\n\nSince `clone()` can be used to instantiate objects without using a constructor, allowing the `clone()`\nmethod to be overridden may result in corrupted objects, and even in security exploits. This may be prevented by making the\n`clone()` method or the enclosing class itself `final`.\n\n**Example:**\n\n\n class Main implements Cloneable {\n @Override\n protected Object clone() throws CloneNotSupportedException {\n return super.clone();\n }\n }\n\nInspection ID: NonFinalClone" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonFinalClone", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SharedThreadLocalRandom", + "shortDescription": { + "text": "'ThreadLocalRandom' instance might be shared" + }, + "fullDescription": { + "text": "Reports 'java.util.concurrent.ThreadLocalRandom' instances which might be shared between threads. A 'ThreadLocalRandom' should not be shared between threads because that is not thread-safe. The inspection reports instances that are assigned to a field used as a method argument, or assigned to a local variable and used in anonymous or nested classes as they might get shared between threads. Usages of 'ThreadLocalRandom' should typically look like 'ThreadLocalRandom.current().nextInt(...)' (or 'nextDouble(...)' etc.). When all usages are in this form, 'ThreadLocalRandom' instances cannot be used accidentally by multiple threads. Example: 'class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }' Use the options to list methods that are safe to be passed to 'ThreadLocalRandom' instances as an argument. It's possible to use regular expressions for method names. Inspection ID: SharedThreadLocalRandom", + "markdown": "Reports `java.util.concurrent.ThreadLocalRandom` instances which might be shared between threads.\n\n\nA `ThreadLocalRandom` should not be shared between threads because that is not thread-safe.\nThe inspection reports instances that are assigned to a field used as a method argument,\nor assigned to a local variable and used in anonymous or nested classes as they might get shared between threads.\n\n\nUsages of `ThreadLocalRandom` should typically look like `ThreadLocalRandom.current().nextInt(...)`\n(or `nextDouble(...)` etc.).\nWhen all usages are in this form, `ThreadLocalRandom` instances cannot be used accidentally by multiple threads.\n\n**Example:**\n\n\n class Main {\n void printRandomNumbersAsync() {\n ThreadLocalRandom random = ThreadLocalRandom.current();\n CompletableFuture.supplyAsync(() -> generateNumbers(random))\n .thenAccept(numbers -> System.out.println(Arrays.toString(numbers)));\n }\n\n private int[] generateNumbers(Random random) {\n return random.ints(1000, 0, 100).toArray();\n }\n }\n \n\nUse the options to list methods that are safe to be passed to `ThreadLocalRandom` instances as an argument.\nIt's possible to use regular expressions for method names.\n\nInspection ID: SharedThreadLocalRandom" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SharedThreadLocalRandom", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WhileCanBeDoWhile", + "shortDescription": { + "text": "'while' can be replaced with 'do while'" + }, + "fullDescription": { + "text": "Reports 'while' loops that could be more effectively written as 'do-while' loops. There are 'while' loops where the code just before the loop is identical to the code in the body of the loop. Replacing with a 'do-while' loop removes the duplicated code. For 'while' loops without such duplicated code, the quick fix is offered in the editor as well, but without highlighting. Example: 'foo();\n while (x) {\n foo();\n }' Can be replaced with: 'do {\n foo();\n } while (x);' New in 2024.1 Inspection ID: WhileCanBeDoWhile", + "markdown": "Reports `while` loops that could be more effectively written as `do-while` loops.\nThere are `while` loops where the code just before the loop is identical to the code in the body of the loop.\nReplacing with a `do-while` loop removes the duplicated code.\nFor `while` loops without such duplicated code, the quick fix is offered in the editor as well, but without highlighting.\n\n**Example:**\n\n\n foo();\n while (x) {\n foo();\n }\n\nCan be replaced with:\n\n\n do {\n foo();\n } while (x);\n\n\nNew in 2024.1\n\nInspection ID: WhileCanBeDoWhile" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "WhileCanBeDoWhile", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ChainedEquality", + "shortDescription": { + "text": "Chained equality comparisons" + }, + "fullDescription": { + "text": "Reports chained equality comparisons. Such comparisons may be confusing: 'a == b == c' means '(a == b) == c', but possibly 'a == b && a == c' is intended. Example: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }' You can use parentheses to make the comparison less confusing: 'boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }' Inspection ID: ChainedEquality", + "markdown": "Reports chained equality comparisons.\n\nSuch comparisons may be confusing: `a == b == c` means `(a == b) == c`,\nbut possibly `a == b && a == c` is intended.\n\n**Example:**\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return a == b == c;\n }\n\nYou can use parentheses to make the comparison less confusing:\n\n\n boolean chainedEquality(boolean a, boolean b, boolean c) {\n return (a == b) == c;\n }\n\nInspection ID: ChainedEquality" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ChainedEqualityComparisons", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AbstractMethodOverridesConcreteMethod", + "shortDescription": { + "text": "Abstract method overrides concrete method" + }, + "fullDescription": { + "text": "Reports 'abstract' methods that override concrete super methods. Methods overridden from 'java.lang.Object' are not reported by this inspection. Inspection ID: AbstractMethodOverridesConcreteMethod", + "markdown": "Reports `abstract` methods that override concrete super methods.\n\nMethods overridden from `java.lang.Object` are not reported by this inspection.\n\nInspection ID: AbstractMethodOverridesConcreteMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AbstractMethodOverridesConcreteMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LossyConversionCompoundAssignment", + "shortDescription": { + "text": "Possibly lossy implicit cast in compound assignment" + }, + "fullDescription": { + "text": "Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable. During such compound assignments, an implicit cast occurs, potentially resulting in lossy conversions. Example: 'long c = 1;\n c += 1.2;' After the quick-fix is applied: 'long c = 1;\n c += (long) 1.2;' Inspection ID: LossyConversionCompoundAssignment New in 2023.2", + "markdown": "Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable.\n\n\nDuring such compound assignments, an implicit cast occurs, potentially resulting in lossy conversions.\n\nExample:\n\n\n long c = 1;\n c += 1.2;\n\nAfter the quick-fix is applied:\n\n\n long c = 1;\n c += (long) 1.2;\n\nInspection ID: LossyConversionCompoundAssignment\n\nNew in 2023.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "lossy-conversions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThrowFromFinallyBlock", + "shortDescription": { + "text": "'throw' inside 'finally' block" + }, + "fullDescription": { + "text": "Reports 'throw' statements inside 'finally' blocks. While occasionally intended, such 'throw' statements can hide exceptions thrown from the 'try' and 'catch' blocks, thereby complicating the debugging process. Example: 'class Fascinating {\n void doTask(Task t) {\n try {\n t.activity();\n } finally {\n if (!t.finish()) {\n throw new IllegalStateException();\n }\n }\n }\n }' Use the Warn everywhere declared exceptions may be thrown option to warn on method calls to methods that declare exceptions as well. Inspection ID: ThrowFromFinallyBlock", + "markdown": "Reports `throw` statements inside `finally` blocks. While occasionally intended, such `throw` statements can hide exceptions thrown from the `try` and `catch` blocks, thereby complicating the debugging process.\n\n**Example:**\n\n\n class Fascinating {\n void doTask(Task t) {\n try {\n t.activity();\n } finally {\n if (!t.finish()) {\n throw new IllegalStateException();\n }\n }\n }\n }\n\nUse the **Warn everywhere declared exceptions may be thrown** option\nto warn on method calls to methods that declare exceptions as well.\n\nInspection ID: ThrowFromFinallyBlock" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ThrowFromFinallyBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticNonFinalField", + "shortDescription": { + "text": "'static', non-'final' field" + }, + "fullDescription": { + "text": "Reports non-'final' 'static' fields. A quick-fix is available to add the 'final' modifier to a non-'final' 'static' field. This inspection doesn't check fields' mutability. For example, adding the 'final' modifier to a field that has a value being set somewhere will cause a compilation error. Use the Only report 'public' fields option so that the inspection reported only 'public' fields. Inspection ID: StaticNonFinalField", + "markdown": "Reports non-`final` `static` fields.\n\nA quick-fix is available to add the `final` modifier to a non-`final` `static` field.\n\nThis inspection doesn't check fields' mutability. For example, adding the `final` modifier to a field that has a value\nbeing set somewhere will cause a compilation error.\n\n\nUse the **Only report 'public' fields** option so that the inspection reported only `public` fields.\n\nInspection ID: StaticNonFinalField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticNonFinalField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CodeBlock2Expr", + "shortDescription": { + "text": "Statement lambda can be replaced with expression lambda" + }, + "fullDescription": { + "text": "Reports lambda expressions with code block bodies when expression-style bodies can be used instead. The result of the conversion is shorter and more clear. Example: 'Comparable c = o -> {return 0;};' After the quick-fix is applied: 'Comparable c = o -> 0;' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: CodeBlock2Expr", + "markdown": "Reports lambda expressions with code block bodies when expression-style bodies can be used instead. The result of the conversion is shorter and more clear.\n\nExample:\n\n\n Comparable c = o -> {return 0;};\n\nAfter the quick-fix is applied:\n\n\n Comparable c = o -> 0;\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: CodeBlock2Expr" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CodeBlock2Expr", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyForEach", + "shortDescription": { + "text": "Simplifiable forEach() call" + }, + "fullDescription": { + "text": "Reports 'forEach()' calls that can be replaced with a more concise method or from which intermediate steps can be extracted. Example: 'List findNStrings(List list, int n) {\n List other = new ArrayList<>();\n list.forEach(s -> {\n if(s.length() > n) other.add(s);\n });\n return other;\n }' After the quick-fix is applied: 'List findNStrings(List list, int n) {\n List other = list.stream()\n .filter(s -> s.length() > n)\n .collect(Collectors.toList());\n return other;\n }' This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: SimplifyForEach New in 2017.3", + "markdown": "Reports `forEach()` calls that can be replaced with a more concise method or from which intermediate steps can be extracted.\n\n**Example:**\n\n\n List findNStrings(List list, int n) {\n List other = new ArrayList<>();\n list.forEach(s -> {\n if(s.length() > n) other.add(s);\n });\n return other;\n }\n\nAfter the quick-fix is applied:\n\n\n List findNStrings(List list, int n) {\n List other = list.stream()\n .filter(s -> s.length() > n)\n .collect(Collectors.toList());\n return other;\n }\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: SimplifyForEach\n\nNew in 2017.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifyForEach", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantFieldInitialization", + "shortDescription": { + "text": "Redundant field initialization" + }, + "fullDescription": { + "text": "Reports fields explicitly initialized to their default values. Example: 'class Foo {\n int foo = 0;\n List bar = null;\n }' After the quick-fix is applied: 'class Foo {\n int foo;\n List bar;\n }' Use the inspection settings to only report explicit 'null' initialization, for example: 'class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }' Inspection ID: RedundantFieldInitialization", + "markdown": "Reports fields explicitly initialized to their default values.\n\n**Example:**\n\n\n class Foo {\n int foo = 0;\n List bar = null;\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int foo;\n List bar;\n }\n\n\nUse the inspection settings to only report explicit `null` initialization, for example:\n\n\n class Foo {\n int foo = 0; // no warning\n List bar = null; // redundant field initialization warning\n }\n\nInspection ID: RedundantFieldInitialization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantFieldInitialization", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Since15", + "shortDescription": { + "text": "Usages of API which isn't available at the configured language level" + }, + "fullDescription": { + "text": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things: Highlight usage of generified classes when the language level is below Java 7. Highlight when default methods are not overridden and the language level is below Java 8. Highlight usage of API when the language level is lower than marked using the '@since' tag in the documentation. Use the Forbid API usages option to forbid usages of the API in respect to the project or custom language level. Inspection ID: Since15", + "markdown": "Reports usages of the API that is unavailable at the configured language level. This inspection does 3 things:\n\n* Highlight usage of generified classes when the language level is below Java 7.\n* Highlight when default methods are not overridden and the language level is below Java 8.\n* Highlight usage of API when the language level is lower than marked using the `@since` tag in the documentation.\n\n\nUse the **Forbid API usages** option to forbid usages of the API in respect to the project or custom language level.\n\nInspection ID: Since15" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "Since15", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyMethod", + "shortDescription": { + "text": "Empty method" + }, + "fullDescription": { + "text": "Reports empty methods that can be removed. Methods are considered empty if they are empty themselves and if they are overridden or implemented by empty methods only. Note that methods containing only comments and the 'super()' call with own parameters are also considered empty. The inspection ignores methods with special annotations, for example, the 'javax.ejb.Init' and 'javax.ejb.Remove' EJB annotations . The quick-fix safely removes unnecessary methods. Configure the inspection: Use the Comments and javadoc count as content option to select whether methods with comments should be treated as non-empty. Use the Additional special annotations option to configure additional annotations that should be ignored by this inspection. Inspection ID: EmptyMethod", + "markdown": "Reports empty methods that can be removed.\n\nMethods are considered empty if they are empty themselves and if they are overridden or\nimplemented by empty methods only. Note that methods containing only comments and the `super()` call with own parameters are\nalso considered empty.\n\nThe inspection ignores methods with special annotations, for example, the `javax.ejb.Init` and `javax.ejb.Remove` EJB annotations .\n\nThe quick-fix safely removes unnecessary methods.\n\nConfigure the inspection:\n\n* Use the **Comments and javadoc count as content** option to select whether methods with comments should be treated as non-empty.\n* Use the **Additional special annotations** option to configure additional annotations that should be ignored by this inspection.\n\nInspection ID: EmptyMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifiableEqualsExpression", + "shortDescription": { + "text": "Unnecessary 'null' check before 'equals()' call" + }, + "fullDescription": { + "text": "Reports comparisons to 'null' that are followed by a call to 'equals()' with a constant argument. Example: 'if (s != null && s.equals(\"literal\")) {}' After the quick-fix is applied: 'if (\"literal\".equals(s)) {}' Use the inspection settings to report 'equals()' calls with a non-constant argument when the argument to 'equals()' is proven not to be 'null'. Inspection ID: SimplifiableEqualsExpression", + "markdown": "Reports comparisons to `null` that are followed by a call to `equals()` with a constant argument.\n\n**Example:**\n\n\n if (s != null && s.equals(\"literal\")) {}\n\nAfter the quick-fix is applied:\n\n\n if (\"literal\".equals(s)) {}\n\n\nUse the inspection settings to report `equals()` calls with a non-constant argument\nwhen the argument to `equals()` is proven not to be `null`.\n\nInspection ID: SimplifiableEqualsExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SimplifiableEqualsExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonCommentSourceStatements", + "shortDescription": { + "text": "Overly long method" + }, + "fullDescription": { + "text": "Reports methods whose number of statements exceeds the specified maximum. Methods with too many statements may be confusing and are a good sign that refactoring is necessary. The following statements are not counted: empty statements (semicolons) block statements 'for' loop initialization statements, that is, 'int i = ...' within a 'for(int i = ...;...)' statement 'for' loop update statements, that is, 'i += 2' within a 'for(int i = ...;...; i += 2)' statement Use the Maximum statements per method field to specify the maximum allowed number of statements in a method. Inspection ID: NonCommentSourceStatements", + "markdown": "Reports methods whose number of statements exceeds the specified maximum.\n\nMethods with too many statements may be confusing and are a good sign that refactoring is necessary.\n\nThe following statements are not counted:\n\n* empty statements (semicolons)\n* block statements\n* `for` loop initialization statements, that is, `int i = ...` within a `for(int i = ...;...)` statement\n* `for` loop update statements, that is, `i += 2` within a `for(int i = ...;...; i += 2)` statement\n\nUse the **Maximum statements per method** field to specify the maximum allowed number of statements in a method.\n\n\nInspection ID: NonCommentSourceStatements" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyLongMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConfusingMainMethod", + "shortDescription": { + "text": "Confusing 'main()' method" + }, + "fullDescription": { + "text": "Reports methods that are named \"main\", but do not have the 'public static void main(String[])' signature in Java up to 21. Starting from Java 21 Preview, inspection doesn't highlight in case of package-private, protected or instance main methods, also without parameters. Additionally main methods located in anonymous or local classes are reported. Anonymous and local classes do not have a fully qualified name and thus can't be run. Such methods may be confusing, as methods named \"main\" are expected to be application entry points. Example: 'class Main {\n void main(String[] args) {} // warning here because there are no \"public static\" modifiers\n }' A quick-fix that renames such methods is available only in the editor. Inspection ID: ConfusingMainMethod", + "markdown": "Reports methods that are named \"main\", but do not have the `public static void main(String[])` signature in Java up to 21. Starting from Java 21 Preview, inspection doesn't highlight in case of package-private, protected or instance main methods, also without parameters. Additionally main methods located in anonymous or local classes are reported. Anonymous and local classes do not have a fully qualified name and thus can't be run.\n\nSuch methods may be confusing, as methods named \"main\"\nare expected to be application entry points.\n\n**Example:**\n\n\n class Main {\n void main(String[] args) {} // warning here because there are no \"public static\" modifiers\n }\n\nA quick-fix that renames such methods is available only in the editor.\n\n\nInspection ID: ConfusingMainMethod" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ConfusingMainMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReadObjectInitialization", + "shortDescription": { + "text": "Instance field may not be initialized by 'readObject()'" + }, + "fullDescription": { + "text": "Reports fields that are not guaranteed to be initialized after the object is deserialized by the 'readObject()' method. The inspection doesn't report transient fields. Note: This inspection uses a very conservative control flow algorithm, and may incorrectly report fields as uninitialized. Example: 'class DataObject implements Serializable {\n String s; // s is not initialized in readObject\n int i;\n\n private void readObject(ObjectInputStream stream) throws IOException {\n i = stream.readInt();\n }\n}' Inspection ID: ReadObjectInitialization", + "markdown": "Reports fields that are not guaranteed to be initialized after the object is deserialized by the `readObject()` method.\n\nThe inspection doesn't report transient fields.\n\n\nNote: This inspection uses a very conservative control flow algorithm, and may incorrectly report fields\nas uninitialized.\n\n**Example:**\n\n\n class DataObject implements Serializable {\n String s; // s is not initialized in readObject\n int i;\n\n private void readObject(ObjectInputStream stream) throws IOException {\n i = stream.readInt();\n }\n }\n\nInspection ID: ReadObjectInitialization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InstanceVariableMayNotBeInitializedByReadObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonAtomicOperationOnVolatileField", + "shortDescription": { + "text": "Non-atomic operation on 'volatile' field" + }, + "fullDescription": { + "text": "Reports non-atomic operations on volatile fields. An example of a non-atomic operation is updating the field using the increment operator. As the operation involves read and write, and other modifications may happen in between, data may become corrupted. The operation can be made atomic by surrounding it with a 'synchronized' block or using one of the classes from the 'java.util.concurrent.atomic' package. Example: 'private volatile int v = 1;\n\n void foo() {\n v = 2 * v;\n }' Inspection ID: NonAtomicOperationOnVolatileField", + "markdown": "Reports non-atomic operations on volatile fields.\n\n\nAn example of a non-atomic operation is updating the field using the increment operator.\nAs the operation involves read and write, and other modifications may happen in between, data may become corrupted.\nThe operation can be made atomic by surrounding it with a `synchronized` block or\nusing one of the classes from the `java.util.concurrent.atomic` package.\n\n**Example:**\n\n\n private volatile int v = 1;\n\n void foo() {\n v = 2 * v;\n }\n\nInspection ID: NonAtomicOperationOnVolatileField" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NonAtomicOperationOnVolatileField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "QuestionableName", + "shortDescription": { + "text": "Questionable name" + }, + "fullDescription": { + "text": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards. Example: 'int aa = 42;' Rename quick-fix is suggested only in the editor. Use the option to list names that should be reported. Inspection ID: QuestionableName", + "markdown": "Reports variables, methods, or classes with questionable, not really descriptive names. Such names do not help to understand the code, and most probably were created as a temporary thing but were forgotten afterwards.\n\n**Example:**\n\n\n int aa = 42;\n\nRename quick-fix is suggested only in the editor.\n\n\nUse the option to list names that should be reported.\n\n\nInspection ID: QuestionableName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "QuestionableName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MultipleVariablesInDeclaration", + "shortDescription": { + "text": "Multiple variables in one declaration" + }, + "fullDescription": { + "text": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable. Some coding standards prohibit such declarations. Example: 'int x = 1, y = 2;' After the quick-fix is applied: 'int x = 1;\n int y = 2;' Configure the inspection: Use the Ignore 'for' loop declarations option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example: 'for (int i = 0, max = list.size(); i > max; i++) {}' Use the Only warn on different array dimensions in a single declaration option to only warn when variables with different array dimensions are declared in a single declaration, for example: 'String s = \"\", array[];' Inspection ID: MultipleVariablesInDeclaration New in 2019.2", + "markdown": "Reports multiple variables that are declared in a single declaration and suggest creating a separate declaration for each variable.\n\nSome coding standards prohibit such declarations.\n\nExample:\n\n\n int x = 1, y = 2;\n\nAfter the quick-fix is applied:\n\n\n int x = 1;\n int y = 2;\n\nConfigure the inspection:\n\n* Use the **Ignore 'for' loop declarations** option to ignore multiple variables declared in the initialization of a 'for' loop statement, for example:\n\n\n for (int i = 0, max = list.size(); i > max; i++) {}\n\n* Use the **Only warn on different array dimensions in a single declaration** option to only warn when variables with different array dimensions are declared in a single declaration, for example:\n\n\n String s = \"\", array[];\n\nInspection ID: MultipleVariablesInDeclaration\n\nNew in 2019.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MultipleVariablesInDeclaration", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IOResource", + "shortDescription": { + "text": "I/O resource opened but not safely closed" + }, + "fullDescription": { + "text": "Reports I/O resources that are not safely closed. I/O resources checked by this inspection include 'java.io.InputStream', 'java.io.OutputStream', 'java.io.Reader', 'java.io.Writer', 'java.util.zip.ZipFile', 'java.io.Closeable' and 'java.io.RandomAccessFile'. I/O resources wrapped by other I/O resources are not reported, as the wrapped resource will be closed by the wrapping resource. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void save() throws IOException {\n FileWriter writer = new FileWriter(\"filename.txt\"); //warning\n writer.write(\"sample\");\n }' Use the following options to configure the inspection: List I/O resource classes that do not need to be closed and should be ignored by this inspection. Whether an I/O resource is allowed to be opened inside a 'try'block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: IOResource", + "markdown": "Reports I/O resources that are not safely closed. I/O resources checked by this inspection include `java.io.InputStream`, `java.io.OutputStream`, `java.io.Reader`, `java.io.Writer`, `java.util.zip.ZipFile`, `java.io.Closeable` and `java.io.RandomAccessFile`.\n\n\nI/O resources wrapped by other I/O resources are not reported, as the wrapped resource will be closed by the wrapping resource.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void save() throws IOException {\n FileWriter writer = new FileWriter(\"filename.txt\"); //warning\n writer.write(\"sample\");\n }\n\n\nUse the following options to configure the inspection:\n\n* List I/O resource classes that do not need to be closed and should be ignored by this inspection.\n* Whether an I/O resource is allowed to be opened inside a `try`block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: IOResource" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IOResourceOpenedButNotSafelyClosed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Resource management", + "index": 47, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UNCHECKED_WARNING", + "shortDescription": { + "text": "Unchecked warning" + }, + "fullDescription": { + "text": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger 'ClassCastException' at runtime. Example: 'List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment' Inspection ID: UNCHECKED_WARNING", + "markdown": "Reports code on which an unchecked warning will be issued by the javac compiler. Every unchecked warning may potentially trigger `ClassCastException` at runtime.\n\nExample:\n\n\n List items = Arrays.asList(\"string\", \"string\");\n List numbers = Collections.unmodifiableList(items); // unchecked assignment\n\nInspection ID: UNCHECKED_WARNING" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "unchecked", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Compiler issues", + "index": 94, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantLengthCheck", + "shortDescription": { + "text": "Redundant array length check" + }, + "fullDescription": { + "text": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly. Example: 'void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }' A quick-fix is suggested to unwrap or remove the length check: 'void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }' Inspection ID: RedundantLengthCheck New in 2022.3", + "markdown": "Reports unnecessary array length checks followed by array iteration. When array length is zero, the iteration will be skipped anyway, so there's no need to check length explicitly.\n\nExample:\n\n\n void f(String[] array) {\n if (array.length != 0) { // unnecessary check\n for (String str : array) {\n System.out.println(str);\n }\n }\n }\n\nA quick-fix is suggested to unwrap or remove the length check:\n\n\n void f(String[] array) {\n for (String str : array) {\n System.out.println(str);\n }\n }\n\nInspection ID: RedundantLengthCheck\n\nNew in 2022.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantLengthCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DataFlowIssue", + "shortDescription": { + "text": "Nullability and data flow problems" + }, + "fullDescription": { + "text": "Reports code constructs that always violate nullability contracts, may throw exceptions, or are just redundant, based on data flow analysis. Examples: 'if (array.length < index) {\n System.out.println(array[index]);\n} // Array index is always out of bounds\n\nif (str == null) System.out.println(\"str is null\");\nSystem.out.println(str.trim());\n// the last statement may throw an NPE\n\n@NotNull\nInteger square(@Nullable Integer input) {\n // the method contract is violated\n return input == null ? null : input * input;\n}' The inspection behavior may be controlled by a number of annotations, such as nullability annotations, '@Contract' annotation, '@Range' annotation and so on. Configure the inspection: Use the Suggest @Nullable annotation for methods/fields/parameters where nullable values are used option to warn when a nullable value is passed as an argument to a method with a non-annotated parameter, stored into non-annotated field, or returned from a non-annotated method. In this case, the inspection will suggest propagating the '@Nullable' annotation. You can also configure nullability annotations using the Configure Annotations button. Use the Treat non-annotated members and parameters as @Nullable option to assume that non-annotated members can be null, so they must not be used in non-null context. Use the Report not-null required parameter with null-literal argument usages option to report method parameters that cannot be null (e.g. immediately dereferenced in the method body), but there are call sites where a 'null' literal is passed. Use the Report nullable methods that always return a non-null value option to report methods that are annotated as '@Nullable', but always return non-null value. In this case, it's suggested that you change the annotation to '@NotNull'. Use the Ignore assert statements option to control how the inspection treats 'assert' statements. By default, the option is disabled, which means that the assertions are assumed to be executed (-ea mode). If the option is enabled, the assertions will be completely ignored (-da mode). Use the Report problems that happen only on some code paths option to control whether to report problems that may happen only on some code path. If this option is disabled, warnings like exception is possible will not be reported. The inspection will report only warnings like exception will definitely occur. This mode may greatly reduce the number of false-positives, especially if the code is not consistently annotated with nullability and contract annotations. That is why it can be useful for finding the most important problems in legacy code bases. Before IntelliJ IDEA 2022.3, this inspection was part of the \"Constant Conditions & Exceptions\" inspection. Now, it is split into two inspections: \"Constant Values\" and \"Nullability and data flow problems\". Inspection ID: DataFlowIssue", + "markdown": "Reports code constructs that always violate nullability contracts, may throw exceptions, or are just redundant, based on data flow analysis.\n\nExamples:\n\n if (array.length < index) {\n System.out.println(array[index]);\n } // Array index is always out of bounds\n\n if (str == null) System.out.println(\"str is null\");\n System.out.println(str.trim());\n // the last statement may throw an NPE\n\n @NotNull\n Integer square(@Nullable Integer input) {\n // the method contract is violated\n return input == null ? null : input * input;\n }\n\n\nThe inspection behavior may be controlled by a number of annotations, such as\n[nullability](https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html) annotations,\n[@Contract](https://www.jetbrains.com/help/idea/contract-annotations.html) annotation,\n`@Range` annotation and so on.\n\nConfigure the inspection:\n\n* Use the **Suggest @Nullable annotation for methods/fields/parameters where nullable values are used** option to warn when a nullable value is passed as an argument to a method with a non-annotated parameter, stored into non-annotated field, or returned from a non-annotated method. In this case, the inspection will suggest propagating the `@Nullable` annotation. You can also configure nullability annotations using the **Configure Annotations** button.\n* Use the **Treat non-annotated members and parameters as @Nullable** option to assume that non-annotated members can be null, so they must not be used in non-null context.\n* Use the **Report not-null required parameter with null-literal argument usages** option to report method parameters that cannot be null (e.g. immediately dereferenced in the method body), but there are call sites where a `null` literal is passed.\n* Use the **Report nullable methods that always return a non-null value** option to report methods that are annotated as `@Nullable`, but always return non-null value. In this case, it's suggested that you change the annotation to `@NotNull`.\n* Use the **Ignore assert statements** option to control how the inspection treats `assert` statements. By default, the option is disabled, which means that the assertions are assumed to be executed (-ea mode). If the option is enabled, the assertions will be completely ignored (-da mode).\n* Use the **Report problems that happen only on some code paths** option to control whether to report problems that may happen only on some code path. If this option is disabled, warnings like *exception is possible* will not be reported. The inspection will report only warnings like *exception will definitely occur*. This mode may greatly reduce the number of false-positives, especially if the code is not consistently annotated with nullability and contract annotations. That is why it can be useful for finding the most important problems in legacy code bases.\n\n\nBefore IntelliJ IDEA 2022.3, this inspection was part of the \"Constant Conditions \\& Exceptions\" inspection.\nNow, it is split into two inspections:\n\"Constant Values\" and \"Nullability and data flow problems\".\n\nInspection ID: DataFlowIssue" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DataFlowIssue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParameterCanBeLocal", + "shortDescription": { + "text": "Value passed as parameter never read" + }, + "fullDescription": { + "text": "Reports redundant method parameters that can be replaced with local variables. If all local usages of a parameter are preceded by assignments to that parameter, the parameter can be removed and its usages replaced with local variables. It makes no sense to have such a parameter, as values that are passed to it are overwritten. Usually, the problem appears as a result of refactoring. Example: 'void test(int p) {\n p = 1;\n System.out.print(p);\n }' After the quick-fix is applied: 'void test() {\n int p = 1;\n System.out.print(p);\n }' Inspection ID: ParameterCanBeLocal", + "markdown": "Reports redundant method parameters that can be replaced with local variables.\n\nIf all local usages of a parameter are preceded by assignments to that parameter, the\nparameter can be removed and its usages replaced with local variables.\nIt makes no sense to have such a parameter, as values that are passed to it are overwritten.\nUsually, the problem appears as a result of refactoring.\n\nExample:\n\n\n void test(int p) {\n p = 1;\n System.out.print(p);\n }\n\nAfter the quick-fix is applied:\n\n\n void test() {\n int p = 1;\n System.out.print(p);\n }\n\nInspection ID: ParameterCanBeLocal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ParameterCanBeLocal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CallToSimpleGetterInClass", + "shortDescription": { + "text": "Call to simple getter from within class" + }, + "fullDescription": { + "text": "Reports calls to a simple property getter from within the property's class. A simple property getter is defined as one which simply returns the value of a field, and does no other calculations. Such simple getter calls can be safely inlined using the quick-fix. Some coding standards also suggest against the use of simple getters for code clarity reasons. Example: 'public class Salient {\n private String name;\n\n public String getName() {\n return name;\n }\n\n @Override\n public String toString() {\n return getName();\n }\n }' After the quick-fix is applied: 'public class Salient {\n private String name;\n\n public String getName() {\n return name;\n }\n\n @Override\n public String toString() {\n return name;\n }\n }' Use the following options to configure the inspection: Whether to only report getter calls on 'this', not on objects of the same type passed in as a parameter. Whether to ignore non-'private' getters. Inspection ID: CallToSimpleGetterInClass", + "markdown": "Reports calls to a simple property getter from within the property's class.\n\n\nA simple property getter is defined as one which simply returns the value of a field,\nand does no other calculations. Such simple getter calls can be safely inlined using the quick-fix.\nSome coding standards also suggest against the use of simple getters for code clarity reasons.\n\n**Example:**\n\n\n public class Salient {\n private String name;\n\n public String getName() {\n return name;\n }\n\n @Override\n public String toString() {\n return getName();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Salient {\n private String name;\n\n public String getName() {\n return name;\n }\n\n @Override\n public String toString() {\n return name;\n }\n }\n\nUse the following options to configure the inspection:\n\n* Whether to only report getter calls on `this`, not on objects of the same type passed in as a parameter.\n* Whether to ignore non-`private` getters.\n\nInspection ID: CallToSimpleGetterInClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToSimpleGetterFromWithinClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwitchStatementDensity", + "shortDescription": { + "text": "'switch' statement with too low of a branch density" + }, + "fullDescription": { + "text": "Reports 'switch' statements or expressions with a too low ratio of switch labels to executable statements. Such 'switch' statements may be confusing and should probably be refactored. Example: 'switch (i) { // one case and 5 executable statements -> 20% density\n case 1:\n System.out.println(\"1\");\n System.out.println(\"2\");\n System.out.println(\"3\");\n System.out.println(\"4\");\n System.out.println(\"5\");\n break;\n }' Use the Minimum density of branches field to specify the allowed ratio of the switch labels to executable statements. Inspection ID: SwitchStatementDensity", + "markdown": "Reports `switch` statements or expressions with a too low ratio of switch labels to executable statements.\n\nSuch `switch` statements\nmay be confusing and should probably be refactored.\n\nExample:\n\n\n switch (i) { // one case and 5 executable statements -> 20% density\n case 1:\n System.out.println(\"1\");\n System.out.println(\"2\");\n System.out.println(\"3\");\n System.out.println(\"4\");\n System.out.println(\"5\");\n break;\n }\n\n\nUse the **Minimum density of branches** field to specify the allowed ratio of the switch labels to executable statements.\n\nInspection ID: SwitchStatementDensity" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SwitchStatementDensity", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonSerializableFieldInSerializableClass", + "shortDescription": { + "text": "Non-serializable field in a 'Serializable' class" + }, + "fullDescription": { + "text": "Reports non-serializable fields in classes that implement 'java.io.Serializable'. Such fields will result in runtime exceptions if the object is serialized. Fields declared 'transient' or 'static' are not reported, nor are fields of classes that have a 'writeObject' method defined. This inspection assumes fields of the types 'java.util.Collection' and 'java.util.Map' to be 'Serializable', unless the types they are declared in are non-'Serializable'. Example: 'class NonSerializableClass {}\n\n public class SerializableClass implements Serializable {\n NonSerializableClass clazz; // warning: Non-serializable field 'clazz' in a Serializable class\n static NonSerializableClass staticClazz; // no warnings\n }'\n Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. List annotations that will make the inspection ignore the annotated fields. Whether to ignore fields initialized with an anonymous class. Inspection ID: NonSerializableFieldInSerializableClass", + "markdown": "Reports non-serializable fields in classes that implement `java.io.Serializable`. Such fields will result in runtime exceptions if the object is serialized.\n\n\nFields declared\n`transient` or `static`\nare not reported, nor are fields of classes that have a `writeObject` method defined.\n\n\nThis inspection assumes fields of the types\n`java.util.Collection` and\n`java.util.Map` to be\n`Serializable`, unless the types\nthey are declared in are non-`Serializable`.\n\n**Example:**\n\n\n class NonSerializableClass {}\n\n public class SerializableClass implements Serializable {\n NonSerializableClass clazz; // warning: Non-serializable field 'clazz' in a Serializable class\n static NonSerializableClass staticClazz; // no warnings\n }\n \n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization.\n* List annotations that will make the inspection ignore the annotated fields.\n* Whether to ignore fields initialized with an anonymous class.\n\nInspection ID: NonSerializableFieldInSerializableClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonSerializableFieldInSerializableClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MismatchedJavadocCode", + "shortDescription": { + "text": "Mismatch between Javadoc and code" + }, + "fullDescription": { + "text": "Reports parts of method specification written in English that contradict with the method declaration. This includes: Method specified to return 'true' or 'false' but its return type is not boolean. Method specified to return 'null' but it's annotated as '@NotNull' or its return type is primitive. Method specified to return list but its return type is set or array. And so on. Example: '/**\n * @return true if user is found, false otherwise\n */\n User findUser(String name);' Note that false-positives are possible, as this inspection tries to interpret a human language. However, if the inspection reports incorrectly, it's still possible that the description is confusing and should be rewritten. New in 2022.3 Inspection ID: MismatchedJavadocCode", + "markdown": "Reports parts of method specification written in English that contradict with the method declaration. This includes:\n\n* Method specified to return `true` or `false` but its return type is not boolean.\n* Method specified to return `null` but it's annotated as `@NotNull` or its return type is primitive.\n* Method specified to return list but its return type is set or array.\n* And so on.\n\n**Example:**\n\n\n /**\n * @return true if user is found, false otherwise\n */\n User findUser(String name);\n\n\nNote that false-positives are possible, as this inspection tries to interpret a human language. However, if the inspection reports\nincorrectly, it's still possible that the description is confusing and should be rewritten.\n\n\nNew in 2022.3\n\nInspection ID: MismatchedJavadocCode" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MismatchedJavadocCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EnhancedSwitchMigration", + "shortDescription": { + "text": "Statement can be replaced with enhanced 'switch'" + }, + "fullDescription": { + "text": "Reports 'switch' statements that can be automatically replaced with enhanced 'switch' statements or expressions. Example: 'double getPrice(String fruit) {\n // Switch statement can be replaced with enhanced 'switch'\n switch (fruit) {\n case \"Apple\":\n return 1.0;\n case \"Orange\":\n return 1.5;\n case \"Mango\":\n return 2.0;\n default:\n throw new IllegalArgumentException();\n }\n }' After the quick-fix is applied: 'double getPrice(String fruit) {\n return switch (fruit) {\n case \"Apple\" -> 1.0;\n case \"Orange\" -> 1.5;\n case \"Mango\" -> 2.0;\n default -> throw new IllegalArgumentException();\n };\n }' Use the Show warning only if conversion to expression is possible option not to warn about conversion to 'switch' statement. Use the Maximum number of statements in one branch to convert to switch expression option warn about conversion to expression only if each branch has less than the given number of statements. This inspection depends on the Java feature 'Enhanced 'switch' blocks', which is available since Java 14. Inspection ID: EnhancedSwitchMigration New in 2019.1", + "markdown": "Reports `switch` statements that can be automatically replaced with enhanced `switch` statements or expressions.\n\n**Example:**\n\n\n double getPrice(String fruit) {\n // Switch statement can be replaced with enhanced 'switch'\n switch (fruit) {\n case \"Apple\":\n return 1.0;\n case \"Orange\":\n return 1.5;\n case \"Mango\":\n return 2.0;\n default:\n throw new IllegalArgumentException();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n double getPrice(String fruit) {\n return switch (fruit) {\n case \"Apple\" -> 1.0;\n case \"Orange\" -> 1.5;\n case \"Mango\" -> 2.0;\n default -> throw new IllegalArgumentException();\n };\n }\n \n\n* Use the **Show warning only if conversion to expression is possible** option not to warn about conversion to `switch` statement.\n* Use the **Maximum number of statements in one branch to convert to switch expression** option warn about conversion to expression only if each branch has less than the given number of statements.\n\nThis inspection depends on the Java feature 'Enhanced 'switch' blocks', which is available since Java 14.\n\nInspection ID: EnhancedSwitchMigration\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EnhancedSwitchMigration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 14", + "index": 106, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifiableAnnotation", + "shortDescription": { + "text": "Simplifiable annotation" + }, + "fullDescription": { + "text": "Reports annotations that can be simplified to their single-element or marker shorthand form. Problems reported: Redundant 'value=' in annotation name-value pairs Redundant braces around array values that contain only a single value Redundant whitespace between the @-sign and the name of annotations Redundant whitespace between annotation names and parameter lists Redundant parentheses in annotations without any parameters Example: '@interface Foo { String[] value(); }\n\n @ Foo({\"foo\"})\n public String name;' After the quick-fix is applied: '@interface Foo { String[] value(); }\n\n @Foo(\"foo\")\n public String name;' Inspection ID: SimplifiableAnnotation", + "markdown": "Reports annotations that can be simplified to their single-element or marker shorthand form.\n\n\nProblems reported:\n\n* Redundant `value=` in annotation name-value pairs\n* Redundant braces around array values that contain only a single value\n* Redundant whitespace between the @-sign and the name of annotations\n* Redundant whitespace between annotation names and parameter lists\n* Redundant parentheses in annotations without any parameters\n\n**Example:**\n\n\n @interface Foo { String[] value(); }\n\n @ Foo({\"foo\"})\n public String name;\n\nAfter the quick-fix is applied:\n\n\n @interface Foo { String[] value(); }\n\n @Foo(\"foo\")\n public String name;\n\nInspection ID: SimplifiableAnnotation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SimplifiableAnnotation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DoubleLiteralMayBeFloatLiteral", + "shortDescription": { + "text": "Cast to 'float' can be 'float' literal" + }, + "fullDescription": { + "text": "Reports 'double' literal expressions that are immediately cast to 'float'. Such literal expressions can be replaced with equivalent 'float' literals. Example: 'float f = (float)1.1;' After the quick-fix is applied: 'float f = 1.1f;' Inspection ID: DoubleLiteralMayBeFloatLiteral", + "markdown": "Reports `double` literal expressions that are immediately cast to `float`.\n\nSuch literal expressions can be replaced with equivalent `float` literals.\n\n**Example:**\n\n float f = (float)1.1;\n\nAfter the quick-fix is applied:\n\n float f = 1.1f;\n\nInspection ID: DoubleLiteralMayBeFloatLiteral" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DoubleLiteralMayBeFloatLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues/Cast", + "index": 108, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Guava", + "shortDescription": { + "text": "Guava's functional primitives can be replaced with Java" + }, + "fullDescription": { + "text": "Reports usages of Guava's functional primitives that can be migrated to standard Java API calls. For example, the inspection reports usages of classes and interfaces like 'FluentIterable', 'Optional', 'Function', 'Predicate', or 'Supplier'. Example: 'ImmutableList results = FluentIterable.from(List.of(1, 2, 3)).transform(Object::toString).toList();' After the quick-fix is applied: 'List results = List.of(1, 2, 3).stream().map(Object::toString).collect(Collectors.toList());' The quick-fix may change the semantics. Some lazily evaluated Guava iterables can be transformed to eagerly evaluated. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: Guava", + "markdown": "Reports usages of Guava's functional primitives that can be migrated to standard Java API calls.\n\nFor example, the inspection reports usages of classes and interfaces like `FluentIterable`, `Optional`, `Function`,\n`Predicate`, or `Supplier`.\n\nExample:\n\n\n ImmutableList results = FluentIterable.from(List.of(1, 2, 3)).transform(Object::toString).toList();\n\nAfter the quick-fix is applied:\n\n\n List results = List.of(1, 2, 3).stream().map(Object::toString).collect(Collectors.toList());\n\n\nThe quick-fix may change the semantics. Some lazily evaluated Guava iterables can be transformed to eagerly evaluated.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: Guava" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Guava", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NoopMethodInAbstractClass", + "shortDescription": { + "text": "No-op method in 'abstract' class" + }, + "fullDescription": { + "text": "Reports no-op (for \"no operation\") methods in 'abstract' classes. It is usually a better design to make such methods 'abstract' themselves so that classes inheriting these methods provide their implementations. Example: 'abstract class Test {\n protected void doTest() {\n }\n }' Inspection ID: NoopMethodInAbstractClass", + "markdown": "Reports no-op (for \"no operation\") methods in `abstract` classes.\n\nIt is usually a better\ndesign to make such methods `abstract` themselves so that classes inheriting these\nmethods provide their implementations.\n\n**Example:**\n\n\n abstract class Test {\n protected void doTest() {\n }\n }\n\nInspection ID: NoopMethodInAbstractClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NoopMethodInAbstractClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverloadedMethodsWithSameNumberOfParameters", + "shortDescription": { + "text": "Overloaded methods with same number of parameters" + }, + "fullDescription": { + "text": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called. Example: 'class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }' Use the option to ignore overloaded methods whose parameter types are definitely incompatible. Inspection ID: OverloadedMethodsWithSameNumberOfParameters", + "markdown": "Reports methods that are declared in the same class, have the same name, and the same number of parameters. Such overloads cam be very confusing because it can be unclear which overload gets called.\n\n**Example:**\n\n\n class Main {\n public static void execute(Runnable r) {}\n public static void execute(RunnableFuture c) {}\n }\n\n\nUse the option to ignore overloaded methods whose parameter types are definitely incompatible.\n\nInspection ID: OverloadedMethodsWithSameNumberOfParameters" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverloadedMethodsWithSameNumberOfParameters", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Method", + "index": 91, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverridableMethodCallDuringObjectConstruction", + "shortDescription": { + "text": "Overridable method called during object construction" + }, + "fullDescription": { + "text": "Reports calls to overridable methods of the current class during object construction. A method is called during object construction if it is inside a: Constructor Non-static instance initializer Non-static field initializer 'clone()' method 'readObject()' method 'readObjectNoData()' method Methods are overridable if they are not declared as 'final', 'static', or 'private'. Package-local methods are considered safe, even though they are overridable. Such calls may result in subtle bugs, as object initialization may happen before the method call. Example: 'class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n }' This inspection shares the functionality with the following inspections: Abstract method called during object construction Overridden method called during object construction Only one inspection should be enabled at once to prevent warning duplication. Inspection ID: OverridableMethodCallDuringObjectConstruction", + "markdown": "Reports calls to overridable methods of the current class during object construction.\n\nA method is called during object construction if it is inside a:\n\n* Constructor\n* Non-static instance initializer\n* Non-static field initializer\n* `clone()` method\n* `readObject()` method\n* `readObjectNoData()` method\n* Methods are overridable if they are not declared as `final`, `static`, or `private`. Package-local methods are considered safe, even though they are overridable. Such calls may result in subtle bugs, as object initialization may happen before the method call.\n* **Example:**\n\n\n class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n }\n\n* This inspection shares the functionality with the following inspections:\n * Abstract method called during object construction\n * Overridden method called during object construction\n* Only one inspection should be enabled at once to prevent warning duplication.\n* Inspection ID: OverridableMethodCallDuringObjectConstruction" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverridableMethodCallDuringObjectConstruction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ImplicitCallToSuper", + "shortDescription": { + "text": "Implicit call to 'super()'" + }, + "fullDescription": { + "text": "Reports constructors that do not begin with a call to \"super\" constructor or another constructor of the same class. Such constructors can be thought of as implicitly beginning with a call to 'super()'. Some coding standards prefer that such calls to 'super()' be made explicitly. Example: 'class Foo {\n Foo() {}\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n super();\n }\n }' Use the inspection settings to ignore classes extending directly from 'Object'. For instance: 'class Foo {\n Foo() {} // Not reported\n }\n\n class Bar extends Foo {\n Bar() {} // Implicit call to 'super()'\n }' Inspection ID: ImplicitCallToSuper", + "markdown": "Reports constructors that do not begin with a call to \"super\" constructor or another constructor of the same class.\n\nSuch constructors can be thought of as implicitly beginning with a\ncall to `super()`. Some coding standards prefer that such calls to\n`super()` be made explicitly.\n\n**Example:**\n\n\n class Foo {\n Foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\n\nUse the inspection settings to ignore classes extending directly from `Object`.\nFor instance:\n\n\n class Foo {\n Foo() {} // Not reported\n }\n\n class Bar extends Foo {\n Bar() {} // Implicit call to 'super()'\n }\n\nInspection ID: ImplicitCallToSuper" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ImplicitCallToSuper", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverlyLongLambda", + "shortDescription": { + "text": "Overly long lambda expression" + }, + "fullDescription": { + "text": "Reports lambda expressions whose number of statements exceeds the specified maximum. Lambda expressions that are too long may be confusing, and it is often better to extract the statements into a separate method. The following statements are not counted: empty statements (semicolons) block statements 'for' loop initialization statements, that is, 'int i = ...' within a 'for(int i = ...;...)' statement 'for' loop update statements, that is, 'i += 2' within a 'for(int i = ...;...; i += 2)' statement Use the Non-comment source statements limit field to specify the maximum allowed number of statements in a lambda expression. Inspection ID: OverlyLongLambda", + "markdown": "Reports lambda expressions whose number of statements exceeds the specified maximum.\n\nLambda expressions that are too long may be confusing, and it is often better to extract the statements into a separate method.\n\n\nThe following statements are not counted:\n\n* empty statements (semicolons)\n* block statements\n* `for` loop initialization statements, that is, `int i = ...` within a `for(int i = ...;...)` statement\n* `for` loop update statements, that is, `i += 2` within a `for(int i = ...;...; i += 2)` statement\n\nUse the **Non-comment source statements limit** field to specify the maximum allowed number of statements in a lambda expression.\n\n\nInspection ID: OverlyLongLambda" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyLongLambda", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParametersPerMethod", + "shortDescription": { + "text": "Method with too many parameters" + }, + "fullDescription": { + "text": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary. Methods that have super methods are not reported. Use the Parameter limit field to specify the maximum allowed number of parameters for a method. Inspection ID: ParametersPerMethod", + "markdown": "Reports methods whose number of parameters exceeds the specified maximum. Methods with too many parameters can be a good sign that a refactoring is necessary.\n\nMethods that have super methods are not reported.\n\nUse the **Parameter limit** field to specify the maximum allowed number of parameters for a method.\n\n\nInspection ID: ParametersPerMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodWithTooManyParameters", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingDeprecatedAnnotation", + "shortDescription": { + "text": "Missing '@Deprecated' annotation" + }, + "fullDescription": { + "text": "Reports module declarations, classes, fields, or methods that have the '@deprecated' Javadoc tag but do not have the '@java.lang.Deprecated' annotation. Example: '/**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }' After the quick-fix is applied: '/**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }' Use the checkbox below to report members annotated with '@Deprecated' without an explanation in a Javadoc '@deprecated' tag. This inspection depends on the Java feature 'Annotations', which is available since Java 5. Inspection ID: MissingDeprecatedAnnotation", + "markdown": "Reports module declarations, classes, fields, or methods that have the `@deprecated` Javadoc tag but do not have the `@java.lang.Deprecated` annotation.\n\n**Example:**\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n void sample(){ }\n\nAfter the quick-fix is applied:\n\n\n /**\n * @deprecated use {@code example()} instead\n */\n @Deprecated\n void sample(){ }\n\n\nUse the checkbox below to report members annotated with `@Deprecated` without\nan explanation in a Javadoc `@deprecated` tag.\n\nThis inspection depends on the Java feature 'Annotations', which is available since Java 5.\n\nInspection ID: MissingDeprecatedAnnotation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MissingDeprecatedAnnotation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringTemplateMigration", + "shortDescription": { + "text": "String template can be used" + }, + "fullDescription": { + "text": "Reports 'String' concatenations that can be simplified by replacing them with a string template. Example: 'String name = \"Bob\";\n String greeting = \"Hello, \" + name + \". You are \" + 29 + \" years old.\";' After the quick-fix is applied: 'String name = \"Bob\";\n String greeting = STR.\"Hello, \\{name}. You are 29 years old.\";' This inspection depends on the Java feature 'String templates', which is available since Java 21-preview. Inspection ID: StringTemplateMigration New in 2023.3", + "markdown": "Reports `String` concatenations that can be simplified by replacing them with a string template.\n\n**Example:**\n\n\n String name = \"Bob\";\n String greeting = \"Hello, \" + name + \". You are \" + 29 + \" years old.\";\n\nAfter the quick-fix is applied:\n\n\n String name = \"Bob\";\n String greeting = STR.\"Hello, \\{name}. You are 29 years old.\";\n\nThis inspection depends on the Java feature 'String templates', which is available since Java 21-preview.\n\nInspection ID: StringTemplateMigration\n\nNew in 2023.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringTemplateMigration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 21", + "index": 77, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MustAlreadyBeRemovedApi", + "shortDescription": { + "text": "API must already be removed" + }, + "fullDescription": { + "text": "Reports declarations marked with '@ApiStatus.ScheduledForRemoval' that should have been removed in the current version of the declaring library. It compares the specified scheduled removal version with the version that you can set below. Specify the version as a string separated with dots and optionally postfixed with 'alpha', 'beta', 'snapshot', or 'eap'. Examples of valid versions: '1.0', '2.3.1', '2018.1', '7.5-snapshot', '3.0-eap'. Version comparison is intuitive: '1.0 < 2.0', '1.0-eap < 1.0', '2.3-snapshot < 2.3' and so on. For detailed comparison logic, refer to the implementation of VersionComparatorUtil. Inspection ID: MustAlreadyBeRemovedApi", + "markdown": "Reports declarations marked with `@ApiStatus.ScheduledForRemoval` that should have been removed in the current version of the declaring library.\n\nIt compares the specified scheduled removal version with the version that you can set below.\n\n\nSpecify the version as a string separated with dots and optionally postfixed with\n`alpha`, `beta`, `snapshot`, or `eap`.\n\nExamples of valid versions: `1.0`, `2.3.1`, `2018.1`, `7.5-snapshot`, `3.0-eap`.\n\n\nVersion comparison is intuitive: `1.0 < 2.0`, `1.0-eap < 1.0`, `2.3-snapshot < 2.3` and so on.\nFor detailed comparison logic, refer to the implementation of [VersionComparatorUtil](https://github.com/JetBrains/intellij-community/blob/master/platform/util-rt/src/com/intellij/util/text/VersionComparatorUtil.java).\n\nInspection ID: MustAlreadyBeRemovedApi" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "MustAlreadyBeRemovedApi", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CachedNumberConstructorCall", + "shortDescription": { + "text": "Number constructor call with primitive argument" + }, + "fullDescription": { + "text": "Reports instantiations of new 'Long', 'Integer', 'Short', or 'Byte' objects that have a primitive 'long', 'integer', 'short', or 'byte' argument. It is recommended that you use the static method 'valueOf()' introduced in Java 5. By default, this method caches objects for values between -128 and 127 inclusive. Example: 'Integer i = new Integer(1);\n Long l = new Long(1L);' After the quick-fix is applied, the code changes to: 'Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);' This inspection only reports if the language level of the project or module is 5 or higher Use the Ignore new number expressions with a String argument option to ignore calls to number constructors with a 'String' argument. Use the Report only when constructor is @Deprecated option to only report calls to deprecated constructors. 'Long', 'Integer', 'Short' and 'Byte' constructors are deprecated since JDK 9. Inspection ID: CachedNumberConstructorCall", + "markdown": "Reports instantiations of new `Long`, `Integer`, `Short`, or `Byte` objects that have a primitive `long`, `integer`, `short`, or `byte` argument.\n\nIt is recommended that you use the static method `valueOf()`\nintroduced in Java 5. By default, this method caches objects for values between -128 and\n127 inclusive.\n\n**Example:**\n\n\n Integer i = new Integer(1);\n Long l = new Long(1L);\n\nAfter the quick-fix is applied, the code changes to:\n\n\n Integer i = Integer.valueOf(1);\n Long l = Long.valueOf(1L);\n\nThis inspection only reports if the language level of the project or module is 5 or higher\n\n\nUse the **Ignore new number expressions with a String argument** option to ignore calls to number constructors with a `String` argument.\n\n\nUse the **Report only when constructor is @Deprecated** option to only report calls to deprecated constructors.\n`Long`, `Integer`, `Short` and `Byte` constructors are deprecated since JDK 9.\n\nInspection ID: CachedNumberConstructorCall" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CachedNumberConstructorCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CloneDeclaresCloneNotSupported", + "shortDescription": { + "text": "'clone()' does not declare 'CloneNotSupportedException'" + }, + "fullDescription": { + "text": "Reports 'clone()' methods that do not declare 'throws CloneNotSupportedException'. If 'throws CloneNotSupportedException' is not declared, the method's subclasses will not be able to prohibit cloning in the standard way. This inspection does not report 'clone()' methods declared 'final' and 'clone()' methods on 'final' classes. Configure the inspection: Use the Only warn on 'protected' clone methods option to indicate that this inspection should only warn on 'protected clone()' methods. The Effective Java book (second and third edition) recommends omitting the 'CloneNotSupportedException' declaration on 'public' methods, because the methods that do not throw checked exceptions are easier to use. Example: 'public class Example implements Cloneable {\n // method doesn't declare 'throws CloneNotSupportedException'\n protected Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n return null;\n }\n }\n }' Inspection ID: CloneDeclaresCloneNotSupported", + "markdown": "Reports `clone()` methods that do not declare `throws CloneNotSupportedException`.\n\nIf `throws CloneNotSupportedException` is not declared, the method's subclasses will not be able to prohibit cloning\nin the standard way. This inspection does not report `clone()` methods declared `final`\nand `clone()` methods on `final` classes.\n\nConfigure the inspection:\n\nUse the **Only warn on 'protected' clone methods** option to indicate that this inspection should only warn on `protected clone()` methods.\nThe *Effective Java* book (second and third edition) recommends omitting the `CloneNotSupportedException`\ndeclaration on `public` methods, because the methods that do not throw checked exceptions are easier to use.\n\nExample:\n\n\n public class Example implements Cloneable {\n // method doesn't declare 'throws CloneNotSupportedException'\n protected Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n return null;\n }\n }\n }\n\nInspection ID: CloneDeclaresCloneNotSupported" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CloneDoesntDeclareCloneNotSupportedException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Cloning issues", + "index": 82, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkdownDocumentationCommentsMigration", + "shortDescription": { + "text": "Javadoc comment can be Markdown documentation comment" + }, + "fullDescription": { + "text": "Reports Javadoc comments that can be converted to Markdown documentation comments. Example: '/**\n * For blubbering of the florz.\n *\n * Similar to {@link com.deeps.Querp querping} class.\n */\n class FlorzBlubber {\n }' After the quick-fix is applied: '/// For blubbering of the florz.\n /// Similar to [querping][com.deeps.Querp] class.\n class FlorzBlubber {\n }' Inspection ID: MarkdownDocumentationCommentsMigration New in 2024.2", + "markdown": "Reports Javadoc comments that can be converted to Markdown documentation comments.\n\n**Example:**\n\n\n /**\n * For blubbering of the florz.\n *\n * Similar to {@link com.deeps.Querp querping} class.\n */\n class FlorzBlubber {\n }\n\nAfter the quick-fix is applied:\n\n\n /// For blubbering of the florz.\n /// Similar to [querping][com.deeps.Querp] class.\n class FlorzBlubber {\n }\n\nInspection ID: MarkdownDocumentationCommentsMigration\n\nNew in 2024.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MarkdownDocumentationCommentsMigration", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 23", + "index": 110, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BooleanExpressionMayBeConditional", + "shortDescription": { + "text": "Boolean expression can be replaced with conditional expression" + }, + "fullDescription": { + "text": "Reports any 'boolean' expressions which can be formulated in a more compact and, arguably, clear way than by using a conditional expression. Use the quick-fix to replace the 'boolean' expression by a conditional expression. Example: 'a && b || !a && c;' After the quick-fix is applied: 'a ? b : c;' Inspection ID: BooleanExpressionMayBeConditional", + "markdown": "Reports any `boolean` expressions which can be formulated in a more compact and, arguably, clear way than by using a conditional expression.\n\nUse the quick-fix to replace the `boolean` expression by a conditional expression.\n\n**Example:**\n\n\n a && b || !a && c;\n\nAfter the quick-fix is applied:\n\n\n a ? b : c;\n\n\nInspection ID: BooleanExpressionMayBeConditional" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "BooleanExpressionMayBeConditional", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldHidesSuperclassField", + "shortDescription": { + "text": "Subclass field hides superclass field" + }, + "fullDescription": { + "text": "Reports fields in a derived class that are named identically a field of a superclass. Java fields cannot be overridden in derived classes, so the field in the derived class will hide the field from the superclass. As a result of such naming, you may accidentally use the field of the derived class where the identically named field of a base class is intended. A quick-fix is suggested to rename the field in the derived class. Example: 'class Parent {\n Parent parent;\n}\nclass Child extends Parent {\n Child parent;\n}' You can configure the following options for this inspection: Ignore non-accessible fields - indicates whether this inspection should report all name clashes, or only clashes with fields which are visible from the subclass. Ignore static fields hiding static fields - ignore 'static' fields which hide 'static' fields in base classes. Inspection ID: FieldHidesSuperclassField", + "markdown": "Reports fields in a derived class that are named identically a field of a superclass. Java fields cannot be overridden in derived classes, so the field in the derived class will hide the field from the superclass.\n\n\nAs a result of such naming, you may accidentally use the field of the derived class\nwhere the identically named field of a base class is intended.\n\nA quick-fix is suggested to rename the field in the derived class.\n\n**Example:**\n\n class Parent {\n Parent parent;\n }\n class Child extends Parent {\n Child parent;\n }\n\n\nYou can configure the following options for this inspection:\n\n1. **Ignore non-accessible fields** - indicates whether this inspection should report all name clashes, or only clashes with fields which are visible from the subclass.\n2. **Ignore static fields hiding static fields** - ignore `static` fields which hide `static` fields in base classes.\n\nInspection ID: FieldHidesSuperclassField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FieldNameHidesFieldInSuperclass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryExplicitNumericCast", + "shortDescription": { + "text": "Unnecessary explicit numeric cast" + }, + "fullDescription": { + "text": "Reports primitive numeric casts that would be inserted implicitly by the compiler. Also, reports any primitive numeric casts that the compiler will remove. Example: 'int x = (short)5; // The cast will be removed by the javac tool' After the quick-fix is applied: 'int x = 5;' Inspection ID: UnnecessaryExplicitNumericCast", + "markdown": "Reports primitive numeric casts that would be inserted implicitly by the compiler. Also, reports any primitive numeric casts that the compiler will remove.\n\n**Example:**\n\n int x = (short)5; // The cast will be removed by the javac tool\n\nAfter the quick-fix is applied:\n`int x = 5;`\n\n\nInspection ID: UnnecessaryExplicitNumericCast" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryExplicitNumericCast", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues/Cast", + "index": 108, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimpleDateFormatWithoutLocale", + "shortDescription": { + "text": "'SimpleDateFormat' without locale" + }, + "fullDescription": { + "text": "Reports instantiations of 'java.util.SimpleDateFormat' or 'java.time.format.DateTimeFormatter' that do not specify a 'java.util.Locale'. These calls will use the platform default locale, which depends on the OS settings. This can lead to surprising behaviour when the code is run on a different platform or the OS settings are changed. 'Example:' 'new SimpleDateFormat(\"yyyy\");\n DateTimeFormatter.ofPattern(\"d/M/y\");' Inspection ID: SimpleDateFormatWithoutLocale", + "markdown": "Reports instantiations of `java.util.SimpleDateFormat` or `java.time.format.DateTimeFormatter` that do not specify a `java.util.Locale`. These calls will use the platform default locale, which depends on the OS settings. This can lead to surprising behaviour when the code is run on a different platform or the OS settings are changed.\n\n`Example:`\n\n\n new SimpleDateFormat(\"yyyy\");\n DateTimeFormatter.ofPattern(\"d/M/y\");\n\nInspection ID: SimpleDateFormatWithoutLocale" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SimpleDateFormatWithoutLocale", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnnotationClass", + "shortDescription": { + "text": "Annotation interface" + }, + "fullDescription": { + "text": "Reports annotation interfaces. Such interfaces are not supported under Java 1.4 and earlier. Inspection ID: AnnotationClass", + "markdown": "Reports annotation interfaces. Such interfaces are not supported under Java 1.4 and earlier.\n\n\nInspection ID: AnnotationClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AnnotationClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level issues", + "index": 62, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TransientFieldNotInitialized", + "shortDescription": { + "text": "Transient field is not initialized on deserialization" + }, + "fullDescription": { + "text": "Reports 'transient' fields that are initialized during normal object construction, but whose class does not have a 'readObject' method. As 'transient' fields are not serialized they need to be initialized separately in a 'readObject()' method during deserialization. Any 'transient' fields that are not initialized during normal object construction are considered to use the default initialization and are not reported by this inspection. Example: 'class Person implements Serializable {\n transient String name = \"Default\"; //warning, can actually be a null after deserialization\n transient String surname; //null is considered the default value and not reported\n }' Inspection ID: TransientFieldNotInitialized", + "markdown": "Reports `transient` fields that are initialized during normal object construction, but whose class does not have a `readObject` method.\n\n\nAs `transient` fields are not serialized they need\nto be initialized separately in a `readObject()` method\nduring deserialization.\n\n\nAny `transient` fields that\nare not initialized during normal object construction are considered to use the default\ninitialization and are not reported by this inspection.\n\n**Example:**\n\n\n class Person implements Serializable {\n transient String name = \"Default\"; //warning, can actually be a null after deserialization\n transient String surname; //null is considered the default value and not reported\n }\n\nInspection ID: TransientFieldNotInitialized" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TransientFieldNotInitialized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PropertyValueSetToItself", + "shortDescription": { + "text": "Property value set to itself" + }, + "fullDescription": { + "text": "Reports calls of setter methods with the same object getter as a value. Usually, this code does nothing and probably was not intended. For example: 'bean.setPayerId(bean.getPayerId());' Inspection ID: PropertyValueSetToItself", + "markdown": "Reports calls of setter methods with the same object getter as a value. Usually, this code does nothing and probably was not intended.\n\n**For example:**\n\n bean.setPayerId(bean.getPayerId());\n\n\nInspection ID: PropertyValueSetToItself" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PropertyValueSetToItself", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/JavaBeans issues", + "index": 35, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Finalize", + "shortDescription": { + "text": "'finalize()' should not be overridden" + }, + "fullDescription": { + "text": "Reports overriding the 'Object.finalize()' method. According to the 'Object.finalize()' documentation: The finalization mechanism is inherently problematic. Finalization can lead to performance issues, deadlocks, and hangs. Errors in finalizers can lead to resource leaks; there is no way to cancel finalization if it is no longer necessary; and no ordering is specified among calls to 'finalize' methods of different objects. Furthermore, there are no guarantees regarding the timing of finalization. The 'finalize' method might be called on a finalizable object only after an indefinite delay, if at all. Configure the inspection: Use the Ignore for trivial 'finalize()' implementations option to ignore 'finalize()' implementations with an empty method body or a body containing only 'if' statements that have a condition which evaluates to 'false' and is a compile-time constant. For performance reasons it can be beneficial to override a non-trivial 'finalize()' with an empty implementation in a subclass. An empty final 'finalize()' implementation can also be used to prevent subclasses from overriding. Inspection ID: Finalize", + "markdown": "Reports overriding the `Object.finalize()` method.\n\nAccording to the `Object.finalize()` documentation:\n>\n> The finalization mechanism is inherently problematic. Finalization can lead\n> to performance issues, deadlocks, and hangs. Errors in finalizers can lead\n> to resource leaks; there is no way to cancel finalization if it is no longer\n> necessary; and no ordering is specified among calls to `finalize`\n> methods of different objects. Furthermore, there are no guarantees regarding\n> the timing of finalization. The `finalize` method might be called\n> on a finalizable object only after an indefinite delay, if at all.\n\nConfigure the inspection:\n\n* Use the **Ignore for trivial 'finalize()' implementations** option to ignore `finalize()` implementations with an empty method body or a body containing only `if` statements that have a condition which evaluates to `false` and is a compile-time constant. For performance reasons it can be beneficial to override a non-trivial `finalize()` with an empty implementation in a subclass. An empty final `finalize()` implementation can also be used to prevent subclasses from overriding.\n\nInspection ID: Finalize" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FinalizeDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Finalization", + "index": 64, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PointlessArithmeticExpression", + "shortDescription": { + "text": "Pointless arithmetic expression" + }, + "fullDescription": { + "text": "Reports pointless arithmetic expressions. Such expressions include adding or subtracting zero, multiplying by zero or one, and division by one. Such expressions may be the result of automated refactorings and they are unlikely to be what the developer intended to do. The quick-fix simplifies such expressions. Example: 'void f(int a) {\n int x = a - a;\n int y = a + 0;\n int res = x / x;\n }' After the quick-fix is applied: 'void f(int a) {\n int x = 0;\n int y = a;\n int res = 1;\n }' Note that in rare cases, the suggested replacement might not be completely equivalent to the original code for all possible inputs. For example, the inspection suggests replacing 'x / x' with '1'. However, if 'x' is zero, the original code throws 'ArithmeticException' or results in 'NaN'. Also, if 'x' is 'NaN', then the result is also 'NaN'. It's very unlikely that such behavior is intended. Inspection ID: PointlessArithmeticExpression", + "markdown": "Reports pointless arithmetic expressions. Such expressions include adding or subtracting zero, multiplying by zero or one, and division by one.\n\nSuch expressions may be the result of automated refactorings and they are unlikely to be what the developer intended to do.\n\nThe quick-fix simplifies such expressions.\n\n**Example:**\n\n\n void f(int a) {\n int x = a - a;\n int y = a + 0;\n int res = x / x;\n }\n\nAfter the quick-fix is applied:\n\n\n void f(int a) {\n int x = 0;\n int y = a;\n int res = 1;\n }\n\n\nNote that in rare cases, the suggested replacement might not be completely equivalent to the original code\nfor all possible inputs. For example, the inspection suggests replacing `x / x` with `1`.\nHowever, if `x` is zero, the original code throws `ArithmeticException` or results in `NaN`.\nAlso, if `x` is `NaN`, then the result is also `NaN`. It's very unlikely that such behavior is intended.\n\nInspection ID: PointlessArithmeticExpression" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PointlessArithmeticExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverlyLargePrimitiveArrayInitializer", + "shortDescription": { + "text": "Overly large initializer for array of primitive type" + }, + "fullDescription": { + "text": "Reports array initializer expressions for primitive arrays that contain too many elements. Such initializers may result in overly large class files because code must be generated to initialize each array element. In memory or bandwidth constrained environments, it may be more efficient to load large arrays of primitives from resource files. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Use the option to specify the maximum number of elements to allow in primitive array initializers. Inspection ID: OverlyLargePrimitiveArrayInitializer", + "markdown": "Reports array initializer expressions for primitive arrays that contain too many elements. Such initializers may result in overly large class files because code must be generated to initialize each array element. In memory or bandwidth constrained environments, it may be more efficient to load large arrays of primitives from resource files.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n\nUse the option to specify the maximum number of elements to allow in primitive array initializers.\n\nInspection ID: OverlyLargePrimitiveArrayInitializer" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyLargePrimitiveArrayInitializer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassInitializer", + "shortDescription": { + "text": "Non-'static' initializer" + }, + "fullDescription": { + "text": "Reports non-'static' initializers in classes. Some coding standards prohibit instance initializers and recommend using constructors or field initializers for initialization. Also, deleting the 'static' keyword may accidentally create non-'static' initializers and result in obscure bugs. This inspection doesn't report instance initializers in anonymous classes. Use the Only warn when the class has one or more constructors option to ignore instance initializers in classes that don't have any constructors. Inspection ID: ClassInitializer", + "markdown": "Reports non-`static` initializers in classes.\n\nSome coding standards prohibit instance initializers and recommend using constructors or field initializers for initialization.\nAlso, deleting the `static` keyword may accidentally create non-`static` initializers and result in obscure bugs.\n\nThis inspection doesn't report instance initializers in anonymous classes.\n\n\nUse the **Only warn when the class has one or more constructors** option to ignore instance initializers in classes that don't have any constructors.\n\nInspection ID: ClassInitializer" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonStaticInitializer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectNotify", + "shortDescription": { + "text": "Call to 'notify()' instead of 'notifyAll()'" + }, + "fullDescription": { + "text": "Reports calls to 'Object.notify()'. While occasionally useful, in almost all cases 'Object.notifyAll()' is a better choice because calling 'Object.notify()' may lead to deadlocks. See Doug Lea's Concurrent Programming in Java for a discussion. Inspection ID: ObjectNotify", + "markdown": "Reports calls to `Object.notify()`. While occasionally useful, in almost all cases `Object.notifyAll()` is a better choice because calling `Object.notify()` may lead to deadlocks. See Doug Lea's *Concurrent Programming in Java* for a discussion.\n\nInspection ID: ObjectNotify" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToNotifyInsteadOfNotifyAll", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ContinueOrBreakFromFinallyBlock", + "shortDescription": { + "text": "'continue' or 'break' inside 'finally' block" + }, + "fullDescription": { + "text": "Reports 'break' or 'continue' statements inside of 'finally' blocks. While occasionally intended, such statements are very confusing, may mask thrown exceptions, and complicate debugging. Example: 'while (true) {\n try {\n throwingMethod();\n } finally {\n continue;\n }\n }' Inspection ID: ContinueOrBreakFromFinallyBlock", + "markdown": "Reports `break` or `continue` statements inside of `finally` blocks.\n\nWhile occasionally intended, such statements are very confusing, may mask thrown exceptions, and complicate debugging.\n\n**Example:**\n\n\n while (true) {\n try {\n throwingMethod();\n } finally {\n continue;\n }\n }\n\nInspection ID: ContinueOrBreakFromFinallyBlock" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ContinueOrBreakFromFinallyBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LengthOneStringsInConcatenation", + "shortDescription": { + "text": "Single character string concatenation" + }, + "fullDescription": { + "text": "Reports concatenation with string literals that consist of one character. These literals may be replaced with equivalent character literals, gaining some performance enhancement. Example: 'String hello = hell + \"o\";' After the quick-fix is applied: 'String hello = hell + 'o';' Inspection ID: LengthOneStringsInConcatenation", + "markdown": "Reports concatenation with string literals that consist of one character.\n\nThese literals may be replaced with equivalent character literals, gaining some performance enhancement.\n\n**Example:**\n\n\n String hello = hell + \"o\";\n\nAfter the quick-fix is applied:\n\n\n String hello = hell + 'o';\n\n\nInspection ID: LengthOneStringsInConcatenation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SingleCharacterStringConcatenation", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InstanceVariableUninitializedUse", + "shortDescription": { + "text": "Instance field used before initialization" + }, + "fullDescription": { + "text": "Reports instance variables that are read before initialization. The inspection ignores equality checks with 'null'. Example: 'class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore if annotated by option to specify special annotations. The inspection will ignore fields annotated with one of these annotations. Use the Ignore primitive fields option to ignore uninitialized primitive fields. Inspection ID: InstanceVariableUninitializedUse", + "markdown": "Reports instance variables that are read before initialization.\n\nThe inspection ignores equality checks with `null`.\n\n**Example:**\n\n\n class Foo {\n int bar;\n\n Foo() {\n System.out.println(bar);\n }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection will ignore fields\nannotated with one of these annotations.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields.\n\nInspection ID: InstanceVariableUninitializedUse" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InstanceVariableUsedBeforeInitialized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithTooManyTransitiveDependencies", + "shortDescription": { + "text": "Class with too many transitive dependencies" + }, + "fullDescription": { + "text": "Reports classes that are directly or indirectly dependent on too many other classes. Modifications to any dependency of such a class may require changing the class thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of transitive dependencies field to specify the maximum allowed number of direct or indirect dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassWithTooManyTransitiveDependencies", + "markdown": "Reports classes that are directly or indirectly dependent on too many other classes.\n\nModifications to any dependency of such a class may require changing the class thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of transitive dependencies** field to specify the maximum allowed number of direct or indirect dependencies\nfor a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassWithTooManyTransitiveDependencies" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithTooManyTransitiveDependencies", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Dependency issues", + "index": 93, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryThis", + "shortDescription": { + "text": "Unnecessary 'this' qualifier" + }, + "fullDescription": { + "text": "Reports unnecessary 'this' qualifier. Using 'this' to disambiguate a code reference is discouraged by many coding styles and may easily become unnecessary via automatic refactorings. Example: 'class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }' After the quick-fix is applied: 'class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }' Use the inspection settings to ignore assignments to fields. For instance, 'this.x = 2;' won't be reported, but 'int y = this.x;' will be. Inspection ID: UnnecessaryThis", + "markdown": "Reports unnecessary `this` qualifier.\n\n\nUsing `this` to disambiguate a code reference is discouraged by many coding styles\nand may easily become unnecessary\nvia automatic refactorings.\n\n**Example:**\n\n\n class Foo {\n int x;\n void foo() {\n this.x = 2;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int x;\n void foo() {\n x = 2;\n }\n }\n\n\nUse the inspection settings to ignore assignments to fields.\nFor instance, `this.x = 2;` won't be reported, but `int y = this.x;` will be.\n\n\nInspection ID: UnnecessaryThis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryThis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExplicitArrayFilling", + "shortDescription": { + "text": "Explicit array filling" + }, + "fullDescription": { + "text": "Reports loops that can be replaced with 'Arrays.setAll()' or 'Arrays.fill()' calls. This inspection suggests replacing loops with 'Arrays.setAll()' if the language level of the project or module is 8 or higher. Replacing loops with 'Arrays.fill()' is possible with any language level. Example: 'for (int i=0; i list, int from, int to) {\n for (int i = from; i < to; i++) {\n list.remove(from);\n }\n }' After the quick-fix is applied: 'void removeRange(List list, int from, int to) {\n if (to > from) {\n list.subList(from, to).clear();\n }\n }' The quick-fix adds a range check automatically to prevent a possible 'IndexOutOfBoundsException' when the minimal value is bigger than the maximal value. It can be removed if such a situation is impossible in your code. Inspection ID: ListRemoveInLoop New in 2018.2", + "markdown": "Reports `List.remove(index)` called in a loop that can be replaced with `List.subList().clear()`.\n\nThe replacement\nis more efficient for most `List` implementations when many elements are deleted.\n\nExample:\n\n\n void removeRange(List list, int from, int to) {\n for (int i = from; i < to; i++) {\n list.remove(from);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void removeRange(List list, int from, int to) {\n if (to > from) {\n list.subList(from, to).clear();\n }\n }\n\n\nThe quick-fix adds a range check automatically to prevent a possible `IndexOutOfBoundsException` when the minimal value is bigger\nthan the maximal value. It can be removed if such a situation is impossible in your code.\n\nInspection ID: ListRemoveInLoop\n\nNew in 2018.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ListRemoveInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceAssignmentWithOperatorAssignment", + "shortDescription": { + "text": "Assignment can be replaced with operator assignment" + }, + "fullDescription": { + "text": "Reports assignment operations which can be replaced by operator-assignment. Code using operator assignment is shorter and may be clearer. Example: 'x = x + 3;\n x = x / 3;' After the quick fix is applied: 'x += 3;\n x /= 3;' Use the Ignore conditional operators option to ignore '&&' and '||'. Replacing conditional operators with operator assignment would change the evaluation from lazy to eager, which may change the semantics of the expression. Use the Ignore obscure operators option to ignore '^' and '%', which are less known. Inspection ID: ReplaceAssignmentWithOperatorAssignment", + "markdown": "Reports assignment operations which can be replaced by operator-assignment.\n\nCode using operator assignment is shorter and may be clearer.\n\n**Example:**\n\n x = x + 3;\n x = x / 3;\n\nAfter the quick fix is applied:\n\n x += 3;\n x /= 3;\n\n\nUse the **Ignore conditional operators** option to ignore `&&`\nand `||`. Replacing conditional operators with operator\nassignment would change the evaluation from lazy to eager, which may change the semantics of the expression.\n\n\nUse the **Ignore obscure operators** option to ignore `^` and `%`, which are less known.\n\nInspection ID: ReplaceAssignmentWithOperatorAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "AssignmentReplaceableWithOperatorAssignment", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReturnFromFinallyBlock", + "shortDescription": { + "text": "'return' inside 'finally' block" + }, + "fullDescription": { + "text": "Reports 'return' statements inside of 'finally' blocks. While occasionally intended, such 'return' statements may mask thrown exceptions and complicate debugging. Example: 'try {\n foo();\n } finally {\n if (bar()) return;\n }' Inspection ID: ReturnFromFinallyBlock", + "markdown": "Reports `return` statements inside of `finally` blocks.\n\nWhile occasionally intended, such `return` statements may mask thrown exceptions\nand complicate debugging.\n\n**Example:**\n\n\n try {\n foo();\n } finally {\n if (bar()) return;\n }\n\nInspection ID: ReturnFromFinallyBlock" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ReturnInsideFinallyBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingOverrideAnnotation", + "shortDescription": { + "text": "Missing '@Override' annotation" + }, + "fullDescription": { + "text": "Reports methods overriding superclass methods but are not annotated with '@java.lang.Override'. Annotating methods with '@java.lang.Override' improves code readability since it shows the intent. In addition, the compiler emits an error when a signature of the overridden method doesn't match the superclass method. Example: 'class X {\n public String toString() {\n return \"hello world\";\n }\n }' After the quick-fix is applied: 'class X {\n @Override\n public String toString() {\n return \"hello world\";\n }\n }' Configure the inspection: Use the Ignore 'equals()', 'hashCode()' and 'toString()' option to ignore these 'java.lang.Object' methods: 'equals()', 'hashCode()', and 'toString()'. The risk that these methods will disappear and your code won't be compiling anymore due to the '@Override' annotation is relatively small. Use the Ignore methods in anonymous classes option to ignore methods in anonymous classes. Disable the Highlight method when its overriding methods do not all have the '@Override' annotation option to only warn on the methods missing an '@Override' annotation, and not on overridden methods where one or more descendants are missing an '@Override' annotation. This inspection depends on the Java feature 'Annotations', which is available since Java 5. Inspection ID: MissingOverrideAnnotation", + "markdown": "Reports methods overriding superclass methods but are not annotated with `@java.lang.Override`.\n\n\nAnnotating methods with `@java.lang.Override` improves code readability since it shows the intent.\nIn addition, the compiler emits an error when a signature of the overridden method doesn't match the superclass method.\n\n**Example:**\n\n\n class X {\n public String toString() {\n return \"hello world\";\n }\n }\n \nAfter the quick-fix is applied:\n\n\n class X {\n @Override\n public String toString() {\n return \"hello world\";\n }\n }\n \nConfigure the inspection:\n\n* Use the **Ignore 'equals()', 'hashCode()' and 'toString()'** option to ignore these `java.lang.Object` methods: `equals()`, `hashCode()`, and `toString()`. The risk that these methods will disappear and your code won't be compiling anymore due to the `@Override` annotation is relatively small.\n* Use the **Ignore methods in anonymous classes** option to ignore methods in anonymous classes.\n* Disable the **Highlight method when its overriding methods do not all have the '@Override' annotation** option to only warn on the methods missing an `@Override` annotation, and not on overridden methods where one or more descendants are missing an `@Override` annotation.\n\nThis inspection depends on the Java feature 'Annotations', which is available since Java 5.\n\nInspection ID: MissingOverrideAnnotation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "override", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantExplicitClose", + "shortDescription": { + "text": "Redundant 'close()'" + }, + "fullDescription": { + "text": "Reports unnecessary calls to 'close()' at the end of a try-with-resources block and suggests removing them. Example: 'try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n ac.close();\n }' After the quick-fix is applied: 'try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n }' Inspection ID: RedundantExplicitClose New in 2018.1", + "markdown": "Reports unnecessary calls to `close()` at the end of a try-with-resources block and suggests removing them.\n\n**Example**:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n ac.close();\n }\n\nAfter the quick-fix is applied:\n\n\n try(MyAutoCloseable ac = new MyAutoCloseable()) {\n foo();\n }\n\nInspection ID: RedundantExplicitClose\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantExplicitClose", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssertStatement", + "shortDescription": { + "text": "'assert' statement" + }, + "fullDescription": { + "text": "Reports 'assert' statements. By default, 'assert' statements are disabled during execution in the production environment. Consider using logger or exceptions instead. The 'assert' statements are not supported in Java 1.3 and earlier JVM. This inspection depends on the Java feature 'Assertions', which is available since Java 1.4. Inspection ID: AssertStatement", + "markdown": "Reports `assert` statements. By default, `assert` statements are disabled during execution in the production environment. Consider using logger or exceptions instead.\n\nThe `assert` statements are not supported in Java 1.3 and earlier JVM.\n\n\nThis inspection depends on the Java feature 'Assertions', which is available since Java 1.4.\n\nInspection ID: AssertStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssertStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level issues", + "index": 62, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CharUsedInArithmeticContext", + "shortDescription": { + "text": "'char' expression used in arithmetic context" + }, + "fullDescription": { + "text": "Reports expressions of the 'char' type used in addition or subtraction expressions. Such code is not necessarily an issue but may result in bugs (for example, if a string is expected). Example: 'int a = 'a' + 42;' After the quick-fix is applied: 'int a = (int) 'a' + 42;' For the 'String' context: 'int i1 = 1;\nint i2 = 2;\nSystem.out.println(i2 + '-' + i1 + \" = \" + (i2 - i1));' After the quick-fix is applied: 'System.out.println(i2 + \"-\" + i1 + \" = \" + (i2 - i1));' Inspection ID: CharUsedInArithmeticContext", + "markdown": "Reports expressions of the `char` type used in addition or subtraction expressions.\n\nSuch code is not necessarily an issue but may result in bugs (for example,\nif a string is expected).\n\n**Example:** `int a = 'a' + 42;`\n\nAfter the quick-fix is applied: `int a = (int) 'a' + 42;`\n\nFor the `String` context:\n\n int i1 = 1;\n int i2 = 2;\n System.out.println(i2 + '-' + i1 + \" = \" + (i2 - i1));\n\nAfter the quick-fix is applied:\n`System.out.println(i2 + \"-\" + i1 + \" = \" + (i2 - i1));`\n\nInspection ID: CharUsedInArithmeticContext" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CharUsedInArithmeticContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringEqualsCharSequence", + "shortDescription": { + "text": "'String.equals()' called with 'CharSequence' argument" + }, + "fullDescription": { + "text": "Reports calls to 'String.equals()' with a 'CharSequence' as the argument. 'String.equals()' can only return 'true' for 'String' arguments. To compare the contents of a 'String' with a non-'String' 'CharSequence' argument, use the 'contentEquals()' method. Example: 'boolean equals(String s, CharSequence ch) {\n return s.equals(ch);\n }' After quick-fix is applied: 'boolean equals(String s, CharSequence ch) {\n return s.contentEquals(ch);\n }' New in 2017.3 Inspection ID: StringEqualsCharSequence", + "markdown": "Reports calls to `String.equals()` with a `CharSequence` as the argument.\n\n\n`String.equals()` can only return `true` for `String` arguments.\nTo compare the contents of a `String` with a non-`String` `CharSequence` argument,\nuse the `contentEquals()` method.\n\n**Example:**\n\n\n boolean equals(String s, CharSequence ch) {\n return s.equals(ch);\n }\n\nAfter quick-fix is applied:\n\n\n boolean equals(String s, CharSequence ch) {\n return s.contentEquals(ch);\n }\n\n\nNew in 2017.3\n\nInspection ID: StringEqualsCharSequence" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringEqualsCharSequence", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessarySemicolon", + "shortDescription": { + "text": "Unnecessary semicolon" + }, + "fullDescription": { + "text": "Reports any unnecessary semicolons, including semicolons that are used between class members, inside block statements, or after class definitions. Even though these semicolons are valid in Java, they are redundant and may be removed. Example: 'class C {\n ;\n void m() throws Exception {\n try (AutoCloseable r1 = createAutoCloseable();) {\n ;\n }\n }\n ;\n }' After the quick-fix is applied: 'class C {\n void m() throws Exception {\n try (AutoCloseable r1 = createAutoCloseable()) {\n }\n }\n }' Inspection ID: UnnecessarySemicolon", + "markdown": "Reports any unnecessary semicolons, including semicolons that are used between class members, inside block statements, or after class definitions.\n\nEven though these semicolons are valid in Java, they are redundant and may be removed.\n\nExample:\n\n\n class C {\n ;\n void m() throws Exception {\n try (AutoCloseable r1 = createAutoCloseable();) {\n ;\n }\n }\n ;\n }\n\nAfter the quick-fix is applied:\n\n\n class C {\n void m() throws Exception {\n try (AutoCloseable r1 = createAutoCloseable()) {\n }\n }\n }\n\n\nInspection ID: UnnecessarySemicolon" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessarySemicolon", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TestFailedLine", + "shortDescription": { + "text": "Failed line in test" + }, + "fullDescription": { + "text": "Reports failed method calls or assertions in tests. It helps detect the failed line in code faster and start debugging it immediately. Example: '@Test\n fun foo() {\n assertEquals(1, 0) // highlighted\n }' Inspection ID: TestFailedLine", + "markdown": "Reports failed method calls or assertions in tests. It helps detect the failed line in code faster and start debugging it immediately.\n\n**Example:**\n\n\n @Test\n fun foo() {\n assertEquals(1, 0) // highlighted\n }\n\nInspection ID: TestFailedLine" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "TestFailedLine", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Test frameworks", + "index": 100, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicStaticCollectionField", + "shortDescription": { + "text": "'public static' collection field" + }, + "fullDescription": { + "text": "Reports modifiable 'public' 'static' Collection fields. Even though they are often used to store collections of constant values, these fields nonetheless represent a security hazard, as their contents may be modified even if the field is declared as 'final'. Example: 'public static final List EVENTS = new ArrayList<>();'\n Use the table in the Options section to specify methods returning unmodifiable collections. 'public' 'static' collection fields initialized with these methods will not be reported. Inspection ID: PublicStaticCollectionField", + "markdown": "Reports modifiable `public` `static` Collection fields.\n\nEven though they are often used to store collections of constant values, these fields nonetheless represent a security\nhazard, as their contents may be modified even if the field is declared as `final`.\n\n**Example:**\n\n\n public static final List EVENTS = new ArrayList<>();\n \n\nUse the table in the **Options** section to specify methods returning unmodifiable collections.\n`public` `static` collection fields initialized with these methods will not be reported.\n\nInspection ID: PublicStaticCollectionField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PublicStaticCollectionField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExtendsConcreteCollection", + "shortDescription": { + "text": "Class explicitly extends a 'Collection' class" + }, + "fullDescription": { + "text": "Reports classes that extend concrete subclasses of the 'java.util.Collection' or 'java.util.Map' classes. Subclassing concrete collection types is a common yet poor practice. It is considerably more brittle than delegating collection calls. Inspection ID: ExtendsConcreteCollection", + "markdown": "Reports classes that extend concrete subclasses of the `java.util.Collection` or `java.util.Map` classes.\n\n\nSubclassing concrete collection types is a common yet poor practice. It is considerably more brittle than delegating collection calls.\n\nInspection ID: ExtendsConcreteCollection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassExtendsConcreteCollection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavadocBlankLines", + "shortDescription": { + "text": "Blank line should be replaced with

to break lines" + }, + "fullDescription": { + "text": "Reports blank lines in Javadoc comments. Blank lines in Javadoc may signal an intention split the text to different paragraphs. However, the Javadoc tool and IntelliJ IDEA will ignore them when rendering documentation comments. The quick-fix suggests to replace the blank line with a paragraph tag (

). Example: 'class Main {\n /**\n * Doesn't do anything.\n *\n * Does absolutely nothing\n */\n void foo() {}\n }' After the quick-fix is applied: 'class Main {\n /**\n * Doesn't do anything.\n *

\n * Does absolutely nothing\n */\n void foo() {}\n }' Inspection ID: JavadocBlankLines New in 2022.1", + "markdown": "Reports blank lines in Javadoc comments.\n\n\nBlank lines in Javadoc may signal an intention split the text to different paragraphs. However, the Javadoc tool and IntelliJ IDEA will\nignore them when rendering documentation comments.\n\n\nThe quick-fix suggests to replace the blank line with a paragraph tag (\\).\n\n**Example:**\n\n\n class Main {\n /**\n * Doesn't do anything.\n *\n * Does absolutely nothing\n */\n void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n /**\n * Doesn't do anything.\n *

\n * Does absolutely nothing\n */\n void foo() {}\n }\n\nInspection ID: JavadocBlankLines\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JavadocBlankLines", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectInstantiationInEqualsHashCode", + "shortDescription": { + "text": "Object instantiation inside 'equals()' or 'hashCode()'" + }, + "fullDescription": { + "text": "Reports construction of (temporary) new objects inside 'equals()', 'hashCode()', 'compareTo()', and 'Comparator.compare()' methods. Besides constructor invocations, new objects can also be created by autoboxing or iterator creation inside a 'foreach' statement. This can cause performance problems, for example, when objects are added to a 'Set' or 'Map', where these methods will be called often. The inspection will not report when the objects are created in a 'throw' or 'assert' statement. Example: 'class Person {\n private String name;\n private int age;\n\n public boolean equals(Object o) {\n return Arrays.equals(new Object[] {name, age}, new Object[] {((Foo)o).name, ((Foo)o).age});\n }\n\n public int hashCode() {\n return (name + age).hashCode();\n }\n }' In this example, two additional arrays are created inside 'equals()', usages of 'age' field require boxing, and 'name + age' implicitly creates a new string. Inspection ID: ObjectInstantiationInEqualsHashCode", + "markdown": "Reports construction of (temporary) new objects inside `equals()`, `hashCode()`, `compareTo()`, and `Comparator.compare()` methods.\n\n\nBesides constructor invocations, new objects can also be created by autoboxing or iterator creation inside a\n`foreach` statement.\nThis can cause performance problems, for example, when objects are added to a `Set` or `Map`,\nwhere these methods will be called often.\n\n\nThe inspection will not report when the objects are created in a `throw` or `assert` statement.\n\n**Example:**\n\n\n class Person {\n private String name;\n private int age;\n\n public boolean equals(Object o) {\n return Arrays.equals(new Object[] {name, age}, new Object[] {((Foo)o).name, ((Foo)o).age});\n }\n\n public int hashCode() {\n return (name + age).hashCode();\n }\n }\n\n\nIn this example, two additional arrays are created inside `equals()`, usages of `age` field require boxing,\nand `name + age` implicitly creates a new string.\n\nInspection ID: ObjectInstantiationInEqualsHashCode" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ObjectInstantiationInEqualsHashCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeParameterExtendsFinalClass", + "shortDescription": { + "text": "Type parameter extends 'final' class" + }, + "fullDescription": { + "text": "Reports type parameters declared to extend a 'final' class. Suggests replacing the type parameter with the type of the specified 'final' class since 'final' classes cannot be extended. Example: 'void foo() {\n List list; // Warning: the Integer class is a final class\n }' After the quick-fix is applied: 'void foo() {\n List list;\n }' This inspection depends on the Java feature 'Generics', which is available since Java 5. Inspection ID: TypeParameterExtendsFinalClass", + "markdown": "Reports type parameters declared to extend a `final` class.\n\nSuggests replacing the type parameter with the type of the specified `final` class since\n`final` classes cannot be extended.\n\n**Example:**\n\n\n void foo() {\n List list; // Warning: the Integer class is a final class\n }\n\nAfter the quick-fix is applied:\n\n\n void foo() {\n List list;\n }\n\nThis inspection depends on the Java feature 'Generics', which is available since Java 5.\n\nInspection ID: TypeParameterExtendsFinalClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TypeParameterExtendsFinalClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UtilityClassWithPublicConstructor", + "shortDescription": { + "text": "Utility class with 'public' constructor" + }, + "fullDescription": { + "text": "Reports utility classes with 'public' constructors. Utility classes have all fields and methods declared as 'static'. Creating a 'public' constructor in such classes is confusing and may cause accidental class instantiation. Example: 'public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }' After the quick-fix is applied: 'public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }' Inspection ID: UtilityClassWithPublicConstructor", + "markdown": "Reports utility classes with `public` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating a `public`\nconstructor in such classes is confusing and may cause accidental class instantiation.\n\n**Example:**\n\n\n public final class UtilityClass {\n public UtilityClass(){\n }\n public static void foo() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public final class UtilityClass {\n private UtilityClass(){\n }\n public static void foo() {}\n }\n\nInspection ID: UtilityClassWithPublicConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UtilityClassWithPublicConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TrivialIf", + "shortDescription": { + "text": "Redundant 'if' statement" + }, + "fullDescription": { + "text": "Reports 'if' statements that can be simplified to a single assignment, 'return', or 'assert' statement. Example: 'if (foo()) {\n return true;\n } else {\n return false;\n }' After the quick-fix is applied: 'return foo();' Configure the inspection: Use the Ignore chained 'if' statements option if you want to hide a warning for chained 'if' statements. For example, in the following code the warning will be hidden, but the quick-fix will still be available: 'if (condition1) return true;\n if (condition2) return false;\n return true;' Note that replacing 'if (isTrue()) assert false;' with 'assert isTrue();' may change the program semantics when asserts are disabled if condition has side effects. Use the Ignore 'if' statements with trivial 'assert' option if you want to hide a warning for 'if' statements containing only 'assert' statement in their bodies. Inspection ID: TrivialIf", + "markdown": "Reports `if` statements that can be simplified to a single assignment, `return`, or `assert` statement.\n\nExample:\n\n\n if (foo()) {\n return true;\n } else {\n return false;\n }\n\nAfter the quick-fix is applied:\n\n\n return foo();\n\nConfigure the inspection:\n\nUse the **Ignore chained 'if' statements** option if you want to hide a warning for chained `if` statements.\n\nFor example, in the following code the warning will be hidden, but the quick-fix will still be available:\n\n\n if (condition1) return true;\n if (condition2) return false;\n return true;\n\nNote that replacing `if (isTrue()) assert false;` with `assert isTrue();` may change the program semantics\nwhen asserts are disabled if condition has side effects.\nUse the **Ignore 'if' statements with trivial 'assert'** option if you want to hide a warning for `if` statements\ncontaining only `assert` statement in their bodies.\n\nInspection ID: TrivialIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantIfStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnconditionalWait", + "shortDescription": { + "text": "Unconditional 'wait()' call" + }, + "fullDescription": { + "text": "Reports 'wait()' being called unconditionally within a synchronized context. Normally, 'wait()' is used to block a thread until some condition is true. If 'wait()' is called unconditionally, it often indicates that the condition was checked before a lock was acquired. In that case a data race may occur, with the condition becoming true between the time it was checked and the time the lock was acquired. While constructs found by this inspection are not necessarily incorrect, they are certainly worth examining. Example: 'class Bar {\n void foo() throws InterruptedException {\n synchronized (this) {\n wait(); // warning\n }\n }\n }' Inspection ID: UnconditionalWait", + "markdown": "Reports `wait()` being called unconditionally within a synchronized context.\n\n\nNormally, `wait()` is used to block a thread until some condition is true. If\n`wait()` is called unconditionally, it often indicates that the condition was\nchecked before a lock was acquired. In that case a data race may occur, with the condition\nbecoming true between the time it was checked and the time the lock was acquired.\n\n\nWhile constructs found by this inspection are not necessarily incorrect, they are certainly worth examining.\n\n**Example:**\n\n\n class Bar {\n void foo() throws InterruptedException {\n synchronized (this) {\n wait(); // warning\n }\n }\n }\n\nInspection ID: UnconditionalWait" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnconditionalWait", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BooleanMethodIsAlwaysInverted", + "shortDescription": { + "text": "Boolean method is always inverted" + }, + "fullDescription": { + "text": "Reports methods with a 'boolean' return type that are always negated when called. A quick-fix is provided to invert and optionally rename the method. For performance reasons, not all problematic methods may be highlighted in the editor. Example: 'class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }' After the quick-fix is applied: 'class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }' Inspection ID: BooleanMethodIsAlwaysInverted", + "markdown": "Reports methods with a `boolean` return type that are always negated when called.\n\nA quick-fix is provided to invert and optionally rename the method.\nFor performance reasons, not all problematic methods may be highlighted in the editor.\n\nExample:\n\n\n class C {\n boolean alwaysTrue() {\n return true;\n }\n\n void f() {\n if (!alwaysTrue()) {\n return;\n }\n }\n boolean member = !alwaysTrue();\n }\n\nAfter the quick-fix is applied:\n\n\n class C {\n boolean alwaysFalse() {\n return false;\n }\n\n void f() {\n if (alwaysFalse()) {\n return;\n }\n }\n boolean member = alwaysFalse();\n }\n\nInspection ID: BooleanMethodIsAlwaysInverted" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BooleanMethodIsAlwaysInverted", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Data flow", + "index": 22, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InstanceGuardedByStatic", + "shortDescription": { + "text": "Instance member guarded by static field" + }, + "fullDescription": { + "text": "Reports '@GuardedBy' annotations on instance fields or methods in which the guard is a 'static' field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance. Example: 'private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy' Inspection ID: InstanceGuardedByStatic", + "markdown": "Reports `@GuardedBy` annotations on instance fields or methods in which the guard is a `static` field. Guarding a non-static by a static may result in excessive lock contention, as access to each locked field in any object instance will prevent simultaneous access to that field in every object instance.\n\nExample:\n\n\n private static ReadWriteLock lock = new ReentrantReadWriteLock(); //static guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`\n\nInspection ID: InstanceGuardedByStatic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InstanceGuardedByStatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Concurrency annotation issues", + "index": 60, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AutoCloseableResource", + "shortDescription": { + "text": "AutoCloseable used without 'try'-with-resources" + }, + "fullDescription": { + "text": "Reports 'AutoCloseable' instances which are not used in a try-with-resources statement, also known as Automatic Resource Management. This means that the \"open resource before/in 'try', close in 'finally'\" style that had been used before try-with-resources became available, is also reported. This inspection is meant to replace all opened but not safely closed inspections when developing in Java 7 and higher. Example: 'private static void foo() throws IOException {\n InputStream profile = Thread.currentThread().getContextClassLoader().getResourceAsStream(\"/someFile\");\n System.out.println(profile.read());\n }' Use the following options to configure the inspection: List subclasses of 'AutoCloseable' that do not need to be closed and should be ignored by this inspection. Note: The inspection will still report streams returned from the 'java.nio.file.Files' methods 'lines()', 'walk()', 'list()' and 'find()', even when 'java.util.stream.Stream' is listed to be ignored. These streams contain an associated I/O resource that needs to be closed. List methods returning 'AutoCloseable' that should be ignored when called. Whether to ignore an 'AutoCloseable' if it is the result of a method call. When this option is enabled, the results of factory methods will also be ignored. Whether the inspection should report if an 'AutoCloseable' instance is passed as a method call argument. If this option is enabled, the inspection assumes the resource is closed in the called method. Method calls inside a 'finally' block with 'close' in the name and an 'AutoCloseable' argument will not be ignored. Whether to ignore method references to constructors of resource classes. Whether to ignore methods that return a resource and whose name starts with 'get'. This can reduce false positives because most of the getters do not transfer the ownership of the resource, and their call sites are not responsible for closing the resource. This inspection depends on the Java feature 'Try-with-resources', which is available since Java 7. Inspection ID: AutoCloseableResource", + "markdown": "Reports `AutoCloseable` instances which are not used in a try-with-resources statement, also known as *Automatic Resource Management* .\n\n\nThis means that the \"open resource before/in `try`, close in `finally`\" style that had been used before\ntry-with-resources became available, is also reported.\nThis inspection is meant to replace all *opened but not safely closed* inspections when developing in Java 7 and higher.\n\n**Example:**\n\n\n private static void foo() throws IOException {\n InputStream profile = Thread.currentThread().getContextClassLoader().getResourceAsStream(\"/someFile\");\n System.out.println(profile.read());\n }\n\n\nUse the following options to configure the inspection:\n\n* List subclasses of `AutoCloseable` that do not need to be closed and should be ignored by this inspection. \n **Note** : The inspection will still report streams returned from the `java.nio.file.Files` methods `lines()`, `walk()`, `list()` and `find()`, even when `java.util.stream.Stream` is listed to be ignored. These streams contain an associated I/O resource that needs to be closed.\n* List methods returning `AutoCloseable` that should be ignored when called.\n* Whether to ignore an `AutoCloseable` if it is the result of a method call. When this option is enabled, the results of factory methods will also be ignored.\n* Whether the inspection should report if an `AutoCloseable` instance is passed as a method call argument. If this option is enabled, the inspection assumes the resource is closed in the called method. Method calls inside a `finally` block with 'close' in the name and an `AutoCloseable` argument will not be ignored.\n* Whether to ignore method references to constructors of resource classes.\n* Whether to ignore methods that return a resource and whose name starts with 'get'. This can reduce false positives because most of the getters do not transfer the ownership of the resource, and their call sites are not responsible for closing the resource.\n\nThis inspection depends on the Java feature 'Try-with-resources', which is available since Java 7.\n\nInspection ID: AutoCloseableResource" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "resource", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Resource management", + "index": 47, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodOverridesInaccessibleMethodOfSuper", + "shortDescription": { + "text": "Method overrides inaccessible method of superclass" + }, + "fullDescription": { + "text": "Reports methods with the same signature as an inaccessible method of a superclass, for example, a private method, or a package-private method of a superclass in another package. Such method names may be confusing because the method in the subclass may look like an override when in fact it hides the inaccessible method of the superclass. Moreover, if the visibility of the method in the superclass changes later, it may either silently change the semantics of the subclass or cause a compilation error. A quick-fix is suggested to rename the method. Example: 'public class Super {\n private void test() {\n }\n }\n\n public class Sub extends Super {\n void test() { // making 'Super.test()' public causes a compilation error\n // making 'Super.test()' package-private makes 'Sub.test()' an override\n }\n }' Inspection ID: MethodOverridesInaccessibleMethodOfSuper", + "markdown": "Reports methods with the same signature as an inaccessible method of a superclass, for example, a private method, or a package-private method of a superclass in another package.\n\n\nSuch method names may be confusing because the method in the subclass may look like an override when in fact\nit hides the inaccessible method of the superclass.\nMoreover, if the visibility of the method in the superclass changes later,\nit may either silently change the semantics of the subclass or cause a compilation error.\n\nA quick-fix is suggested to rename the method.\n\n**Example:**\n\n\n public class Super {\n private void test() {\n }\n }\n\n public class Sub extends Super {\n void test() { // making 'Super.test()' public causes a compilation error\n // making 'Super.test()' package-private makes 'Sub.test()' an override\n }\n }\n\n\nInspection ID: MethodOverridesInaccessibleMethodOfSuper" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodOverridesInaccessibleMethodOfSuper", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IntLiteralMayBeLongLiteral", + "shortDescription": { + "text": "Cast to 'long' can be 'long' literal" + }, + "fullDescription": { + "text": "Reports 'int' literal expressions that are immediately cast to 'long'. Such literal expressions can be replaced with equivalent 'long' literals. Example: 'Long l = (long)42;' After the quick-fix is applied: 'Long l = 42L;' Inspection ID: IntLiteralMayBeLongLiteral", + "markdown": "Reports `int` literal expressions that are immediately cast to `long`.\n\nSuch literal expressions can be replaced with equivalent `long` literals.\n\n**Example:**\n\n Long l = (long)42;\n\nAfter the quick-fix is applied:\n\n Long l = 42L;\n\nInspection ID: IntLiteralMayBeLongLiteral" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IntLiteralMayBeLongLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues/Cast", + "index": 108, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SingleStatementInBlock", + "shortDescription": { + "text": "Code block contains single statement" + }, + "fullDescription": { + "text": "Reports control flow statements with a single statement in their code block and suggests removing the braces from the control flow statement body. Example: 'if (x > 0) {\n System.out.println(\"x is positive\");\n }' After the quick-fix is applied: 'if (x > 0) System.out.println(\"x is positive\");' Inspection ID: SingleStatementInBlock", + "markdown": "Reports control flow statements with a single statement in their code block and suggests removing the braces from the control flow statement body.\n\nExample:\n\n\n if (x > 0) {\n System.out.println(\"x is positive\");\n }\n\nAfter the quick-fix is applied:\n\n\n if (x > 0) System.out.println(\"x is positive\");\n\nInspection ID: SingleStatementInBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SingleStatementInBlock", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TestCaseWithConstructor", + "shortDescription": { + "text": "TestCase with non-trivial constructors" + }, + "fullDescription": { + "text": "Reports test cases with initialization logic in their constructors. If a constructor fails, the '@After' annotated or 'tearDown()' method won't be called. This can leave the test environment partially initialized, which can adversely affect other tests. Instead, initialization of test cases should be done in a 'setUp()' or '@Before' annotated method. Bad example: 'public class ImportantTest {\n private File file;\n\n public ImportantTest() throws IOException {\n file = File.createTempFile(\"xyz\", \".tmp\");\n }\n\n // ... tests go here\n }' Inspection ID: TestCaseWithConstructor", + "markdown": "Reports test cases with initialization logic in their constructors. If a constructor fails, the `@After` annotated or `tearDown()` method won't be called. This can leave the test environment partially initialized, which can adversely affect other tests. Instead, initialization of test cases should be done in a `setUp()` or `@Before` annotated method.\n\nBad example:\n\n\n public class ImportantTest {\n private File file;\n\n public ImportantTest() throws IOException {\n file = File.createTempFile(\"xyz\", \".tmp\");\n }\n\n // ... tests go here\n }\n\nInspection ID: TestCaseWithConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JUnitTestCaseWithNonTrivialConstructors", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Test frameworks", + "index": 100, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SingleCharacterStartsWith", + "shortDescription": { + "text": "Single character 'startsWith()' or 'endsWith()'" + }, + "fullDescription": { + "text": "Reports calls to 'String.startsWith()' and 'String.endsWith()' where single character string literals are passed as an argument. A quick-fix is suggested to replace such calls with more efficiently implemented 'String.charAt()'. However, the performance gain of such change is minimal and the code becomes less readable because of the extra non-zero length check, so it is recommended to apply the quick-fix only inside tight loops. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'boolean startsWithX(String s) {\n return s.startsWith(\"x\");\n }' After the quick-fix is applied: 'boolean startsWithX(String s) {\n return !s.isEmpty() && s.charAt(0) == 'x';\n }' Inspection ID: SingleCharacterStartsWith", + "markdown": "Reports calls to `String.startsWith()` and `String.endsWith()` where single character string literals are passed as an argument.\n\n\nA quick-fix is suggested to replace such calls with more efficiently implemented `String.charAt()`.\n\n\nHowever, the performance gain of such change is minimal and the code becomes less readable because of the extra non-zero length check,\nso it is recommended to apply the quick-fix only inside tight loops.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n boolean startsWithX(String s) {\n return s.startsWith(\"x\");\n }\n\nAfter the quick-fix is applied:\n\n\n boolean startsWithX(String s) {\n return !s.isEmpty() && s.charAt(0) == 'x';\n }\n\nInspection ID: SingleCharacterStartsWith" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SingleCharacterStartsWith", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UtilityClassCanBeEnum", + "shortDescription": { + "text": "Utility class can be 'enum'" + }, + "fullDescription": { + "text": "Reports utility classes that can be converted to enums. Some coding style guidelines require implementing utility classes as enums to avoid code coverage issues in 'private' constructors. Example: 'class StringUtils {\n public static final String EMPTY = \"\";\n }' After the quick-fix is applied: 'enum StringUtils {\n ;\n public static final String EMPTY = \"\";\n }' This inspection depends on the Java feature 'Enums', which is available since Java 5. Inspection ID: UtilityClassCanBeEnum", + "markdown": "Reports utility classes that can be converted to enums.\n\nSome coding style guidelines require implementing utility classes as enums\nto avoid code coverage issues in `private` constructors.\n\n**Example:**\n\n\n class StringUtils {\n public static final String EMPTY = \"\";\n }\n\nAfter the quick-fix is applied:\n\n\n enum StringUtils {\n ;\n public static final String EMPTY = \"\";\n }\n\nThis inspection depends on the Java feature 'Enums', which is available since Java 5.\n\nInspection ID: UtilityClassCanBeEnum" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UtilityClassCanBeEnum", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReadObjectAndWriteObjectPrivate", + "shortDescription": { + "text": "'readObject()' or 'writeObject()' not declared 'private'" + }, + "fullDescription": { + "text": "Reports 'Serializable' classes where the 'readObject' or 'writeObject' methods are not declared private. There is no reason these methods should ever have a higher visibility than 'private'. A quick-fix is suggested to make the corresponding method 'private'. Example: 'public class Test implements Serializable {\n public void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }' After the quick-fix is applied: 'public class Test implements Serializable {\n private void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }' Inspection ID: ReadObjectAndWriteObjectPrivate", + "markdown": "Reports `Serializable` classes where the `readObject` or `writeObject` methods are not declared private. There is no reason these methods should ever have a higher visibility than `private`.\n\n\nA quick-fix is suggested to make the corresponding method `private`.\n\n**Example:**\n\n\n public class Test implements Serializable {\n public void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Test implements Serializable {\n private void readObject(ObjectInputStream stream) {\n /* ... */\n }\n }\n\nInspection ID: ReadObjectAndWriteObjectPrivate" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonPrivateSerializationMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExtendsObject", + "shortDescription": { + "text": "Class explicitly extends 'Object'" + }, + "fullDescription": { + "text": "Reports any classes that are explicitly declared to extend 'java.lang.Object'. Such declaration is redundant and can be safely removed. Example: 'class MyClass extends Object {\n }' The quick-fix removes the redundant 'extends Object' clause: 'class MyClass {\n }' Inspection ID: ExtendsObject", + "markdown": "Reports any classes that are explicitly declared to extend `java.lang.Object`.\n\nSuch declaration is redundant and can be safely removed.\n\nExample:\n\n\n class MyClass extends Object {\n }\n\nThe quick-fix removes the redundant `extends Object` clause:\n\n\n class MyClass {\n }\n\nInspection ID: ExtendsObject" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassExplicitlyExtendsObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantFileCreation", + "shortDescription": { + "text": "Redundant 'File' instance creation" + }, + "fullDescription": { + "text": "Reports redundant 'File' creation in one of the following constructors when only 'String' path can be used: 'FileInputStream', 'FileOutputStream', 'FileReader', 'FileWriter', 'PrintStream', 'PrintWriter', 'Formatter'. Example: 'InputStream is = new FileInputStream(new File(\"in.txt\"));' After quick-fix is applied: 'InputStream is = new FileInputStream(\"in.txt\");' Inspection ID: RedundantFileCreation New in 2020.3", + "markdown": "Reports redundant `File` creation in one of the following constructors when only `String` path can be used: `FileInputStream`, `FileOutputStream`, `FileReader`, `FileWriter`, `PrintStream`, `PrintWriter`, `Formatter`.\n\nExample:\n\n\n InputStream is = new FileInputStream(new File(\"in.txt\"));\n\nAfter quick-fix is applied:\n\n\n InputStream is = new FileInputStream(\"in.txt\");\n\nInspection ID: RedundantFileCreation\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantFileCreation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PointlessBooleanExpression", + "shortDescription": { + "text": "Pointless boolean expression" + }, + "fullDescription": { + "text": "Reports unnecessary or overly complicated boolean expressions. Such expressions include '&&'-ing with 'true', '||'-ing with 'false', equality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified. Example: 'boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;' After the quick-fix is applied: 'boolean a = true;\n boolean b = x;\n boolean c = !x;' Configure the inspection: Use the Ignore named constants in determining pointless expressions option to ignore named constants when determining if an expression is pointless. Inspection ID: PointlessBooleanExpression", + "markdown": "Reports unnecessary or overly complicated boolean expressions.\n\nSuch expressions include `&&`-ing with `true`,\n`||`-ing with `false`,\nequality comparison with a boolean literal, or negation of a boolean literal. Such expressions can be simplified.\n\nExample:\n\n\n boolean a = !(x && false);\n boolean b = false || x;\n boolean c = x != true;\n\nAfter the quick-fix is applied:\n\n\n boolean a = true;\n boolean b = x;\n boolean c = !x;\n\n\nConfigure the inspection:\nUse the **Ignore named constants in determining pointless expressions** option to ignore named constants when determining if an expression is pointless.\n\n\nInspection ID: PointlessBooleanExpression" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PointlessBooleanExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReassignedVariable", + "shortDescription": { + "text": "Reassigned variable" + }, + "fullDescription": { + "text": "Reports reassigned variables, which complicate reading and understanding the code. Example: 'int value = 2 * (height + width);\n System.out.println(\"perimeter: \" + value);\n\n value = height * width;\n System.out.println(\"area: \" + value);' Inspection ID: ReassignedVariable", + "markdown": "Reports reassigned variables, which complicate reading and understanding the code.\n\nExample:\n\n\n int value = 2 * (height + width);\n System.out.println(\"perimeter: \" + value);\n\n value = height * width;\n System.out.println(\"area: \" + value);\n\nInspection ID: ReassignedVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReassignedVariable", + "ideaSeverity": "TEXT ATTRIBUTES", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ListenerMayUseAdapter", + "shortDescription": { + "text": "Class may extend adapter instead of implementing listener" + }, + "fullDescription": { + "text": "Reports classes implementing listeners instead of extending corresponding adapters. A quick-fix is available to remove any redundant empty methods left after replacing a listener implementation with an adapter extension. Use the Only warn when empty implementing methods are found option to configure the inspection to warn even if no empty methods are found. Inspection ID: ListenerMayUseAdapter", + "markdown": "Reports classes implementing listeners instead of extending corresponding adapters.\n\nA quick-fix is available to\nremove any redundant empty methods left after replacing a listener implementation with an adapter extension.\n\n\nUse the **Only warn when empty implementing methods are found** option to configure the inspection to warn even if no empty methods are found.\n\nInspection ID: ListenerMayUseAdapter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ListenerMayUseAdapter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodNameSameAsClassName", + "shortDescription": { + "text": "Method name same as class name" + }, + "fullDescription": { + "text": "Reports methods that are named identically to their class. While such naming is allowed by the Java language, by convention it is reserved for defining constructors. Using it for methods is probably a mistake or bad practice. Example: 'class MyClass {\n int val;\n\n // Method MyClass named identically to its containing class.\n // Likely, 'void' was added by mistake.\n void MyClass(int val) {\n this.val = val;\n }\n }' When appropriate, a quick-fix converts the method to a constructor: 'class MyClass {\n int val;\n\n MyClass(int val) {\n this.val = val;\n }\n }' Another quick-fix renames the method. Inspection ID: MethodNameSameAsClassName", + "markdown": "Reports methods that are named identically to their class. While such naming is allowed by the Java language, by convention it is reserved for defining constructors. Using it for methods is probably a mistake or bad practice.\n\n**Example:**\n\n\n class MyClass {\n int val;\n\n // Method MyClass named identically to its containing class.\n // Likely, 'void' was added by mistake.\n void MyClass(int val) {\n this.val = val;\n }\n }\n\nWhen appropriate, a quick-fix converts the method to a constructor:\n\n\n class MyClass {\n int val;\n\n MyClass(int val) {\n this.val = val;\n }\n }\n\nAnother quick-fix renames the method.\n\nInspection ID: MethodNameSameAsClassName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodNameSameAsClassName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Method", + "index": 91, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExpressionComparedToItself", + "shortDescription": { + "text": "Expression is compared to itself" + }, + "fullDescription": { + "text": "Reports comparisons where left and right operand represent the identical expression. While sometimes comparing an expression with itself could be intended, in most cases, it is an oversight. Example: '// Probably left.getLength() == right.getLength() was intended\n boolean result = left.getLength() == left.getLength();' To ignore comparisons that may produce side effects, use the Ignore conditions with side effects option. Disabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations. Example: 'native int unknownMethod();\n \n ...\n \n if (unknownMethod() > unknownMethod()) {\n System.out.println(\"Got it\");\n }' Due to possible side effects of 'unknownMethod()' (on the example), the warning will only be triggered if the Ignore conditions with side effects option is disabled. Inspection ID: ExpressionComparedToItself New in 2024.2", + "markdown": "Reports comparisons where left and right operand represent the identical expression. While sometimes comparing an expression with itself could be intended, in most cases, it is an oversight.\n\nExample:\n\n\n // Probably left.getLength() == right.getLength() was intended\n boolean result = left.getLength() == left.getLength();\n\n\nTo ignore comparisons that may produce side effects, use the **Ignore conditions with side effects** option.\nDisabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations.\n\nExample:\n\n\n native int unknownMethod();\n \n ...\n \n if (unknownMethod() > unknownMethod()) {\n System.out.println(\"Got it\");\n }\n\nDue to possible side effects of `unknownMethod()` (on the example), the warning will only be\ntriggered if the **Ignore conditions with side effects** option is disabled.\n\nInspection ID: ExpressionComparedToItself\n\nNew in 2024.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ExpressionComparedToItself", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LocalVariableNamingConvention", + "shortDescription": { + "text": "Local variable naming convention" + }, + "fullDescription": { + "text": "Reports local variables whose names are too short, too long, or do not follow the specified regular expression pattern. Example: 'int X = 42;' should be reported if the inspection is enabled with the default settings in which a variable name should start with a lowercase letter. Configure the inspection: Use the fields in the Options section to specify the minimum length, maximum length, and a regular expression expected for local variable names. Specify 0 in order not to check the length of names. Regular expressions should be specified in the standard java.util.regex format. Use checkboxes to ignore 'for'-loop and 'catch' section parameters. Inspection ID: LocalVariableNamingConvention", + "markdown": "Reports local variables whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** `int X = 42;`\nshould be reported if the inspection is enabled with the default settings in which a variable name should start with a lowercase letter.\n\nConfigure the inspection:\n\n\nUse the fields in the **Options** section to specify the minimum length, maximum length, and a regular expression expected for local variable names.\nSpecify **0** in order not to check the length of names. Regular expressions should be specified in the standard **java.util.regex** format.\n\nUse checkboxes to ignore `for`-loop and `catch` section parameters.\n\nInspection ID: LocalVariableNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LocalVariableNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryJavaDocLink", + "shortDescription": { + "text": "Unnecessary Javadoc link" + }, + "fullDescription": { + "text": "Reports Javadoc '@see', '{@link}', and '{@linkplain}' tags that refer to the method owning the comment, the super method of the method owning the comment, or the class containing the comment. Such links are unnecessary and can be safely removed with this inspection's quick-fix. The quick-fix will remove the entire Javadoc comment if the tag is its only content. Example: 'class Example {\n /**\n * @see Example#method\n */\n public void method() { }\n }' After the quick-fix is applied: 'class Example {\n public void method() { }\n}' Use the checkbox below to ignore inline links ('{@link}' and '{@linkplain}') to super methods. Although a link to all super methods is automatically added by the Javadoc tool, an inline link to the super method may sometimes be needed in texts of the Javadoc comments. Inspection ID: UnnecessaryJavaDocLink", + "markdown": "Reports Javadoc `@see`, `{@link}`, and `{@linkplain}` tags that refer to the method owning the comment, the super method of the method owning the comment, or the class containing the comment.\n\nSuch links are unnecessary and can be safely removed with this inspection's quick-fix. The\nquick-fix will remove the entire Javadoc comment if the tag is its only content.\n\n**Example:**\n\n\n class Example {\n /**\n * @see Example#method\n */\n public void method() { }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n public void method() { }\n }\n\n\nUse the checkbox below to ignore inline links (`{@link}` and `{@linkplain}`)\nto super methods. Although a link to all super methods is automatically added by the\nJavadoc tool, an inline link to the super method may sometimes be needed in texts of the Javadoc comments.\n\nInspection ID: UnnecessaryJavaDocLink" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryJavaDocLink", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyTryBlock", + "shortDescription": { + "text": "Empty 'try' block" + }, + "fullDescription": { + "text": "Reports empty 'try' blocks, including try-with-resources statements. 'try' blocks with comments are considered empty. This inspection doesn't report empty 'try' blocks found in JSP files. Inspection ID: EmptyTryBlock", + "markdown": "Reports empty `try` blocks, including try-with-resources statements.\n\n`try` blocks with comments are considered empty.\n\n\nThis inspection doesn't report empty `try` blocks found in JSP files.\n\nInspection ID: EmptyTryBlock" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyTryBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedSwitchStatement", + "shortDescription": { + "text": "Nested 'switch' statement" + }, + "fullDescription": { + "text": "Reports nested 'switch' statements or expressions. Nested 'switch' statements may result in extremely confusing code. These statements may be extracted to a separate method. Example: 'int res = switch (i) {\n case 0 -> 0;\n default -> switch (i) {\n case 100 -> 0;\n default -> i;\n };\n };' Inspection ID: NestedSwitchStatement", + "markdown": "Reports nested `switch` statements or expressions.\n\nNested `switch` statements\nmay result in extremely confusing code. These statements may be extracted to a separate method.\n\nExample:\n\n\n int res = switch (i) {\n case 0 -> 0;\n default -> switch (i) {\n case 100 -> 0;\n default -> i;\n };\n };\n\n\nInspection ID: NestedSwitchStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedSwitchStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CollectionsFieldAccessReplaceableByMethodCall", + "shortDescription": { + "text": "Reference to empty collection field can be replaced with method call" + }, + "fullDescription": { + "text": "Reports usages of 'java.util.Collections' fields: 'EMPTY_LIST', 'EMPTY_MAP' or 'EMPTY_SET'. These field usages may be replaced with the following method calls: 'emptyList()', 'emptyMap()', or 'emptySet()'. Such method calls prevent unchecked warnings by the compiler because the type parameters can be inferred. Example: 'List emptyList = Collections.EMPTY_LIST;' After the quick-fix is applied: 'List emptyList = Collections.emptyList();' This inspection only reports if the language level of the project or module is 5 or higher. Inspection ID: CollectionsFieldAccessReplaceableByMethodCall", + "markdown": "Reports usages of `java.util.Collections` fields: `EMPTY_LIST`, `EMPTY_MAP` or `EMPTY_SET`. These field usages may be replaced with the following method calls: `emptyList()`, `emptyMap()`, or `emptySet()`. Such method calls prevent unchecked warnings by the compiler because the type parameters can be inferred.\n\n**Example:**\n\n\n List emptyList = Collections.EMPTY_LIST;\n\nAfter the quick-fix is applied:\n\n\n List emptyList = Collections.emptyList();\n\nThis inspection only reports if the language level of the project or module is 5 or higher.\n\n\nInspection ID: CollectionsFieldAccessReplaceableByMethodCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CollectionsFieldAccessReplaceableByMethodCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssertWithSideEffects", + "shortDescription": { + "text": "'assert' statement with side effects" + }, + "fullDescription": { + "text": "Reports 'assert' statements that cause side effects. Since assertions can be switched off, these side effects are not guaranteed, which can cause subtle bugs. Common unwanted side effects detected by this inspection are modifications of variables and fields. When methods calls are involved, they are analyzed one level deep. Example: 'assert i++ < 10;' This inspection depends on the Java feature 'Assertions', which is available since Java 1.4. Inspection ID: AssertWithSideEffects", + "markdown": "Reports `assert` statements that cause side effects.\n\n\nSince assertions can be switched off,\nthese side effects are not guaranteed, which can cause subtle bugs. Common unwanted side effects detected by this inspection are\nmodifications of variables and fields. When methods calls are involved, they are analyzed one level deep.\n\n**Example:**\n\n\n assert i++ < 10;\n\nThis inspection depends on the Java feature 'Assertions', which is available since Java 1.4.\n\nInspection ID: AssertWithSideEffects" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AssertWithSideEffects", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WaitOrAwaitWithoutTimeout", + "shortDescription": { + "text": "'wait()' or 'await()' without timeout" + }, + "fullDescription": { + "text": "Reports calls to 'Object.wait()' or 'Condition.await()' without specifying a timeout. Such calls may be dangerous in high-availability programs, as failures in one component may result in blockages of the waiting component if 'notify()'/'notifyAll()' or 'signal()'/'signalAll()' never get called. Example: 'void foo(Object bar) throws InterruptedException {\n bar.wait();\n }' Inspection ID: WaitOrAwaitWithoutTimeout", + "markdown": "Reports calls to `Object.wait()` or `Condition.await()` without specifying a timeout.\n\n\nSuch calls may be dangerous in high-availability programs, as failures in one\ncomponent may result in blockages of the waiting component\nif `notify()`/`notifyAll()`\nor `signal()`/`signalAll()` never get called.\n\n**Example:**\n\n\n void foo(Object bar) throws InterruptedException {\n bar.wait();\n }\n\nInspection ID: WaitOrAwaitWithoutTimeout" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WaitOrAwaitWithoutTimeout", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RefusedBequest", + "shortDescription": { + "text": "Method does not call super method" + }, + "fullDescription": { + "text": "Reports methods that override a super method without calling it. This is also known as a refused bequest. Such methods may represent a failure of abstraction and cause hard-to-trace bugs. The inspection doesn't report methods overridden from 'java.lang.Object', except for 'clone()'. The 'clone()' method should by convention call its super method, which will return an object of the correct type. Example 1: 'class A {\n @Override\n public Object clone() {\n // does not call 'super.clone()'\n return new A();\n }\n }' Example 2: 'interface I {\n default void foo() {}\n }\n\n class A implements I {\n // warning on method when\n // 'Ignore 'default' super methods' is disabled\n @Override\n public void foo(){}\n }' Configure the inspection: Use the Only report when super method is annotated by option to ignore super methods marked with the annotations from the provided list. You can manually add annotations to the list. Use the Ignore empty super methods option to ignore super methods that are either empty or only throw an exception. Use the Ignore 'default' super methods option to ignore 'default' super methods from interfaces. Inspection ID: RefusedBequest", + "markdown": "Reports methods that override a super method without calling it. This is also known as a *refused bequest* . Such methods may represent a failure of abstraction and cause hard-to-trace bugs.\n\n\nThe inspection doesn't report methods overridden from `java.lang.Object`, except for `clone()`.\nThe `clone()` method should by convention call its super method,\nwhich will return an object of the correct type.\n\n**Example 1:**\n\n\n class A {\n @Override\n public Object clone() {\n // does not call 'super.clone()'\n return new A();\n }\n }\n\n**Example 2:**\n\n\n interface I {\n default void foo() {}\n }\n\n class A implements I {\n // warning on method when\n // 'Ignore 'default' super methods' is disabled\n @Override\n public void foo(){}\n }\n\nConfigure the inspection:\n\n* Use the **Only report when super method is annotated by** option to ignore super methods marked with the annotations from the provided list. You can manually add annotations to the list.\n* Use the **Ignore empty super methods** option to ignore super methods that are either empty or only throw an exception.\n* Use the **Ignore 'default' super methods** option to ignore `default` super methods from interfaces.\n\nInspection ID: RefusedBequest" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MethodDoesntCallSuperMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FinalClass", + "shortDescription": { + "text": "Class is closed to inheritance" + }, + "fullDescription": { + "text": "Reports classes that are declared 'final'. Final classes that extend a 'sealed' class or interface are not reported. Such classes can't be inherited and may indicate a lack of object-oriented design. Some coding standards discourage 'final' classes. Example: 'public final class Main {\n }' After the quick-fix is applied: 'public class Main {\n }' Inspection ID: FinalClass", + "markdown": "Reports classes that are declared `final`. Final classes that extend a `sealed` class or interface are not reported. Such classes can't be inherited and may indicate a lack of object-oriented design. Some coding standards discourage `final` classes.\n\n**Example:**\n\n\n public final class Main {\n }\n\nAfter the quick-fix is applied:\n\n\n public class Main {\n }\n\nInspection ID: FinalClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FinalClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LiteralAsArgToStringEquals", + "shortDescription": { + "text": "String literal may be 'equals()' qualifier" + }, + "fullDescription": { + "text": "Reports 'String.equals()' or 'String.equalsIgnoreCase()' calls with a string literal argument. Some coding standards specify that string literals should be the qualifier of 'equals()', rather than argument, thus minimizing 'NullPointerException'-s. A quick-fix is available to exchange the literal and the expression. Example: 'boolean isFoo(String value) {\n return value.equals(\"foo\");\n }' After the quick-fix is applied: 'boolean isFoo(String value) {\n return \"foo\".equals(value);\n }' Inspection ID: LiteralAsArgToStringEquals", + "markdown": "Reports `String.equals()` or `String.equalsIgnoreCase()` calls with a string literal argument.\n\nSome coding standards specify that string literals should be the qualifier of `equals()`, rather than\nargument, thus minimizing `NullPointerException`-s.\n\nA quick-fix is available to exchange the literal and the expression.\n\n**Example:**\n\n\n boolean isFoo(String value) {\n return value.equals(\"foo\");\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isFoo(String value) {\n return \"foo\".equals(value);\n }\n\nInspection ID: LiteralAsArgToStringEquals" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LiteralAsArgToStringEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryEmptyArrayUsage", + "shortDescription": { + "text": "Unnecessary zero length array usage" + }, + "fullDescription": { + "text": "Reports allocations of arrays with known lengths of zero when there is a constant for that in the class of the array's element type. As zero-length arrays are immutable, you can save memory reusing the same array instance. Example: 'class Item {\n // Public zero-length array constant that can be reused \n public static final Item[] EMPTY_ARRAY = new Item[0];\n }\n class EmptyNode {\n Item[] getChildren() {\n // Unnecessary zero-length array creation\n return new Item[0];\n }\n }' After the quick-fix is applied: 'class EmptyNode {\n Item[] getChildren() {\n return Item.EMPTY_ARRAY;\n }\n }' Inspection ID: UnnecessaryEmptyArrayUsage", + "markdown": "Reports allocations of arrays with known lengths of zero when there is a constant for that in the class of the array's element type. As zero-length arrays are immutable, you can save memory reusing the same array instance.\n\n**Example:**\n\n\n class Item {\n // Public zero-length array constant that can be reused \n public static final Item[] EMPTY_ARRAY = new Item[0];\n }\n class EmptyNode {\n Item[] getChildren() {\n // Unnecessary zero-length array creation\n return new Item[0];\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class EmptyNode {\n Item[] getChildren() {\n return Item.EMPTY_ARRAY;\n }\n }\n\nInspection ID: UnnecessaryEmptyArrayUsage" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantForZeroLengthArrayAllocation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Memory", + "index": 69, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicateExpressions", + "shortDescription": { + "text": "Multiple occurrences of the same expression" + }, + "fullDescription": { + "text": "Reports multiple equivalent occurrences of the same expression within a method (or constructor, or class initializer) if the result of the expression can be reused. The expression is reported if it's free of side effects and its result is always the same (in terms of 'Object.equals()'). The examples of such expressions are 'a + b', 'Math.max(a, b)', 'a.equals(b)', 's.substring(a,b)'. To make sure the result is always the same, it's verified that the variables used in the expression don't change their values between the occurrences of the expression. Such expressions may contain methods of immutable classes like 'String', 'BigDecimal', and so on, and of utility classes like 'Objects', 'Math' (except 'random()'). The well-known methods, such as 'Object.equals()', 'Object.hashCode()', 'Object.toString()', 'Comparable.compareTo()', and 'Comparator.compare()' are OK as well because they normally don't have any observable side effects. Use the Expression complexity threshold option to specify the minimal expression complexity threshold. Specifying bigger numbers will remove reports on short expressions. 'Path.of' and 'Paths.get' calls are treated as equivalent calls if they have the same arguments. These calls are always reported no matter how complex their arguments are. This behaviour can be tweaked using different complexity threshold. Inspection ID: DuplicateExpressions New in 2018.3", + "markdown": "Reports multiple equivalent occurrences of the same expression within a method (or constructor, or class initializer) if the result of the expression can be reused.\n\n\nThe expression is reported if it's free of side effects and its result is always the same (in terms of `Object.equals()`).\nThe examples of such expressions are `a + b`, `Math.max(a, b)`, `a.equals(b)`,\n`s.substring(a,b)`. To make sure the result is always the same, it's verified that the variables used in the expression don't\nchange their values between the occurrences of the expression.\n\n\nSuch expressions may contain methods of immutable classes like `String`, `BigDecimal`, and so on,\nand of utility classes like `Objects`, `Math` (except `random()`).\nThe well-known methods, such as `Object.equals()`, `Object.hashCode()`, `Object.toString()`,\n`Comparable.compareTo()`, and `Comparator.compare()` are OK as well because they normally don't have\nany observable side effects.\n\n\nUse the **Expression complexity threshold** option to specify the minimal expression complexity threshold. Specifying bigger\nnumbers will remove reports on short expressions.\n\n\n`Path.of` and `Paths.get` calls are treated as equivalent calls if they have the same arguments. These calls\nare always reported no matter how complex their arguments are. This behaviour can be tweaked using different complexity threshold.\n\nInspection ID: DuplicateExpressions\n\nNew in 2018.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "DuplicateExpressions", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryReturn", + "shortDescription": { + "text": "Unnecessary 'return' statement" + }, + "fullDescription": { + "text": "Reports 'return' statements at the end of constructors and methods returning 'void'. These statements are redundant and may be safely removed. This inspection does not report in JSP files. Example: 'void message() {\n System.out.println(\"Hello World\");\n return;\n }' After the quick-fix is applied: 'void message() {\n System.out.println(\"Hello World\");\n }' Use the Ignore in then branch of 'if' statement with 'else' branch option to ignore 'return' statements in the then branch of 'if' statements which also have an 'else' branch. Inspection ID: UnnecessaryReturn", + "markdown": "Reports `return` statements at the end of constructors and methods returning `void`. These statements are redundant and may be safely removed.\n\nThis inspection does not report in JSP files.\n\nExample:\n\n\n void message() {\n System.out.println(\"Hello World\");\n return;\n }\n\nAfter the quick-fix is applied:\n\n\n void message() {\n System.out.println(\"Hello World\");\n }\n\n\nUse the **Ignore in then branch of 'if' statement with 'else' branch** option to ignore `return` statements in the then branch of `if` statements\nwhich also have an `else` branch.\n\nInspection ID: UnnecessaryReturn" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryReturnStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicInnerClass", + "shortDescription": { + "text": "'public' nested class" + }, + "fullDescription": { + "text": "Reports 'public' nested classes. Example: 'public class Outer {\n public static class Nested {} // warning\n public class Inner {} // warning\n public enum Mode {} // warning depends on the setting\n public interface I {} // warning depends on the setting\n }' Configure the inspection: Use the Ignore 'public' inner enums option to ignore 'public' inner enums. Use the Ignore 'public' inner interfaces option to ignore 'public' inner interfaces. Inspection ID: PublicInnerClass", + "markdown": "Reports `public` nested classes.\n\n**Example:**\n\n\n public class Outer {\n public static class Nested {} // warning\n public class Inner {} // warning\n public enum Mode {} // warning depends on the setting\n public interface I {} // warning depends on the setting\n }\n\nConfigure the inspection:\n\n* Use the **Ignore 'public' inner enums** option to ignore `public` inner enums.\n* Use the **Ignore 'public' inner interfaces** option to ignore `public` inner interfaces.\n\nInspection ID: PublicInnerClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PublicInnerClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Encapsulation", + "index": 59, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BooleanConstructor", + "shortDescription": { + "text": "Boolean constructor call" + }, + "fullDescription": { + "text": "Reports creation of 'Boolean' objects. Constructing new 'Boolean' objects is rarely necessary, and may cause performance problems if done often enough. Also, 'Boolean' constructors are deprecated since Java 9 and could be removed or made inaccessible in future Java versions. Example: 'Boolean b1 = new Boolean(true);\n Boolean b2 = new Boolean(str);' After the quick-fix is applied: 'Boolean b1 = Boolean.TRUE;\n Boolean b2 = Boolean.valueOf(str);' Inspection ID: BooleanConstructor", + "markdown": "Reports creation of `Boolean` objects.\n\n\nConstructing new `Boolean` objects is rarely necessary,\nand may cause performance problems if done often enough. Also, `Boolean`\nconstructors are deprecated since Java 9 and could be removed or made\ninaccessible in future Java versions.\n\n**Example:**\n\n\n Boolean b1 = new Boolean(true);\n Boolean b2 = new Boolean(str);\n\nAfter the quick-fix is applied:\n\n\n Boolean b1 = Boolean.TRUE;\n Boolean b2 = Boolean.valueOf(str);\n\nInspection ID: BooleanConstructor" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "BooleanConstructorCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonFinalGuard", + "shortDescription": { + "text": "Non-final '@GuardedBy' field" + }, + "fullDescription": { + "text": "Reports '@GuardedBy' annotations in which the guarding field is not 'final'. Guarding on a non-final field may result in unexpected race conditions, as locks will be held on the value of the field (which may change), rather than the field itself. Example: 'private ReadWriteLock lock = new ReentrantReadWriteLock(); //not final guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy' Inspection ID: NonFinalGuard", + "markdown": "Reports `@GuardedBy` annotations in which the guarding field is not `final`.\n\nGuarding on a non-final field may result in unexpected race conditions, as locks will\nbe held on the value of the field (which may change), rather than the field itself.\n\nExample:\n\n\n private ReadWriteLock lock = new ReentrantReadWriteLock(); //not final guarding field\n private Object state;\n\n @GuardedBy(\"lock\")\n public void bar() {\n state = new Object();\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`\n\nInspection ID: NonFinalGuard" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonFinalGuard", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Concurrency annotation issues", + "index": 60, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TooBroadScope", + "shortDescription": { + "text": "Scope of variable is too broad" + }, + "fullDescription": { + "text": "Reports any variable declarations that can be moved to a smaller scope. This inspection is especially useful for Pascal style declarations at the beginning of a method. Additionally variables with too broad a scope are also often left behind after refactorings. Example: 'StringBuilder sb = new StringBuilder();\n System.out.println();\n sb.append(1);' After the quick-fix is applied: 'System.out.println();\n StringBuilder sb = new StringBuilder();\n sb.append(1);' Configure the inspection: Use the Only report variables that can be moved into inner blocks option to report only those variables that can be moved inside deeper code blocks. For example, when the option is enabled, the movement will not be suggested for the 'sb' variable above. However, it will be suggested for the following code: 'StringBuilder sb = new StringBuilder(a);\n if (flag) {\n sb.append(1);\n }' Use the Report variables with a new expression as initializer (potentially unsafe) option to report variables that are initialized with a new expression. This makes the inspection potentially unsafe when the constructor has non-local side effects. For example, when the option is enabled, the movement will be suggested for the 'foo' variable: 'class Foo {\n static List fooList = new ArrayList<>();\n String bar;\n\n Foo(String bar) {\n this.bar = bar;\n fooList.add(this);\n }\n\n public static void main(String[] args) {\n // movement is possible even though is unsafe\n Foo foo = new Foo(\"bar\");\n System.out.println(fooList.size());\n System.out.println(foo.bar);\n }\n }' Inspection ID: TooBroadScope", + "markdown": "Reports any variable declarations that can be moved to a smaller scope.\n\nThis inspection is especially\nuseful for *Pascal style* declarations at the beginning of a method. Additionally variables with too broad a\nscope are also often left behind after refactorings.\n\n**Example:**\n\n\n StringBuilder sb = new StringBuilder();\n System.out.println();\n sb.append(1);\n\nAfter the quick-fix is applied:\n\n\n System.out.println();\n StringBuilder sb = new StringBuilder();\n sb.append(1);\n\nConfigure the inspection:\n\n* Use the **Only report variables that can be moved into inner blocks** option to report only those variables that can be moved inside deeper code blocks. For example, when the option is enabled, the movement will not be suggested for the `sb` variable above. However, it will be suggested for the following code:\n\n\n StringBuilder sb = new StringBuilder(a);\n if (flag) {\n sb.append(1);\n }\n\n* Use the **Report variables with a new expression as initializer\n (potentially unsafe)** option to report variables that are initialized with a new expression. This makes the inspection potentially unsafe when the constructor has non-local side effects. For example, when the option is enabled, the movement will be suggested for the `foo` variable:\n\n\n class Foo {\n static List fooList = new ArrayList<>();\n String bar;\n\n Foo(String bar) {\n this.bar = bar;\n fooList.add(this);\n }\n\n public static void main(String[] args) {\n // movement is possible even though is unsafe\n Foo foo = new Foo(\"bar\");\n System.out.println(fooList.size());\n System.out.println(foo.bar);\n }\n }\n\nInspection ID: TooBroadScope" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TooBroadScope", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Data flow", + "index": 22, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CollectionAddedToSelf", + "shortDescription": { + "text": "Collection added to itself" + }, + "fullDescription": { + "text": "Reports cases where the argument of a method call on a 'java.util.Collection' or 'java.util.Map' is the collection or map itself. Such situations may occur as a result of copy-paste in code with raw types. Example: 'ArrayList list = new ArrayList<>();\n list.add(list); // warning here\n return list.hashCode(); // throws StackOverflowError' Inspection ID: CollectionAddedToSelf", + "markdown": "Reports cases where the argument of a method call on a `java.util.Collection` or `java.util.Map` is the collection or map itself. Such situations may occur as a result of copy-paste in code with raw types.\n\n**Example:**\n\n\n ArrayList list = new ArrayList<>();\n list.add(list); // warning here\n return list.hashCode(); // throws StackOverflowError\n\nInspection ID: CollectionAddedToSelf" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CollectionAddedToSelf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThrowableSupplierOnlyThrowException", + "shortDescription": { + "text": "Throwable supplier never returns a value" + }, + "fullDescription": { + "text": "Reports 'Supplier' lambdas in 'Optional.orElseThrow()' calls that throw an exception, instead of returning it. Example: 'optional.orElseThrow(() -> {\n throw new RuntimeException();\n});' After the quick-fix is applied: 'optional.orElseThrow(() -> new RuntimeException());' Inspection ID: ThrowableSupplierOnlyThrowException New in 2023.1", + "markdown": "Reports `Supplier` lambdas in `Optional.orElseThrow()` calls that throw an exception, instead of returning it.\n\n**Example:**\n\n\n optional.orElseThrow(() -> {\n throw new RuntimeException();\n });\n\nAfter the quick-fix is applied:\n\n\n optional.orElseThrow(() -> new RuntimeException());\n\nInspection ID: ThrowableSupplierOnlyThrowException\n\nNew in 2023.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ThrowableSupplierOnlyThrowException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IfStatementMissingBreakInLoop", + "shortDescription": { + "text": "Early loop exit in 'if' condition" + }, + "fullDescription": { + "text": "Reports loops with an 'if' statement that can end with 'break' without changing the semantics. This prevents redundant loop iterations. Example: 'boolean found = false;\n for (int i = 0; i < arr.length; i++) {\n if (Objects.equals(value, arr[i])) {\n found = true;\n }\n }' After the quick-fix is applied: 'boolean found = false;\n for (int i = 0; i < arr.length; i++) {\n if (Objects.equals(value, arr[i])) {\n found = true;\n break;\n }\n }' Inspection ID: IfStatementMissingBreakInLoop New in 2019.2", + "markdown": "Reports loops with an `if` statement that can end with `break` without changing the semantics. This prevents redundant loop iterations.\n\n**Example:**\n\n\n boolean found = false;\n for (int i = 0; i < arr.length; i++) {\n if (Objects.equals(value, arr[i])) {\n found = true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n boolean found = false;\n for (int i = 0; i < arr.length; i++) {\n if (Objects.equals(value, arr[i])) {\n found = true;\n break;\n }\n }\n\nInspection ID: IfStatementMissingBreakInLoop\n\nNew in 2019.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IfStatementMissingBreakInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantStreamOptionalCall", + "shortDescription": { + "text": "Redundant step in 'Stream' or 'Optional' call chain" + }, + "fullDescription": { + "text": "Reports redundant 'Stream' or 'Optional' calls like 'map(x -> x)', 'filter(x -> true)' or redundant 'sorted()' or 'distinct()' calls. Note that a mapping operation in code like 'streamOfIntegers.map(Integer::valueOf)' works as 'requireNonNull()' check: if the stream contains 'null', it throws a 'NullPointerException', thus it's not absolutely redundant. Disable the Report redundant boxing in Stream.map() option if you do not want such cases to be reported. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: RedundantStreamOptionalCall", + "markdown": "Reports redundant `Stream` or `Optional` calls like `map(x -> x)`, `filter(x -> true)` or redundant `sorted()` or `distinct()` calls.\n\nNote that a mapping operation in code like `streamOfIntegers.map(Integer::valueOf)`\nworks as `requireNonNull()` check:\nif the stream contains `null`, it throws a `NullPointerException`, thus it's not absolutely redundant.\nDisable the **Report redundant boxing in Stream.map()** option if you do not want such cases to be reported.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: RedundantStreamOptionalCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantStreamOptionalCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessarySuperQualifier", + "shortDescription": { + "text": "Unnecessary 'super' qualifier" + }, + "fullDescription": { + "text": "Reports unnecessary 'super' qualifiers in method calls and field references. A 'super' qualifier is unnecessary when the field or method of the superclass is not hidden/overridden in the calling class. Example: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }' After the quick-fix is applied: 'class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n foo();\n }\n }' Use the inspection settings to ignore qualifiers that help to distinguish superclass members access from the identically named members of the outer class. See also the following inspections: Java | Visibility | Access to inherited field looks like access to element from surrounding code Java | Visibility | Call to inherited method looks like call to local method Inspection ID: UnnecessarySuperQualifier", + "markdown": "Reports unnecessary `super` qualifiers in method calls and field references.\n\n\nA `super` qualifier is unnecessary\nwhen the field or method of the superclass is not hidden/overridden in the calling class.\n\n**Example:**\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n super.foo();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void foo() {}\n }\n\n class Bar extends Foo {\n void bar() {\n foo();\n }\n }\n\n\nUse the inspection settings to ignore qualifiers that help to distinguish superclass members access\nfrom the identically named members of the outer class.\n\n\nSee also the following inspections:\n\n* *Java \\| Visibility \\| Access to inherited field looks like access to element from surrounding code*\n* *Java \\| Visibility \\| Call to inherited method looks like call to local method*\n\nInspection ID: UnnecessarySuperQualifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessarySuperQualifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadPriority", + "shortDescription": { + "text": "Call to 'Thread.setPriority()'" + }, + "fullDescription": { + "text": "Reports calls to 'Thread.setPriority()'. Modifying priorities of threads is an inherently non-portable operation, as no guarantees are given in the Java specification of how priorities are used in scheduling threads, or even whether they are used at all. Inspection ID: ThreadPriority", + "markdown": "Reports calls to `Thread.setPriority()`. Modifying priorities of threads is an inherently non-portable operation, as no guarantees are given in the Java specification of how priorities are used in scheduling threads, or even whether they are used at all.\n\nInspection ID: ThreadPriority" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToThreadSetPriority", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EqualsOnSuspiciousObject", + "shortDescription": { + "text": "'equals()' called on classes which don't override it" + }, + "fullDescription": { + "text": "Reports 'equals()' calls on 'StringBuilder', 'StringBuffer' and instances of 'java.util.concurrent.atomic' package. The 'equals()' method is not overridden in these classes, so it may return 'false' even when the contents of the two objects are the same. If the reference equality is intended, it's better to use '==' to avoid confusion. A quick-fix for 'StringBuilder', 'StringBuffer', 'AtomicBoolean', 'AtomicInteger', 'AtomicBoolean' and 'AtomicLong' is available to transform into a comparison of contents. The quick-fix may change the semantics when one of the instances is null. Example: 'public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.equals(sb2); // Suspicious\n }' After the quick-fix is applied: 'public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.toString().equals(sb2.toString());\n }' Inspection ID: EqualsOnSuspiciousObject New in 2017.2", + "markdown": "Reports `equals()` calls on `StringBuilder`, `StringBuffer` and instances of `java.util.concurrent.atomic` package.\n\nThe `equals()` method is not overridden in these classes, so it may return `false` even when the contents of the\ntwo objects are the same.\nIf the reference equality is intended, it's better to use `==` to avoid confusion.\nA quick-fix for `StringBuilder`, `StringBuffer`, `AtomicBoolean`, `AtomicInteger`, `AtomicBoolean` and `AtomicLong` is available to transform into a comparison of contents. The quick-fix may change the semantics when one of the instances is null.\n\nExample:\n\n\n public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.equals(sb2); // Suspicious\n }\n\nAfter the quick-fix is applied:\n\n\n public void test(StringBuilder sb1, StringBuilder sb2) {\n boolean result = sb1.toString().equals(sb2.toString());\n }\n\nInspection ID: EqualsOnSuspiciousObject\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EqualsOnSuspiciousObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfPropertiesAsHashtable", + "shortDescription": { + "text": "Use of 'Properties' object as a 'Hashtable'" + }, + "fullDescription": { + "text": "Reports calls to the following methods on 'java.util.Properties' objects: 'put()' 'putIfAbsent()' 'putAll()' 'get()' For historical reasons, 'java.util.Properties' inherits from 'java.util.Hashtable', but using these methods is discouraged to prevent pollution of properties with values of types other than 'String'. Calls to 'java.util.Properties.putAll()' won't get reported when both the key and the value parameters in the map are of the 'String' type. Such a call is safe and no better alternative exists. Example: 'Object f(Properties props) {\n props.put(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.get(\"Hello\");\n }' After the quick-fix is applied: 'Object f(Properties props) {\n props.setProperty(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.getProperty(\"hello\");\n }' Inspection ID: UseOfPropertiesAsHashtable", + "markdown": "Reports calls to the following methods on `java.util.Properties` objects:\n\n* `put()`\n* `putIfAbsent()`\n* `putAll()`\n* `get()`\n\n\nFor historical reasons, `java.util.Properties` inherits from `java.util.Hashtable`,\nbut using these methods is discouraged to prevent pollution of properties with values of types other than `String`.\n\n\nCalls to `java.util.Properties.putAll()` won't get reported when\nboth the key and the value parameters in the map are of the `String` type.\nSuch a call is safe and no better alternative exists.\n\n**Example:**\n\n\n Object f(Properties props) {\n props.put(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.get(\"Hello\");\n }\n\nAfter the quick-fix is applied:\n\n\n Object f(Properties props) {\n props.setProperty(\"hello\", \"world\");\n props.putIfAbsent(\"hello\", \"world\");\n props.putAll(new HashMap<>());\n return props.getProperty(\"hello\");\n }\n\nInspection ID: UseOfPropertiesAsHashtable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfPropertiesAsHashtable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodCoupling", + "shortDescription": { + "text": "Overly coupled method" + }, + "fullDescription": { + "text": "Reports methods that reference too many other classes. Methods with too high coupling can be very fragile and should be probably split into smaller methods. Each referenced class is counted only once no matter how many times it is referenced. Configure the inspection: Use the Method coupling limit field to specify the maximum allowed coupling for a method. Use the Include couplings to java system classes option to count references to classes from 'java'or 'javax' packages. Use the Include couplings to library classes option to count references to third-party library classes. Inspection ID: MethodCoupling", + "markdown": "Reports methods that reference too many other classes. Methods with too high coupling can be very fragile and should be probably split into smaller methods.\n\nEach referenced class is counted only once no matter how many times it is referenced.\n\nConfigure the inspection:\n\n* Use the **Method coupling limit** field to specify the maximum allowed coupling for a method.\n* Use the **Include couplings to java system classes** option to count references to classes from `java`or `javax` packages.\n* Use the **Include couplings to library classes** option to count references to third-party library classes.\n\nInspection ID: MethodCoupling" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyCoupledMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonFinalFieldOfException", + "shortDescription": { + "text": "Non-final field of 'Exception' class" + }, + "fullDescription": { + "text": "Reports fields in subclasses of 'java.lang.Exception' that are not declared 'final'. Data on exception objects should not be modified because this may result in losing the error context for later debugging and logging. Example: 'public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }' Inspection ID: NonFinalFieldOfException", + "markdown": "Reports fields in subclasses of `java.lang.Exception` that are not declared `final`.\n\nData on exception objects should not be modified\nbecause this may result in losing the error context for later debugging and logging.\n\n**Example:**\n\n\n public class EditorException extends Exception {\n private String message; // warning: Non-final field 'message' of exception class\n }\n\nInspection ID: NonFinalFieldOfException" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonFinalFieldOfException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantStringFormatCall", + "shortDescription": { + "text": "Redundant call to 'String.format()'" + }, + "fullDescription": { + "text": "Reports calls to methods like 'format()' and 'printf()' that can be safely removed or simplified. Example: 'System.out.println(String.format(\"Total count: %d\", 42));' After the quick-fix is applied: 'System.out.printf(\"Total count: %d%n\", 42);' Inspection ID: RedundantStringFormatCall", + "markdown": "Reports calls to methods like `format()` and `printf()` that can be safely removed or simplified.\n\n**Example:**\n\n\n System.out.println(String.format(\"Total count: %d\", 42));\n\nAfter the quick-fix is applied:\n\n\n System.out.printf(\"Total count: %d%n\", 42);\n\nInspection ID: RedundantStringFormatCall" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantStringFormatCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PointlessNullCheck", + "shortDescription": { + "text": "Unnecessary 'null' check before method call" + }, + "fullDescription": { + "text": "Reports 'null' checks followed by a method call that will definitely return 'false' when 'null' is passed (e.g. 'Class.isInstance'). Such a check seems excessive as the method call will always return 'false' in this case. Example: 'if (x != null && myClass.isInstance(x)) { ... }' After the quick-fix is applied: 'if (myClass.isInstance(x)) { ... }' Inspection ID: PointlessNullCheck", + "markdown": "Reports `null` checks followed by a method call that will definitely return `false` when `null` is passed (e.g. `Class.isInstance`).\n\nSuch a check seems excessive as the method call will always return `false` in this case.\n\n**Example:**\n\n\n if (x != null && myClass.isInstance(x)) { ... }\n\nAfter the quick-fix is applied:\n\n\n if (myClass.isInstance(x)) { ... }\n\n\nInspection ID: PointlessNullCheck" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PointlessNullCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AccessToStaticFieldLockedOnInstance", + "shortDescription": { + "text": "Access to 'static' field locked on instance data" + }, + "fullDescription": { + "text": "Reports access to non-constant static fields that are locked on either 'this' or an instance field of 'this'. Locking a static field on instance data does not prevent the field from being modified by other instances, and thus may result in unexpected race conditions. Example: 'static String test;\n public void foo() {\n synchronized (this) {\n System.out.println(test); // warning\n }\n }' There is a quick-fix that allows ignoring static fields of specific types. You can manage those ignored types in the inspection options. Use the inspection options to specify which classes used for static fields should be ignored. Inspection ID: AccessToStaticFieldLockedOnInstance", + "markdown": "Reports access to non-constant static fields that are locked on either `this` or an instance field of `this`.\n\n\nLocking a static field on instance data does not prevent the field from being\nmodified by other instances, and thus may result in unexpected race conditions.\n\n**Example:**\n\n\n static String test;\n public void foo() {\n synchronized (this) {\n System.out.println(test); // warning\n }\n }\n\n\nThere is a quick-fix that allows ignoring static fields of specific types.\nYou can manage those ignored types in the inspection options.\n\n\nUse the inspection options to specify which classes used for static fields should be ignored.\n\n\nInspection ID: AccessToStaticFieldLockedOnInstance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AccessToStaticFieldLockedOnInstance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodOverridesStaticMethod", + "shortDescription": { + "text": "Method tries to override 'static' method of superclass" + }, + "fullDescription": { + "text": "Reports 'static' methods with a signature identical to a 'static' method of a superclass. Such a method may look like an override when in fact it hides the method from the superclass because 'static' methods in Java cannot be overridden. Example: 'class Parent {\n static void method(){}\n }\n\n class Example extends Parent {\n static void method(){} //warning\n }' Inspection ID: MethodOverridesStaticMethod", + "markdown": "Reports `static` methods with a signature identical to a `static` method of a superclass. Such a method may look like an override when in fact it hides the method from the superclass because `static` methods in Java cannot be overridden.\n\n**Example:**\n\n\n class Parent {\n static void method(){}\n }\n\n class Example extends Parent {\n static void method(){} //warning\n }\n\nInspection ID: MethodOverridesStaticMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodOverridesStaticMethodOfSuperclass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnclearBinaryExpression", + "shortDescription": { + "text": "Multiple operators with different precedence" + }, + "fullDescription": { + "text": "Reports binary, conditional, or 'instanceof' expressions that consist of different operators without parentheses. Such expressions can be less readable due to different precedence rules of operators. Example: 'int n = 3 + 9 * 8 + 1;' After quick-fix is applied: 'int n = 3 + (9 * 8) + 1;' Inspection ID: UnclearBinaryExpression", + "markdown": "Reports binary, conditional, or `instanceof` expressions that consist of different operators without parentheses. Such expressions can be less readable due to different precedence rules of operators.\n\nExample:\n\n\n int n = 3 + 9 * 8 + 1;\n\nAfter quick-fix is applied:\n\n\n int n = 3 + (9 * 8) + 1;\n\nInspection ID: UnclearBinaryExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UnclearExpression", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VariableTypeCanBeExplicit", + "shortDescription": { + "text": "Variable type can be explicit" + }, + "fullDescription": { + "text": "Reports local variables of the 'var' type that can be replaced with an explicit type. Example: 'var str = \"Hello\";' After the quick-fix is applied: 'String str = \"Hello\";' This inspection depends on the Java feature 'Local variable type inference', which is available since Java 10. Inspection ID: VariableTypeCanBeExplicit", + "markdown": "Reports local variables of the `var` type that can be replaced with an explicit type.\n\n**Example:**\n\n\n var str = \"Hello\";\n\nAfter the quick-fix is applied:\n\n\n String str = \"Hello\";\n\nThis inspection depends on the Java feature 'Local variable type inference', which is available since Java 10.\n\nInspection ID: VariableTypeCanBeExplicit" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VariableTypeCanBeExplicit", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 10", + "index": 116, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ChainedMethodCall", + "shortDescription": { + "text": "Chained method calls" + }, + "fullDescription": { + "text": "Reports method calls whose target is another method call. The quick-fix suggests to introduce a local variable. Example: 'class X {\n int foo(File f) {\n return f.getName().length();\n }\n }' After the quick-fix is applied: 'class X {\n int foo(File f) {\n final String name = f.getName();\n return name.length();\n }\n }' Use the inspection options to toggle warnings for the following cases: chained method calls in field initializers, for instance, 'private final int i = new Random().nextInt();' chained method calls operating on the same type, for instance, 'new StringBuilder().append(\"x: \").append(new X()).append(\"y: \").append(new Y()).toString();'. Inspection ID: ChainedMethodCall", + "markdown": "Reports method calls whose target is another method call. The quick-fix suggests to introduce a local variable.\n\n**Example:**\n\n\n class X {\n int foo(File f) {\n return f.getName().length();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class X {\n int foo(File f) {\n final String name = f.getName();\n return name.length();\n }\n }\n\nUse the inspection options to toggle warnings for the following cases:\n\n*\n chained method calls in field initializers,\n for instance, `private final int i = new Random().nextInt();`\n\n*\n chained method calls operating on the same type,\n for instance, `new StringBuilder().append(\"x: \").append(new X()).append(\"y: \").append(new Y()).toString();`.\n\nInspection ID: ChainedMethodCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ChainedMethodCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExtendsUtilityClass", + "shortDescription": { + "text": "Class extends utility class" + }, + "fullDescription": { + "text": "Reports classes that extend a utility class. A utility class is a non-empty class in which all fields and methods are static. Extending a utility class also allows for inadvertent object instantiation of the utility class, because the constructor cannot be made private in order to allow extension. Configure the inspection: Use the Ignore if overriding class is a utility class option to ignore any classes that override a utility class but are also utility classes themselves. Inspection ID: ExtendsUtilityClass", + "markdown": "Reports classes that extend a utility class.\n\n\nA utility class is a non-empty class in which all fields and methods are static.\nExtending a utility class also allows for inadvertent object instantiation of the\nutility class, because the constructor cannot be made private in order to allow extension.\n\n\nConfigure the inspection:\n\n* Use the **Ignore if overriding class is a utility class** option to ignore any classes that override a utility class but are also utility classes themselves.\n\nInspection ID: ExtendsUtilityClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExtendsUtilityClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UtilityClassWithoutPrivateConstructor", + "shortDescription": { + "text": "Utility class without 'private' constructor" + }, + "fullDescription": { + "text": "Reports utility classes without 'private' constructors. Utility classes have all fields and methods declared as 'static'. Creating 'private' constructors in utility classes prevents them from being accidentally instantiated. Use the Ignore if annotated by option to specify special annotations. The inspection ignores classes marked with one of these annotations. Use the Ignore classes with only a main method option to ignore classes with no methods other than the main one. Inspection ID: UtilityClassWithoutPrivateConstructor", + "markdown": "Reports utility classes without `private` constructors.\n\nUtility classes have all fields and methods declared as `static`. Creating `private`\nconstructors in utility classes prevents them from being accidentally instantiated.\n\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection ignores classes marked with one of\nthese annotations.\n\n\nUse the **Ignore classes with only a main method** option to ignore classes with no methods other than the main one.\n\nInspection ID: UtilityClassWithoutPrivateConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UtilityClassWithoutPrivateConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java8ListSort", + "shortDescription": { + "text": "'Collections.sort()' can be replaced with 'List.sort()'" + }, + "fullDescription": { + "text": "Reports calls of 'Collections.sort(list, comparator)' which can be replaced with 'list.sort(comparator)'. 'Collections.sort' is just a wrapper, so it is better to use an instance method directly. This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: Java8ListSort", + "markdown": "Reports calls of `Collections.sort(list, comparator)` which can be replaced with `list.sort(comparator)`.\n\n`Collections.sort` is just a wrapper, so it is better to use an instance method directly.\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: Java8ListSort" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Java8ListSort", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssertMessageNotString", + "shortDescription": { + "text": "'assert' message is not a string" + }, + "fullDescription": { + "text": "Reports 'assert' messages that are not of the 'java.lang.String' type. Using a string provides more information to help diagnose the failure or the assertion reason. Example: 'void foo(List myList) {\n assert myList.isEmpty() : false;\n }' Use the Only warn when the 'assert' message type is 'boolean' or 'java.lang.Boolean' option to only warn when the 'assert' message type is 'boolean' or 'java.lang.Boolean'. A 'boolean' detail message is unlikely to provide additional information about an assertion failure and could result from a mistakenly entered ':' instead of '&'. This inspection depends on the Java feature 'Assertions', which is available since Java 1.4. Inspection ID: AssertMessageNotString", + "markdown": "Reports `assert` messages that are not of the `java.lang.String` type.\n\nUsing a string provides more information to help diagnose the failure\nor the assertion reason.\n\n**Example:**\n\n\n void foo(List myList) {\n assert myList.isEmpty() : false;\n }\n\n\nUse the **Only warn when the `assert` message type is 'boolean' or 'java.lang.Boolean'** option to only warn when the `assert` message type is `boolean` or `java.lang.Boolean`.\nA `boolean` detail message is unlikely to provide additional information about an assertion failure\nand could result from a mistakenly entered `:` instead of `&`.\n\nThis inspection depends on the Java feature 'Assertions', which is available since Java 1.4.\n\nInspection ID: AssertMessageNotString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssertMessageNotString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComparatorCombinators", + "shortDescription": { + "text": "'Comparator' combinator can be used" + }, + "fullDescription": { + "text": "Reports 'Comparator' instances defined as lambda expressions that could be expressed using 'Comparator.comparing()' calls. Chained comparisons which can be replaced by 'Comparator.thenComparing()' expression are also reported. Example: 'myList.sort((person1, person2) -> person1.getName().compareTo(person2.getName()));\n\n myList2.sort((person1, person2) -> {\n int res = person1.first().compareTo(person2.first());\n if(res == 0) res = person1.second().compareTo(person2.second());\n if(res == 0) res = person1.third() - person2.third();\n return res;\n });' After the quick-fixes are applied: 'myList.sort(Comparator.comparing(Person::getName));\n\n myList2.sort(Comparator.comparing(Person::first)\n .thenComparing(Person::second)\n .thenComparingInt(Person::third));' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: ComparatorCombinators", + "markdown": "Reports `Comparator` instances defined as lambda expressions that could be expressed using `Comparator.comparing()` calls. Chained comparisons which can be replaced by `Comparator.thenComparing()` expression are also reported.\n\nExample:\n\n\n myList.sort((person1, person2) -> person1.getName().compareTo(person2.getName()));\n\n myList2.sort((person1, person2) -> {\n int res = person1.first().compareTo(person2.first());\n if(res == 0) res = person1.second().compareTo(person2.second());\n if(res == 0) res = person1.third() - person2.third();\n return res;\n });\n\nAfter the quick-fixes are applied:\n\n\n myList.sort(Comparator.comparing(Person::getName));\n\n myList2.sort(Comparator.comparing(Person::first)\n .thenComparing(Person::second)\n .thenComparingInt(Person::third));\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: ComparatorCombinators" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ComparatorCombinators", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PatternVariableCanBeUsed", + "shortDescription": { + "text": "Pattern variable can be used" + }, + "fullDescription": { + "text": "Reports local variable declarations that can be replaced with pattern variables, which are usually more compact. Example: 'if (obj instanceof String) {\n String str = (String) obj;\n System.out.println(str);\n }' Can be replaced with: 'if (obj instanceof String str) {\n System.out.println(str);\n }' This inspection depends on the Java feature 'Patterns in 'instanceof'', which is available since Java 16. Inspection ID: PatternVariableCanBeUsed New in 2020.1", + "markdown": "Reports local variable declarations that can be replaced with pattern variables, which are usually more compact.\n\n**Example:**\n\n\n if (obj instanceof String) {\n String str = (String) obj;\n System.out.println(str);\n }\n\nCan be replaced with:\n\n\n if (obj instanceof String str) {\n System.out.println(str);\n }\n\nThis inspection depends on the Java feature 'Patterns in 'instanceof'', which is available since Java 16.\n\nInspection ID: PatternVariableCanBeUsed\n\nNew in 2020.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PatternVariableCanBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 16", + "index": 117, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AbstractMethodCallInConstructor", + "shortDescription": { + "text": "Abstract method called during object construction" + }, + "fullDescription": { + "text": "Reports calls to 'abstract' methods of the current class during object construction. A method is called during object construction if it is inside a: Constructor Non-static instance initializer Non-static field initializer 'clone()' method 'readObject()' method 'readObjectNoData()' method Such calls may result in subtle bugs, as object initialization may happen before the method call. Example: 'abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }' This inspection shares the functionality with the following inspections: Overridable method called during object construction Overridden method called during object construction Only one inspection should be enabled at once to prevent warning duplication. Inspection ID: AbstractMethodCallInConstructor", + "markdown": "Reports calls to `abstract` methods of the current class during object construction.\n\nA method is called during object construction if it is inside a:\n\n* Constructor\n* Non-static instance initializer\n* Non-static field initializer\n* `clone()` method\n* `readObject()` method\n* `readObjectNoData()` method\n\nSuch calls may result in subtle bugs, as object initialization may happen before the method call.\n\n**Example:**\n\n\n abstract class Parent {\n abstract void abstractMethod();\n }\n\n class Child extends Parent {\n Child() {\n abstractMethod();\n }\n }\n\nThis inspection shares the functionality with the following inspections:\n\n* Overridable method called during object construction\n* Overridden method called during object construction\n\nOnly one inspection should be enabled at once to prevent warning duplication.\n\nInspection ID: AbstractMethodCallInConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AbstractMethodCallInConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EqualsReplaceableByObjectsCall", + "shortDescription": { + "text": "'equals()' expression replaceable by 'Objects.equals()' expression" + }, + "fullDescription": { + "text": "Reports expressions that can be replaced with a call to 'java.util.Objects#equals'. Example: 'void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }' After the quick-fix is applied: 'void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }' Replacing expressions like 'a != null && a.equals(b)' with 'Objects.equals(a, b)' slightly changes the semantics. Use the Highlight expressions like 'a != null && a.equals(b)' option to enable or disable this behavior. This inspection depends on the Java feature 'java.util.Objects API', which is available since Java 7. Inspection ID: EqualsReplaceableByObjectsCall", + "markdown": "Reports expressions that can be replaced with a call to `java.util.Objects#equals`.\n\n**Example:**\n\n\n void f(Object a, Object b) {\n boolean result = a != null && a.equals(b);\n }\n\nAfter the quick-fix is applied:\n\n\n void f(Object a, Object b) {\n boolean result = Objects.equals(a, b);\n }\n\n\nReplacing expressions like `a != null && a.equals(b)` with `Objects.equals(a, b)`\nslightly changes the semantics. Use the **Highlight expressions like 'a != null \\&\\& a.equals(b)'** option to enable or disable this behavior.\n\nThis inspection depends on the Java feature 'java.util.Objects API', which is available since Java 7.\n\nInspection ID: EqualsReplaceableByObjectsCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EqualsReplaceableByObjectsCall", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 7", + "index": 118, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ImplicitToExplicitClassBackwardMigration", + "shortDescription": { + "text": "Compact source file can be replaced with a regular class" + }, + "fullDescription": { + "text": "Reports compact source files and suggests replacing them with regular classes. Example (in file Sample.java): 'void main() {\n String a = \"Hello, world!\";\n }' After the quick-fix is applied: 'public class Sample {\n void main() {\n String a = \"Hello, world!\";\n }\n}' This inspection can help to downgrade for backward compatibility with earlier Java versions. This inspection depends on the Java feature 'Compact source files', which is available since Java 21-preview. Inspection ID: ImplicitToExplicitClassBackwardMigration New in 2024.1", + "markdown": "Reports compact source files and suggests replacing them with regular classes.\n\n**Example (in file Sample.java):**\n\n\n void main() {\n String a = \"Hello, world!\";\n }\n\nAfter the quick-fix is applied:\n\n\n public class Sample {\n void main() {\n String a = \"Hello, world!\";\n }\n }\n\n\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nThis inspection depends on the Java feature 'Compact source files', which is available since Java 21-preview.\n\nInspection ID: ImplicitToExplicitClassBackwardMigration\n\nNew in 2024.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ImplicitToExplicitClassBackwardMigration", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 25", + "index": 92, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnonymousClassVariableHidesContainingMethodVariable", + "shortDescription": { + "text": "Anonymous class variable hides variable in containing method" + }, + "fullDescription": { + "text": "Reports fields in an anonymous class that are named identically to local variables or parameters of the containing method or lambda expression. As a result of such naming, you may accidentally use the anonymous class field where the identically named variable or parameter from the containing method is intended. A quick-fix is suggested to rename the field. Example: 'class Test {\n public Test(String value) {\n Object foo = new Object() {\n private String value = \"TEST\";\n public void foo() {\n System.out.println(value); //the field is accessed, not the parameter\n }\n };\n }\n }' Inspection ID: AnonymousClassVariableHidesContainingMethodVariable", + "markdown": "Reports fields in an anonymous class that are named identically to local variables or parameters of the containing method or lambda expression.\n\n\nAs a result of such naming, you may accidentally use the anonymous class field where\nthe identically named variable or parameter from the containing method is intended.\n\nA quick-fix is suggested to rename the field.\n\n**Example:**\n\n\n class Test {\n public Test(String value) {\n Object foo = new Object() {\n private String value = \"TEST\";\n public void foo() {\n System.out.println(value); //the field is accessed, not the parameter\n }\n };\n }\n }\n\nInspection ID: AnonymousClassVariableHidesContainingMethodVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AnonymousClassVariableHidesContainingMethodVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodRefCanBeReplacedWithLambda", + "shortDescription": { + "text": "Method reference can be replaced with lambda" + }, + "fullDescription": { + "text": "Reports method references, like 'MyClass::myMethod' and 'myObject::myMethod', and suggests replacing them with an equivalent lambda expression. Lambda expressions can be easier to modify than method references. Example: 'System.out::println' After the quick-fix is applied: 's -> System.out.println(s)' By default, this inspection does not highlight the code in the editor, but only provides a quick-fix. This inspection depends on the following Java features: Lambda expressions Method references These features are available since Java 8. Inspection ID: MethodRefCanBeReplacedWithLambda", + "markdown": "Reports method references, like `MyClass::myMethod` and `myObject::myMethod`, and suggests replacing them with an equivalent lambda expression.\n\nLambda expressions can be easier to modify than method references.\n\nExample:\n\n\n System.out::println\n\nAfter the quick-fix is applied:\n\n\n s -> System.out.println(s)\n\nBy default, this inspection does not highlight the code in the editor, but only provides a quick-fix.\n\nThis inspection depends on the following Java features:\n\n* Lambda expressions\n* Method references\n\nThese features are available since Java 8.\n\nInspection ID: MethodRefCanBeReplacedWithLambda" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MethodRefCanBeReplacedWithLambda", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TailRecursion", + "shortDescription": { + "text": "Tail recursion" + }, + "fullDescription": { + "text": "Reports tail recursion, that is, when a method calls itself as its last action before returning. Tail recursion can always be replaced by looping, which will be considerably faster. Some JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different performance characteristics on different virtual machines. Example: 'int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }' After the quick-fix is applied: 'int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }' Inspection ID: TailRecursion", + "markdown": "Reports tail recursion, that is, when a method calls itself as its last action before returning.\n\n\nTail recursion can always be replaced by looping, which will be considerably faster.\nSome JVMs perform tail-call optimization, while others do not. Thus, tail-recursive solutions may have considerably different\nperformance characteristics on different virtual machines.\n\nExample:\n\n\n int factorial(int val, int runningVal) {\n if (val == 1) {\n return runningVal;\n } else {\n return factorial(val - 1, runningVal * val);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n int factorial(int val, int runningVal) {\n while (true) {\n if (val == 1) {\n return runningVal;\n } else {\n runningVal = runningVal * val;\n val = val - 1;\n }\n }\n }\n\nInspection ID: TailRecursion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TailRecursion", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedSynchronizedStatement", + "shortDescription": { + "text": "Nested 'synchronized' statement" + }, + "fullDescription": { + "text": "Reports nested 'synchronized' statements. It is recommended to avoid nested synchronization if possible, because in some cases it may lead to a deadlock. Example: 'synchronized (lockA){\n //thread 1 is waiting for lockB\n synchronized (lockB){ //warning\n }\n }\n ...\n synchronized (lockB) {\n //thread 2 is waiting for lockA\n synchronized (lockA) { //warning\n }\n }' Inspection ID: NestedSynchronizedStatement", + "markdown": "Reports nested `synchronized` statements. It is recommended to avoid nested synchronization if possible, because in some cases it may lead to a deadlock.\n\n**Example:**\n\n\n synchronized (lockA){\n //thread 1 is waiting for lockB\n synchronized (lockB){ //warning\n }\n }\n ...\n synchronized (lockB) {\n //thread 2 is waiting for lockA\n synchronized (lockA) { //warning\n }\n }\n\nInspection ID: NestedSynchronizedStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedSynchronizedStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncorrectDateTimeFormat", + "shortDescription": { + "text": "Incorrect 'DateTimeFormat' pattern" + }, + "fullDescription": { + "text": "Reports incorrect date time format patterns. The following errors are reported: Unsupported pattern letters, like \"TT\" Using reserved characters, like \"#\" Incorrect use of padding Unbalanced brackets Incorrect amount of consecutive pattern letters Examples: 'DateTimeFormatter.ofPattern(\"[][]]\"); // Closing ']' without previous opening '['\n DateTimeFormatter.ofPattern(\"TT\"); // Illegal pattern letter 'T'\n DateTimeFormatter.ofPattern(\"{\"); // Use of reserved character '{'\n DateTimeFormatter.ofPattern(\"MMMMMM\"); // Too many consecutive pattern letters 'M'' New in 2022.3 Inspection ID: IncorrectDateTimeFormat", + "markdown": "Reports incorrect date time format patterns.\n\nThe following errors are reported:\n\n* Unsupported pattern letters, like \"TT\"\n* Using reserved characters, like \"#\"\n* Incorrect use of padding\n* Unbalanced brackets\n* Incorrect amount of consecutive pattern letters\n\nExamples:\n\n\n DateTimeFormatter.ofPattern(\"[][]]\"); // Closing ']' without previous opening '['\n DateTimeFormatter.ofPattern(\"TT\"); // Illegal pattern letter 'T'\n DateTimeFormatter.ofPattern(\"{\"); // Use of reserved character '{'\n DateTimeFormatter.ofPattern(\"MMMMMM\"); // Too many consecutive pattern letters 'M'\n\nNew in 2022.3\n\nInspection ID: IncorrectDateTimeFormat" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IncorrectDateTimeFormat", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringEqualsEmptyString", + "shortDescription": { + "text": "'String.equals()' can be replaced with 'String.isEmpty()'" + }, + "fullDescription": { + "text": "Reports 'equals()' being called to compare a 'String' with an empty string. In this case, using '.isEmpty()' is better as it shows you exactly what you're checking. Example: 'void checkString(String s){\n if (\"\".equals(s)) throw new IllegalArgumentException();\n }' After the quick-fix is applied: 'void checkString(String s){\n if (s != null && s.isEmpty()) throw new IllegalArgumentException();\n }' '\"\".equals(str)' returns false when 'str' is null. For safety, this inspection's quick-fix inserts an explicit null-check when the 'equals()' argument is nullable. Use the option to make the inspection ignore such cases. Inspection ID: StringEqualsEmptyString", + "markdown": "Reports `equals()` being called to compare a `String` with an empty string. In this case, using `.isEmpty()` is better as it shows you exactly what you're checking.\n\n**Example:**\n\n\n void checkString(String s){\n if (\"\".equals(s)) throw new IllegalArgumentException();\n }\n\nAfter the quick-fix is applied:\n\n\n void checkString(String s){\n if (s != null && s.isEmpty()) throw new IllegalArgumentException();\n }\n\n\n`\"\".equals(str)` returns false when `str` is null. For safety, this inspection's quick-fix inserts an explicit\nnull-check when\nthe `equals()` argument is nullable. Use the option to make the inspection ignore such cases.\n\nInspection ID: StringEqualsEmptyString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringEqualsEmptyString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PreviewFeature", + "shortDescription": { + "text": "Preview Feature warning" + }, + "fullDescription": { + "text": "Reports usages of Preview Feature APIs, i.e. of a module, package, class, interface, method, constructor, field, or enum constant in the 'java.*' or 'javax.*' namespace annotated with '@PreviewFeature'. A preview feature is a new feature of the Java language, Java Virtual Machine, or Java SE API that is fully specified, fully implemented, and is yet impermanent. The notion of a preview feature is defined in JEP 12. If some piece of code depends on a preview API, it may stop compiling in future JDK versions if the feature is changed or removed. The inspection only reports if the language level of the project or module is Preview. Inspection ID: PreviewFeature New in 2021.1", + "markdown": "Reports usages of Preview Feature APIs, i.e. of a module, package, class, interface, method, constructor, field, or enum constant in the `java.*` or `javax.*` namespace annotated with `@PreviewFeature`.\n\n\nA preview feature is a new feature of the Java language, Java Virtual Machine, or Java SE API that is fully specified, fully implemented,\nand is yet impermanent. The notion of a preview feature is defined in [JEP 12](https://openjdk.org/jeps/12).\n\n\nIf some piece of code depends on a preview API, it may stop compiling in future JDK versions if the feature is changed or removed.\n\nThe inspection only reports if the language level of the project or module is **Preview**.\n\nInspection ID: PreviewFeature\n\nNew in 2021.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "preview", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Compiler issues", + "index": 94, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TooBroadThrows", + "shortDescription": { + "text": "Overly broad 'throws' clause" + }, + "fullDescription": { + "text": "Reports 'throws' clauses with exceptions that are more generic than the exceptions that the method actually throws. Example: 'public void createFile() throws Exception { // warning: 'throws Exception' is too broad, masking exception 'IOException'\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }' After the quick-fix is applied: 'public void createFile() throws IOException {\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }' Configure the inspection: Use the Maximum number of hidden exceptions to warn field to ignore exceptions, that hide a larger number of other exceptions than specified. Use the Only warn on RuntimeException, Exception, Error or Throwable option to have this inspection warn only on the most generic exceptions. Use the Ignore exceptions declared on methods overriding a library method option to ignore overly broad 'throws' clauses in methods that override a library method. Use the Ignore exceptions which hide others but are themselves thrown option to ignore any exceptions that hide other exceptions but still may be thrown from the method body and thus are technically not overly broad. Inspection ID: TooBroadThrows", + "markdown": "Reports `throws` clauses with exceptions that are more generic than the exceptions that the method actually throws.\n\n**Example:**\n\n\n public void createFile() throws Exception { // warning: 'throws Exception' is too broad, masking exception 'IOException'\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nAfter the quick-fix is applied:\n\n\n public void createFile() throws IOException {\n File file = new File(\"pathToFile\");\n file.createNewFile();\n }\n\nConfigure the inspection:\n\n* Use the **Maximum number of hidden exceptions to warn** field to ignore exceptions, that hide a larger number of other exceptions than specified.\n* Use the **Only warn on RuntimeException, Exception, Error or Throwable** option to have this inspection warn only on the most generic exceptions.\n* Use the **Ignore exceptions declared on methods overriding a library method** option to ignore overly broad `throws` clauses in methods that override a library method.\n* Use the **Ignore exceptions which hide others but are themselves thrown** option to ignore any exceptions that hide other exceptions but still may be thrown from the method body and thus are technically not overly broad.\n\nInspection ID: TooBroadThrows" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyBroadThrowsClause", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ImplicitSubclassInspection", + "shortDescription": { + "text": "Final declaration can't be overridden at runtime" + }, + "fullDescription": { + "text": "Reports cases when your code prevents a class from being subclassed by some framework (for example, Spring or Hibernate) at runtime. Typical examples of necessary but impossible subclassing: 'final' classes marked with framework-specific annotations (for example, Spring '@Configuration') 'final', 'static' or 'private' methods marked with framework-specific annotations (for example, Spring '@Transactional') methods marked with framework-specific annotations inside 'final' classes The list of reported cases depends on the frameworks used. Inspection ID: ImplicitSubclassInspection", + "markdown": "Reports cases when your code prevents a class from being subclassed by some framework (for example, Spring or Hibernate) at runtime.\n\nTypical examples of necessary but impossible subclassing:\n\n* `final` classes marked with framework-specific annotations (for example, Spring `@Configuration`)\n* `final`, `static` or `private` methods marked with framework-specific annotations (for example, Spring `@Transactional`)\n* methods marked with framework-specific annotations inside `final` classes\n\nThe list of reported cases depends on the frameworks used.\n\nInspection ID: ImplicitSubclassInspection" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "ImplicitSubclassInspection", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryFullyQualifiedName", + "shortDescription": { + "text": "Unnecessary fully qualified name" + }, + "fullDescription": { + "text": "Reports fully qualified class names that can be shortened. The quick-fix shortens fully qualified names and adds import statements if necessary. Example: 'class ListWrapper {\n java.util.List l;\n }' After the quick-fix is applied: 'import java.util.List;\n class ListWrapper {\n List l;\n }' Configure the inspection: Use the Ignore in Java 9 module statements option to ignore fully qualified names inside the Java 9 'provides' and 'uses' module statements. In Settings | Editor | Code Style | Java | Imports, use the following options to configure the inspection: Use the Insert imports for inner classes option if references to inner classes should be qualified with the outer class. Use the Use fully qualified class names in JavaDoc option to allow fully qualified names in Javadocs. Inspection ID: UnnecessaryFullyQualifiedName", + "markdown": "Reports fully qualified class names that can be shortened.\n\nThe quick-fix shortens fully qualified names and adds import statements if necessary.\n\nExample:\n\n\n class ListWrapper {\n java.util.List l;\n }\n\nAfter the quick-fix is applied:\n\n\n import java.util.List;\n class ListWrapper {\n List l;\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore in Java 9 module statements** option to ignore fully qualified names inside the Java 9\n`provides` and `uses` module statements.\n\n\nIn [Settings \\| Editor \\| Code Style \\| Java \\| Imports](settings://preferences.sourceCode.Java?JavaDoc%20Inner),\nuse the following options to configure the inspection:\n\n* Use the **Insert imports for inner classes** option if references to inner classes should be qualified with the outer class.\n* Use the **Use fully qualified class names in JavaDoc** option to allow fully qualified names in Javadocs.\n\nInspection ID: UnnecessaryFullyQualifiedName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UnnecessaryFullyQualifiedName", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NegatedConditional", + "shortDescription": { + "text": "Conditional expression with negated condition" + }, + "fullDescription": { + "text": "Reports conditional expressions whose conditions are negated. Flipping the order of the conditional expression branches usually increases the clarity of such statements. Use the Ignore '!= null' comparisons and Ignore '!= 0' comparisons options to ignore comparisons of the form 'obj != null' or 'num != 0'. Since 'obj != null' effectively means \"obj exists\", the meaning of the whole expression does not involve any negation and is therefore easy to understand. The same reasoning applies to 'num != 0' expressions, especially when using bit masks. These forms have the added benefit of mentioning the interesting case first. In most cases, the value for the '== null' branch is 'null' itself, like in the following examples: 'static String getName(Person p) {\n return p != null ? p.getName() : null;\n }\n\n static String getExecutableString(int fileMode) {\n return (fileMode & 0b001001001) != 0 ? \"executable\" : \"non-executable\";\n }' Inspection ID: NegatedConditional", + "markdown": "Reports conditional expressions whose conditions are negated.\n\nFlipping the order of the conditional expression branches usually increases the clarity of such statements.\n\n\nUse the **Ignore '!= null' comparisons** and **Ignore '!= 0' comparisons** options to ignore comparisons of the form\n`obj != null` or `num != 0`.\nSince `obj != null` effectively means \"obj exists\",\nthe meaning of the whole expression does not involve any negation\nand is therefore easy to understand.\n\n\nThe same reasoning applies to `num != 0` expressions, especially when using bit masks.\n\n\nThese forms have the added benefit of mentioning the interesting case first.\nIn most cases, the value for the `== null` branch is `null` itself,\nlike in the following examples:\n\n\n static String getName(Person p) {\n return p != null ? p.getName() : null;\n }\n\n static String getExecutableString(int fileMode) {\n return (fileMode & 0b001001001) != 0 ? \"executable\" : \"non-executable\";\n }\n\nInspection ID: NegatedConditional" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConditionalExpressionWithNegatedCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectEqualsCanBeEquality", + "shortDescription": { + "text": "'equals()' call can be replaced with '=='" + }, + "fullDescription": { + "text": "Reports calls to 'equals()' that can be replaced by '==' or '!=' expressions without a change in semantics. These calls can be replaced when they are used to compare 'final' classes that don't have their own 'equals()' implementation but use the default 'Object.equals()'. This replacement may result in better performance. There is a separate inspection for 'equals()' calls on 'enum' values: 'equals()' called on Enum value. Inspection ID: ObjectEqualsCanBeEquality", + "markdown": "Reports calls to `equals()` that can be replaced by `==` or `!=` expressions without a change in semantics.\n\nThese calls can be replaced when they are used to compare `final` classes that don't have their own `equals()` implementation but use the default `Object.equals()`.\nThis replacement may result in better performance.\n\nThere is a separate inspection for `equals()` calls on `enum` values: 'equals()' called on Enum value.\n\nInspection ID: ObjectEqualsCanBeEquality" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ObjectEqualsCanBeEquality", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BooleanParameter", + "shortDescription": { + "text": "'public' method with 'boolean' parameter" + }, + "fullDescription": { + "text": "Reports public methods that accept a 'boolean' parameter. It's almost always bad practice to add a 'boolean' parameter to a public method (part of an API) if that method is not a setter. When reading code using such a method, it can be difficult to decipher what the 'boolean' stands for without looking at the source or documentation. This problem is also known as the boolean trap. The 'boolean' parameter can often be replaced with an 'enum'. Example: '// Warning: it's hard to understand what the\n // boolean parameters mean when looking at\n // a call to this method\n public boolean setPermission(File f,\n int access,\n boolean enable,\n boolean ownerOnly) {\n // ...\n }' Use the Only report methods with multiple boolean parameters option to warn only when a method contains more than one boolean parameter. Inspection ID: BooleanParameter", + "markdown": "Reports public methods that accept a `boolean` parameter.\n\nIt's almost always bad practice to add a `boolean` parameter to a public method (part of an API) if that method is not a setter.\nWhen reading code using such a method, it can be difficult to decipher what the `boolean` stands for without looking at\nthe source or documentation.\n\nThis problem is also known as [the boolean trap](https://ariya.io/2011/08/hall-of-api-shame-boolean-trap).\nThe `boolean` parameter can often be replaced with an `enum`.\n\nExample:\n\n\n // Warning: it's hard to understand what the\n // boolean parameters mean when looking at\n // a call to this method\n public boolean setPermission(File f,\n int access,\n boolean enable,\n boolean ownerOnly) {\n // ...\n }\n\n\nUse the **Only report methods with multiple boolean parameters** option to warn only when a method contains more than one boolean parameter.\n\n\nInspection ID: BooleanParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BooleanParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JDBCPrepareStatementWithNonConstantString", + "shortDescription": { + "text": "Call to 'Connection.prepare*()' with non-constant string" + }, + "fullDescription": { + "text": "Reports calls to 'java.sql.Connection.prepareStatement()', 'java.sql.Connection.prepareCall()', or any of their variants which take a dynamically-constructed string as the statement to prepare. Constructed SQL statements are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");' Use the inspection settings to consider any 'static' 'final' fields as constants. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";' Inspection ID: JDBCPrepareStatementWithNonConstantString", + "markdown": "Reports calls to `java.sql.Connection.prepareStatement()`, `java.sql.Connection.prepareCall()`, or any of their variants which take a dynamically-constructed string as the statement to prepare.\n\n\nConstructed SQL statements are a common source of\nsecurity breaches. By default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String bar() { return \"bar\"; }\n\n Connection connection = DriverManager.getConnection(\"\", \"\", \"\");\n connection.(\"SELECT * FROM user WHERE name='\" + bar() + \"'\");\n\nUse the inspection settings to consider any `static` `final` fields as constants. Be careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String SQL = \"SELECT * FROM user WHERE name='\" + getUserInput() + \"'\";\n\nInspection ID: JDBCPrepareStatementWithNonConstantString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JDBCPrepareStatementWithNonConstantString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SystemProperties", + "shortDescription": { + "text": "Access of system properties" + }, + "fullDescription": { + "text": "Reports code that accesses system properties using one of the following methods: 'System.getProperties()', 'System.setProperty()', 'System.setProperties()', 'System.clearProperties()' 'Integer.getInteger()' 'Boolean.getBoolean()' While accessing the system properties is not a security risk in itself, it is often found in malicious code. Code that accesses system properties should be closely examined in any security audit. Inspection ID: SystemProperties", + "markdown": "Reports code that accesses system properties using one of the following methods:\n\n* `System.getProperties()`, `System.setProperty()`, `System.setProperties()`, `System.clearProperties()`\n* `Integer.getInteger()`\n* `Boolean.getBoolean()`\n\n\nWhile accessing the system properties is not a security risk in itself, it is often found in malicious code.\nCode that accesses system properties should be closely examined in any security audit.\n\nInspection ID: SystemProperties" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AccessOfSystemProperties", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TestInProductSource", + "shortDescription": { + "text": "Test in product source" + }, + "fullDescription": { + "text": "Reports test classes and test methods that are located in production source trees. This most likely a mistake and can result in test code being shipped into production. Inspection ID: TestInProductSource", + "markdown": "Reports test classes and test methods that are located in production source trees. This most likely a mistake and can result in test code being shipped into production.\n\nInspection ID: TestInProductSource" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TestInProductSource", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Test frameworks", + "index": 100, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CopyConstructorMissesField", + "shortDescription": { + "text": "Copy constructor misses field" + }, + "fullDescription": { + "text": "Reports copy constructors that don't copy all the fields of the class. 'final' fields with initializers and 'transient' fields are considered unnecessary to copy. Example: 'class Point {\n\n private int x;\n private int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n Point(Point other) {\n // fields x and y are not initialized\n }\n }' New in 2018.1 Inspection ID: CopyConstructorMissesField", + "markdown": "Reports copy constructors that don't copy all the fields of the class.\n\n\n`final` fields with initializers and `transient` fields are considered unnecessary to copy.\n\n**Example:**\n\n\n class Point {\n\n private int x;\n private int y;\n\n Point(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n Point(Point other) {\n // fields x and y are not initialized\n }\n }\n\nNew in 2018.1\n\nInspection ID: CopyConstructorMissesField" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CopyConstructorMissesField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InvalidComparatorMethodReference", + "shortDescription": { + "text": "Invalid method reference used for 'Comparator'" + }, + "fullDescription": { + "text": "Reports method references mapped to the 'Comparator' interface that don't fulfill its contract. Some method references, like 'Integer::max', can be mapped to the 'Comparator' interface. However, using them as 'Comparator' is meaningless and the result might be unpredictable. Example: 'ArrayList ints = foo();\n ints.sort(Math::min);' After the quick-fix is applied: 'ArrayList ints = foo();\n ints.sort(Comparator.reverseOrder());' Inspection ID: InvalidComparatorMethodReference", + "markdown": "Reports method references mapped to the `Comparator` interface that don't fulfill its contract.\n\n\nSome method references, like `Integer::max`, can be mapped to the `Comparator` interface.\nHowever, using them as `Comparator` is meaningless and the result might be unpredictable.\n\nExample:\n\n\n ArrayList ints = foo();\n ints.sort(Math::min);\n\nAfter the quick-fix is applied:\n\n\n ArrayList ints = foo();\n ints.sort(Comparator.reverseOrder());\n\nInspection ID: InvalidComparatorMethodReference" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InvalidComparatorMethodReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CastCanBeRemovedNarrowingVariableType", + "shortDescription": { + "text": "Too weak variable type leads to unnecessary cast" + }, + "fullDescription": { + "text": "Reports type casts that can be removed if the variable type is narrowed to the cast type. Example: 'Object x = \" string \";\n System.out.println(((String)x).trim());' Here, changing the type of 'x' to 'String' makes the cast redundant. The suggested quick-fix updates the variable type and removes all redundant casts on that variable: 'String x = \" string \";\n System.out.println(x.trim());' Inspection ID: CastCanBeRemovedNarrowingVariableType New in 2018.2", + "markdown": "Reports type casts that can be removed if the variable type is narrowed to the cast type.\n\nExample:\n\n\n Object x = \" string \";\n System.out.println(((String)x).trim());\n\n\nHere, changing the type of `x` to `String` makes the cast redundant. The suggested quick-fix updates the variable type and\nremoves all redundant casts on that variable:\n\n\n String x = \" string \";\n System.out.println(x.trim());\n\nInspection ID: CastCanBeRemovedNarrowingVariableType\n\nNew in 2018.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CastCanBeRemovedNarrowingVariableType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ToArrayCallWithZeroLengthArrayArgument", + "shortDescription": { + "text": "'Collection.toArray()' call style" + }, + "fullDescription": { + "text": "Reports 'Collection.toArray()' calls that are not in the preferred style, and suggests applying the preferred style. There are two styles to convert a collection to an array: A pre-sized array, for example, 'c.toArray(new String[c.size()])' An empty array, for example, 'c.toArray(new String[0])' In older Java versions, using a pre-sized array was recommended, as the reflection call necessary to create an array of proper size was quite slow. However, since late updates of OpenJDK 6, this call was intrinsified, making the performance of the empty array version the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the 'size' and 'toArray' calls. This may result in extra 'null's at the end of the array if the collection was concurrently shrunk during the operation. Use the inspection options to select the preferred style. Inspection ID: ToArrayCallWithZeroLengthArrayArgument", + "markdown": "Reports `Collection.toArray()` calls that are not in the preferred style, and suggests applying the preferred style.\n\nThere are two styles to convert a collection to an array:\n\n* A pre-sized array, for example, `c.toArray(new String[c.size()])`\n* An empty array, for example, `c.toArray(new String[0])`\n\nIn older Java versions, using a pre-sized array was recommended, as the reflection\ncall necessary to create an array of proper size was quite slow.\n\nHowever, since late updates of OpenJDK 6, this call was intrinsified, making\nthe performance of the empty array version the same, and sometimes even better, compared\nto the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or\nsynchronized collection as a data race is possible between the `size` and `toArray`\ncalls. This may result in extra `null`s at the end of the array if the collection was concurrently\nshrunk during the operation.\n\nUse the inspection options to select the preferred style.\n\nInspection ID: ToArrayCallWithZeroLengthArrayArgument" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ToArrayCallWithZeroLengthArrayArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java9ModuleExportsPackageToItself", + "shortDescription": { + "text": "Module exports/opens package to itself" + }, + "fullDescription": { + "text": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from 'module-info.java'. Example: 'module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }' After the quick-fix is applied: 'module main {\n }' This inspection depends on the Java feature 'Modules', which is available since Java 9. Inspection ID: Java9ModuleExportsPackageToItself", + "markdown": "Reports packages that are exported to, or opened in the same Java 9 module in which they are defined. The quick-fix removes such directives from `module-info.java`.\n\nExample:\n\n\n module com.mycomp {\n exports com.mycomp.main to com.mycomp;\n }\n\nAfter the quick-fix is applied:\n\n\n module main {\n }\n\nThis inspection depends on the Java feature 'Modules', which is available since Java 9.\n\nInspection ID: Java9ModuleExportsPackageToItself" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Java9ModuleExportsPackageToItself", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoggerInitializedWithForeignClass", + "shortDescription": { + "text": "Logger initialized with foreign class" + }, + "fullDescription": { + "text": "Reports 'Logger' instances that are initialized with a 'class' literal from a different class than the 'Logger' is contained in. This can easily happen when copy-pasting some code from another class and may result in logging events under an unexpected category and cause filters to be applied incorrectly. A quick-fix is provided to replace the foreign class literal with one from the surrounding class. Example: 'public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n // ... other fields and methods\n }' After the quick-fix is applied: 'public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Paramount.class);\n\n // ... other fields and methods\n }' Configure the inspection: Use the table to specify the logger factory classes and logger factory methods recognized by this inspection. Use the Ignore loggers initialized with a superclass option to ignore loggers that are initialized with a superclass of the class containing the logger. Use the Ignore loggers in non-public classes to only warn on loggers in 'public' classes. Use the Ignore loggers not initialized in a final field to only report loggers initialized in a final field, other cases will be ignored. Inspection ID: LoggerInitializedWithForeignClass", + "markdown": "Reports `Logger` instances that are initialized with a `class` literal from a different class than the `Logger` is contained in. This can easily happen when copy-pasting some code from another class and may result in logging events under an unexpected category and cause filters to be applied incorrectly.\n\nA quick-fix is provided to replace the foreign class literal with one from the surrounding class.\n\n**Example:**\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Critical.class);\n\n // ... other fields and methods\n }\n\nAfter the quick-fix is applied:\n\n\n public class Paramount {\n protected static final Logger LOG = Logger.getLogger(Paramount.class);\n\n // ... other fields and methods\n }\n\n\nConfigure the inspection:\n\n* Use the table to specify the logger factory classes and logger factory methods recognized by this inspection.\n* Use the **Ignore loggers initialized with a superclass** option to ignore loggers that are initialized with a superclass of the class containing the logger.\n* Use the **Ignore loggers in non-public classes** to only warn on loggers in `public` classes.\n* Use the **Ignore loggers not initialized in a final field** to only report loggers initialized in a final field, other cases will be ignored.\n\nInspection ID: LoggerInitializedWithForeignClass" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "LoggerInitializedWithForeignClass", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Logging", + "index": 98, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkerInterface", + "shortDescription": { + "text": "Marker interface" + }, + "fullDescription": { + "text": "Reports marker interfaces without any methods or fields. Such interfaces may be confusing and typically indicate a design failure. The inspection ignores interfaces that extend two or more interfaces and interfaces that specify the generic type of their superinterface. Inspection ID: MarkerInterface", + "markdown": "Reports marker interfaces without any methods or fields.\n\nSuch interfaces may be confusing and typically indicate a design failure.\n\nThe inspection ignores interfaces that extend two or more interfaces and interfaces\nthat specify the generic type of their superinterface.\n\nInspection ID: MarkerInterface" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MarkerInterface", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CommentedOutCode", + "shortDescription": { + "text": "Commented out code" + }, + "fullDescription": { + "text": "Reports comments that contain Java code. Usually, code that is commented out gets outdated very quickly and becomes misleading. As most projects use some kind of version control system, it is better to delete commented out code completely and use the VCS history instead. New in 2020.3 Inspection ID: CommentedOutCode", + "markdown": "Reports comments that contain Java code.\n\nUsually, code that is commented out gets outdated very quickly and becomes misleading.\nAs most projects use some kind of version control system,\nit is better to delete commented out code completely and use the VCS history instead.\n\nNew in 2020.3\n\nInspection ID: CommentedOutCode" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CommentedOutCode", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToStaticFieldFromInstanceMethod", + "shortDescription": { + "text": "Assignment to static field from instance context" + }, + "fullDescription": { + "text": "Reports assignment to, or modification of 'static' fields from within an instance method. Although legal, such assignments are tricky to do safely and are often a result of marking fields 'static' inadvertently. Example: 'class Counter {\n private static int count = 0;\n\n void increment() {\n // Warning: updating a static field\n // from an instance method\n count++;\n }\n }' Inspection ID: AssignmentToStaticFieldFromInstanceMethod", + "markdown": "Reports assignment to, or modification of `static` fields from within an instance method.\n\nAlthough legal, such assignments are tricky to do\nsafely and are often a result of marking fields `static` inadvertently.\n\n**Example:**\n\n\n class Counter {\n private static int count = 0;\n\n void increment() {\n // Warning: updating a static field\n // from an instance method\n count++;\n }\n }\n\nInspection ID: AssignmentToStaticFieldFromInstanceMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToStaticFieldFromInstanceMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SortedCollectionWithNonComparableKeys", + "shortDescription": { + "text": "Sorted collection with non-comparable elements" + }, + "fullDescription": { + "text": "Reports construction of sorted collections, for example 'TreeSet', that rely on natural ordering, whose element type doesn't implement the 'Comparable' interface. It's unlikely that such a collection will work properly. A false positive is possible if the collection element type is a non-comparable super-type, but the collection is intended to only hold comparable sub-types. Even if this is the case, it's better to narrow the collection element type or declare the super-type as 'Comparable' because the mentioned approach is error-prone. The inspection also reports cases when the collection element is a type parameter which is not declared as 'extends Comparable'. You can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility). New in 2018.3 Inspection ID: SortedCollectionWithNonComparableKeys", + "markdown": "Reports construction of sorted collections, for example `TreeSet`, that rely on natural ordering, whose element type doesn't implement the `Comparable` interface.\n\nIt's unlikely that such a collection will work properly.\n\n\nA false positive is possible if the collection element type is a non-comparable super-type,\nbut the collection is intended to only hold comparable sub-types. Even if this is the case,\nit's better to narrow the collection element type or declare the super-type as `Comparable` because the mentioned approach is error-prone.\n\n\nThe inspection also reports cases when the collection element is a type parameter which is not declared as `extends Comparable`.\nYou can suppress the warnings on type parameters using the provided option (for example, to keep the API compatibility).\n\n\nNew in 2018.3\n\nInspection ID: SortedCollectionWithNonComparableKeys" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SortedCollectionWithNonComparableKeys", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithoutLogger", + "shortDescription": { + "text": "Class without logger" + }, + "fullDescription": { + "text": "Reports classes which do not have a declared logger. Ensuring that every class has a dedicated logger is an important step in providing a unified logging implementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection. For example: 'public class NoLoggerDeclared {\n\n int calculateNthDigitOfPi(int n) {\n // todo\n return 1;\n }\n }' Use the table in the Options section to specify logger class names. Classes which do not declare a field with the type of one of the specified classes will be reported by this inspection. Inspection ID: ClassWithoutLogger", + "markdown": "Reports classes which do not have a declared logger.\n\nEnsuring that every class has a dedicated logger is an important step in providing a unified logging\nimplementation for an application. Interfaces, enumerations, annotations, inner classes, and abstract classes are not reported by this inspection.\n\nFor example:\n\n\n public class NoLoggerDeclared {\n\n int calculateNthDigitOfPi(int n) {\n // todo\n return 1;\n }\n }\n\n\nUse the table in the **Options** section to specify logger class names.\nClasses which do not declare a field with the type of one of the specified classes will be reported by this inspection.\n\nInspection ID: ClassWithoutLogger" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithoutLogger", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Logging", + "index": 98, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReturnOfInnerClass", + "shortDescription": { + "text": "Return of instance of anonymous, local or inner class" + }, + "fullDescription": { + "text": "Reports 'return' statements that return an instance of an anonymous, local, or inner class. Such instances keep an implicit reference to the outer instance, which can prevent the outer instance from being garbage-collected. Any caller of a method returning such an instance might cause a memory leak by holding on to the instance returned. Configure the inspection: Use the Ignore returns from non-public methods option to ignore returns from 'protected' or package-private methods. Returns from 'private' methods are always ignored. Inspection ID: ReturnOfInnerClass", + "markdown": "Reports `return` statements that return an instance of an anonymous, local, or inner class. Such instances keep an implicit reference to the outer instance, which can prevent the outer instance from being garbage-collected. Any caller of a method returning such an instance might cause a memory leak by holding on to the instance returned.\n\n\nConfigure the inspection:\n\n* Use the **Ignore returns from non-public methods** option to ignore returns from `protected` or package-private methods. Returns from `private` methods are always ignored.\n\nInspection ID: ReturnOfInnerClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReturnOfInnerClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Memory", + "index": 69, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnonymousClassComplexity", + "shortDescription": { + "text": "Overly complex anonymous class" + }, + "fullDescription": { + "text": "Reports anonymous inner classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Anonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes. Use the Cyclomatic complexity limit field to specify the maximum allowed complexity for a class. Inspection ID: AnonymousClassComplexity", + "markdown": "Reports anonymous inner classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nAnonymous classes should have very low complexity otherwise they are hard to understand and should be promoted to become named inner classes.\n\nUse the **Cyclomatic complexity limit** field to specify the maximum allowed complexity for a class.\n\nInspection ID: AnonymousClassComplexity" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyComplexAnonymousInnerClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class metrics", + "index": 90, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AbstractClassWithOnlyOneDirectInheritor", + "shortDescription": { + "text": "Abstract class with a single direct inheritor" + }, + "fullDescription": { + "text": "Reports abstract classes that have precisely one direct inheritor. While such classes may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the abstract class with its inheritor. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'abstract class Base {} // will be reported\n\n class Inheritor extends Base {}' Inspection ID: AbstractClassWithOnlyOneDirectInheritor", + "markdown": "Reports abstract classes that have precisely one direct inheritor. While such classes may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the abstract class with its inheritor.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n abstract class Base {} // will be reported\n\n class Inheritor extends Base {}\n\nInspection ID: AbstractClassWithOnlyOneDirectInheritor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AbstractClassWithOnlyOneDirectInheritor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WaitWithoutCorrespondingNotify", + "shortDescription": { + "text": "'wait()' without corresponding 'notify()'" + }, + "fullDescription": { + "text": "Reports calls to 'Object.wait()', for which no call to the corresponding 'Object.notify()' or 'Object.notifyAll()' can be found. This inspection only reports calls with qualifiers referencing fields of the current class. Example: 'public class Foo {\n public Object foo = new Object();\n\n void bar() throws InterruptedException {\n this.foo.wait();\n }\n }' Inspection ID: WaitWithoutCorrespondingNotify", + "markdown": "Reports calls to `Object.wait()`, for which no call to the corresponding `Object.notify()` or `Object.notifyAll()` can be found.\n\nThis inspection only reports calls with qualifiers referencing fields of the current class.\n\n**Example:**\n\n\n public class Foo {\n public Object foo = new Object();\n\n void bar() throws InterruptedException {\n this.foo.wait();\n }\n }\n\nInspection ID: WaitWithoutCorrespondingNotify" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WaitWithoutCorrespondingNotify", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnsecureRandomNumberGeneration", + "shortDescription": { + "text": "Insecure random number generation" + }, + "fullDescription": { + "text": "Reports any uses of 'java.lang.Random' or 'java.lang.Math.random()'. In secure environments, 'java.secure.SecureRandom' is a better choice, since is offers cryptographically secure random number generation. Example: 'long token = new Random().nextLong();' Inspection ID: UnsecureRandomNumberGeneration", + "markdown": "Reports any uses of `java.lang.Random` or `java.lang.Math.random()`.\n\n\nIn secure environments,\n`java.secure.SecureRandom` is a better choice, since is offers cryptographically secure\nrandom number generation.\n\n**Example:**\n\n\n long token = new Random().nextLong();\n\nInspection ID: UnsecureRandomNumberGeneration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnsecureRandomNumberGeneration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NullableProblems", + "shortDescription": { + "text": "@NotNull/@Nullable problems" + }, + "fullDescription": { + "text": "Reports problems related to nullability annotations. Examples: Overriding methods are not annotated: 'abstract class A {\n @NotNull abstract String m();\n}\nclass B extends A {\n String m() { return \"empty string\"; }\n}' Annotated primitive types: '@NotNull int myFoo;' Both '@Nullable' and '@NotNull' are present on the same member: '@Nullable @NotNull String myFooString;' Collection of nullable elements is assigned into a collection of non-null elements: 'void testList(List<@Nullable String> nullableList) {\n List<@NotNull String> list2 = nullableList;\n}' Use the Configure Annotations button to specify nullability annotations and the checkboxes to fine-tune where the inspection should provide warnings. This inspection only reports if the language level of the project or module is 5 or higher, and nullability annotations are available on the classpath. Inspection ID: NullableProblems", + "markdown": "Reports problems related to nullability annotations.\n\n**Examples:**\n\n* Overriding methods are not annotated:\n\n\n abstract class A {\n @NotNull abstract String m();\n }\n class B extends A {\n String m() { return \"empty string\"; }\n }\n \n* Annotated primitive types: `@NotNull int myFoo;`\n* Both `@Nullable` and `@NotNull` are present on the same member: `@Nullable @NotNull String myFooString;`\n* Collection of nullable elements is assigned into a collection of non-null elements:\n\n\n void testList(List<@Nullable String> nullableList) {\n List<@NotNull String> list2 = nullableList;\n }\n \nUse the **Configure Annotations** button to specify nullability annotations and the checkboxes to fine-tune where the inspection should provide warnings.\n\nThis inspection only reports if the language level of the project or module is 5 or higher,\nand nullability annotations are available on the classpath.\n\nInspection ID: NullableProblems" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NullableProblems", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs/Nullability problems", + "index": 121, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfAWTPeerClass", + "shortDescription": { + "text": "Use of AWT peer class" + }, + "fullDescription": { + "text": "Reports uses of AWT peer classes. Such classes represent native windowing system widgets, and will be non-portable between different windowing systems. Example: 'import java.awt.peer.ButtonPeer;\n\n abstract class Sample implements ButtonPeer {\n public void foo() {\n Sample sample;\n }\n }' Inspection ID: UseOfAWTPeerClass", + "markdown": "Reports uses of AWT peer classes. Such classes represent native windowing system widgets, and will be non-portable between different windowing systems.\n\n**Example:**\n\n\n import java.awt.peer.ButtonPeer;\n\n abstract class Sample implements ButtonPeer {\n public void foo() {\n Sample sample;\n }\n }\n\nInspection ID: UseOfAWTPeerClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfAWTPeerClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EqualsBetweenInconvertibleTypes", + "shortDescription": { + "text": "'equals()' between objects of inconvertible types" + }, + "fullDescription": { + "text": "Reports calls to 'equals()' where the target and argument are of incompatible types. While such a call might theoretically be useful, most likely it is a bug. Example: 'new HashSet().equals(new TreeSet());' Inspection ID: EqualsBetweenInconvertibleTypes", + "markdown": "Reports calls to `equals()` where the target and argument are of incompatible types.\n\nWhile such a call might theoretically be useful, most likely it is a bug.\n\n**Example:**\n\n\n new HashSet().equals(new TreeSet());\n\nInspection ID: EqualsBetweenInconvertibleTypes" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EqualsBetweenInconvertibleTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringTemplateReverseMigration", + "shortDescription": { + "text": "String template can be concatenated string" + }, + "fullDescription": { + "text": "Reports string template expressions using the 'STR' processor and offers a quick-fix to migrate back to a plain string concatenation. Example: 'String name = \"Bob\";\n String greeting = STR.\"Hello, \\{name}. You are 29 years old.\";' After the quick-fix is applied: 'String name = \"Bob\";\n String greeting = \"Hello, \" + name + \". You are 29 years old.\";' Inspection ID: StringTemplateReverseMigration New in 2024.2", + "markdown": "Reports string template expressions using the `STR` processor and offers a quick-fix to migrate back to a plain string concatenation.\n\n**Example:**\n\n\n String name = \"Bob\";\n String greeting = STR.\"Hello, \\{name}. You are 29 years old.\";\n\nAfter the quick-fix is applied:\n\n\n String name = \"Bob\";\n String greeting = \"Hello, \" + name + \". You are 29 years old.\";\n\nInspection ID: StringTemplateReverseMigration\n\nNew in 2024.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "StringTemplateReverseMigration", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 21", + "index": 77, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicateCondition", + "shortDescription": { + "text": "Duplicate condition" + }, + "fullDescription": { + "text": "Reports duplicate conditions in '&&' and '||' expressions and branches of 'if' statements. While sometimes duplicate conditions are intended, in most cases they are the result of an oversight. Example: 'boolean result = digit1 != digit2 || digit1 != digit2;' To ignore conditions that may produce side effects, use the Ignore conditions with side effects option. Disabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations. Example: 'native boolean unknownMethod();\n \n ...\n \n if (unknownMethod() || unknownMethod()) {\n System.out.println(\"Got it\");\n }' Due to possible side effects of 'unknownMethod()' (on the example), the warning will only be triggered if the Ignore conditions with side effects option is disabled. Inspection ID: DuplicateCondition", + "markdown": "Reports duplicate conditions in `&&` and `||` expressions and branches of `if` statements. While sometimes duplicate conditions are intended, in most cases they are the result of an oversight.\n\nExample:\n\n\n boolean result = digit1 != digit2 || digit1 != digit2;\n\n\nTo ignore conditions that may produce side effects, use the **Ignore conditions with side effects** option.\nDisabling this option may lead to false-positives, for example, when the same method returns different values on subsequent invocations.\n\nExample:\n\n\n native boolean unknownMethod();\n \n ...\n \n if (unknownMethod() || unknownMethod()) {\n System.out.println(\"Got it\");\n }\n\nDue to possible side effects of `unknownMethod()` (on the example), the warning will only be\ntriggered if the **Ignore conditions with side effects** option is disabled.\n\nInspection ID: DuplicateCondition" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicateCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantExplicitVariableType", + "shortDescription": { + "text": "Local variable type can be omitted" + }, + "fullDescription": { + "text": "Reports redundant local variable types. These types can be inferred from the context and thus replaced with 'var'. Example: 'void test(InputStream s) {\n try (InputStream in = s) {}\n }' After the fix is applied: 'void test(InputStream s) {\n try (var in = s) {}\n }' This inspection depends on the Java feature 'Local variable type inference', which is available since Java 10. Inspection ID: RedundantExplicitVariableType", + "markdown": "Reports redundant local variable types.\n\nThese types can be inferred from the context and thus replaced with `var`.\n\n**Example:**\n\n\n void test(InputStream s) {\n try (InputStream in = s) {}\n }\n\nAfter the fix is applied:\n\n\n void test(InputStream s) {\n try (var in = s) {}\n }\n\n\nThis inspection depends on the Java feature 'Local variable type inference', which is available since Java 10.\n\nInspection ID: RedundantExplicitVariableType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RedundantExplicitVariableType", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 10", + "index": 116, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SynchronizationOnGetClass", + "shortDescription": { + "text": "Synchronization on 'getClass()'" + }, + "fullDescription": { + "text": "Reports synchronization on a call to 'getClass()'. If the class containing the synchronization is subclassed, the subclass will synchronize on a different class object. Usually the call to 'getClass()' can be replaced with a class literal expression, for example 'String.class'. An even better solution is synchronizing on a 'private static final' lock object, access to which can be completely controlled. Example: 'synchronized(getClass()) {}' Inspection ID: SynchronizationOnGetClass", + "markdown": "Reports synchronization on a call to `getClass()`.\n\n\nIf the class containing the synchronization is subclassed, the subclass\nwill\nsynchronize on a different class object. Usually the call to `getClass()` can be replaced with a class literal expression, for\nexample `String.class`. An even better solution is synchronizing on a `private static final` lock object, access to\nwhich can be completely controlled.\n\n**Example:**\n\n synchronized(getClass()) {}\n\nInspection ID: SynchronizationOnGetClass" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SynchronizationOnGetClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThrownExceptionsPerMethod", + "shortDescription": { + "text": "Method with too many exceptions declared" + }, + "fullDescription": { + "text": "Reports methods that have too many types of exceptions in its 'throws' list. Methods with too many exceptions declared are a good sign that your error handling code is getting overly complex. Use the Exceptions thrown limit field to specify the maximum number of exception types a method is allowed to have in its 'throws' list. Inspection ID: ThrownExceptionsPerMethod", + "markdown": "Reports methods that have too many types of exceptions in its `throws` list.\n\nMethods with too many exceptions declared are a good sign that your error handling code is getting overly complex.\n\nUse the **Exceptions thrown limit** field to specify the maximum number of exception types a method is allowed to have in its `throws` list.\n\n\nInspection ID: ThrownExceptionsPerMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodWithTooExceptionsDeclared", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantThrows", + "shortDescription": { + "text": "Redundant 'throws' clause" + }, + "fullDescription": { + "text": "Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and overriding methods. The inspection ignores methods related to serialization, for example the methods 'readObject()' and 'writeObject()'. Example: 'void method() throws InterruptedException {\n System.out.println();\n }' The quick-fix removes unnecessary exceptions from the declaration and normalizes redundant 'try'-'catch' statements: 'void method() {\n System.out.println();\n }' Note: Some exceptions may not be reported during in-editor highlighting for performance reasons. To see all results, run the inspection by selecting Code | Inspect Code or Code | Analyze Code | Run Inspection by Name from the main menu. Use the Ignore exceptions thrown by entry point methods option to not report exceptions thrown by for example 'main()' methods. Entry point methods can be configured in the settings of the Java | Declaration redundancy | Unused declaration inspection. Inspection ID: RedundantThrows", + "markdown": "Reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations and overriding methods.\n\nThe inspection ignores methods related to serialization, for example the methods `readObject()` and `writeObject()`.\n\n**Example:**\n\n\n void method() throws InterruptedException {\n System.out.println();\n }\n\nThe quick-fix removes unnecessary exceptions from the declaration and normalizes redundant `try`-`catch` statements:\n\n\n void method() {\n System.out.println();\n }\n\n\n**Note:** Some exceptions may not be reported during in-editor highlighting for performance reasons.\nTo see all results, run the inspection by selecting **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name** from the main menu.\n\nUse the **Ignore exceptions thrown by entry point methods** option to not report exceptions thrown by\nfor example `main()` methods.\nEntry point methods can be configured in the settings of the\n[Java \\| Declaration redundancy \\| Unused declaration](settings://Errors?Unused%20Declaration%20entry%20point) inspection.\n\nInspection ID: RedundantThrows" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantThrows", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerializableWithUnconstructableAncestor", + "shortDescription": { + "text": "Serializable class with unconstructable ancestor" + }, + "fullDescription": { + "text": "Reports 'Serializable' classes whose closest non-serializable ancestor doesn't have a no-argument constructor. Such classes cannot be deserialized and will fail with an 'InvalidClassException'. Example: 'class Ancestor {\n private String name;\n Ancestor(String name) {\n this.name = name;\n }\n }\n\n // warning on this class because the superclass is not\n // serializable, and its constructor takes arguments\n class Descendant extends Ancestor implements Serializable {\n Descendant() {\n super(\"Bob\");\n }\n }' Inspection ID: SerializableWithUnconstructableAncestor", + "markdown": "Reports `Serializable` classes whose closest non-serializable ancestor doesn't have a no-argument constructor. Such classes cannot be deserialized and will fail with an `InvalidClassException`.\n\n**Example:**\n\n\n class Ancestor {\n private String name;\n Ancestor(String name) {\n this.name = name;\n }\n }\n\n // warning on this class because the superclass is not\n // serializable, and its constructor takes arguments\n class Descendant extends Ancestor implements Serializable {\n Descendant() {\n super(\"Bob\");\n }\n }\n\nInspection ID: SerializableWithUnconstructableAncestor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SerializableClassWithUnconstructableAncestor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExcessiveLambdaUsage", + "shortDescription": { + "text": "Excessive lambda usage" + }, + "fullDescription": { + "text": "Reports if a trivial lambda expression is used in cases in which there's an alternative method that behaves in the same way, but accepts a concrete value instead of a lambda. This inspection helps simplify the code. Example: 'Optional.orElseGet(() -> null)' After the quick-fix is applied: 'Optional.orElse(null)' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: ExcessiveLambdaUsage New in 2017.1", + "markdown": "Reports if a trivial lambda expression is used in cases in which there's an alternative method that behaves in the same way, but accepts a concrete value instead of a lambda.\n\nThis inspection helps simplify the code.\n\nExample:\n\n\n Optional.orElseGet(() -> null)\n\nAfter the quick-fix is applied:\n\n\n Optional.orElse(null)\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: ExcessiveLambdaUsage\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExcessiveLambdaUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LambdaBodyCanBeCodeBlock", + "shortDescription": { + "text": "Lambda body can be code block" + }, + "fullDescription": { + "text": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks. Example: 'n -> n + 1' After the quick-fix is applied: 'n -> {\n return n + 1;\n}' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: LambdaBodyCanBeCodeBlock", + "markdown": "Reports lambdas whose body is an expression and suggests converting expression bodies to code blocks.\n\nExample:\n\n\n n -> n + 1\n\nAfter the quick-fix is applied:\n\n n -> {\n return n + 1;\n }\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: LambdaBodyCanBeCodeBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LambdaBodyCanBeCodeBlock", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParameterHidingMemberVariable", + "shortDescription": { + "text": "Parameter hides field" + }, + "fullDescription": { + "text": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended. A quick-fix is suggested to rename the parameter. Example: 'class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }' You can configure the following options for this inspection: Ignore for property setters - ignore parameters of simple setters. Ignore superclass fields not visible from subclass - ignore 'private' fields in a superclass, which are not visible from the method. Ignore for constructors - ignore parameters of constructors. Ignore for abstract methods - ignore parameters of abstract methods. Ignore for static method parameters hiding instance fields - ignore parameters of 'static' methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing. Inspection ID: ParameterHidingMemberVariable", + "markdown": "Reports method parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the parameter when using the identically named field is intended.\n\nA quick-fix is suggested to rename the parameter.\n\n**Example:**\n\n\n class Main {\n private String value;\n\n public Main(String value) {\n value = value.toUpperCase();\n }\n }\n \n\nYou can configure the following options for this inspection:\n\n1. **Ignore for property setters** - ignore parameters of simple setters.\n2. **Ignore superclass fields not visible from subclass** - ignore `private` fields in a superclass, which are not visible from the method.\n3. **Ignore for constructors** - ignore parameters of constructors.\n4. **Ignore for abstract methods** - ignore parameters of abstract methods.\n5. **Ignore for static method parameters hiding instance fields** - ignore parameters of `static` methods hiding an instance field and to ignore parameters of instance methods in static inner classes hiding an instance field of an outer class. While not strictly hiding, such parameters can still be confusing.\n\nInspection ID: ParameterHidingMemberVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ParameterHidesMemberVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfAnotherObjectsPrivateField", + "shortDescription": { + "text": "Accessing a non-public field of another object" + }, + "fullDescription": { + "text": "Reports accesses to 'private' or 'protected' fields of another object. Java allows access to such fields for objects of the same class as the current object but some coding styles discourage this use. Additionally, such direct access to 'private' fields may fail in component-oriented architectures, such as Spring or Hibernate, that expect all access to other objects to be through method calls so the framework can mediate access using proxies. Example: 'public class Base {\n protected int bar;\n\n void increment(Base base) {\n bar++;\n base.bar++; // warning: direct access to another object's non-public field\n }\n }' A quick-fix to encapsulate the field is available. Configure the inspection: Use the Ignore accesses from the same class option to ignore access from the same class and only report access from inner or outer classes. To ignore access from inner classes as well, use the nested Ignore accesses from inner classes. Use the Ignore accesses from 'equals()' method to ignore access from an 'equals()' method. Inspection ID: UseOfAnotherObjectsPrivateField", + "markdown": "Reports accesses to `private` or `protected` fields of another object. Java allows access to such fields for objects of the same class as the current object but some coding styles discourage this use. Additionally, such direct access to `private` fields may fail in component-oriented architectures, such as Spring or Hibernate, that expect all access to other objects to be through method calls so the framework can mediate access using proxies.\n\n**Example:**\n\n\n public class Base {\n protected int bar;\n\n void increment(Base base) {\n bar++;\n base.bar++; // warning: direct access to another object's non-public field\n }\n }\n\nA quick-fix to encapsulate the field is available.\n\nConfigure the inspection:\n\n* Use the **Ignore accesses from the same class** option to ignore access from the same class and only report access from inner or outer classes.\n\n To ignore access from inner classes as well, use the nested **Ignore accesses from inner classes**.\n* Use the **Ignore accesses from 'equals()' method** to ignore access from an `equals()` method.\n\nInspection ID: UseOfAnotherObjectsPrivateField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AccessingNonPublicFieldOfAnotherObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Encapsulation", + "index": 59, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PointlessBitwiseExpression", + "shortDescription": { + "text": "Pointless bitwise expression" + }, + "fullDescription": { + "text": "Reports pointless bitwise expressions. Such expressions include applying the '&' operator to the maximum value for the given type, applying the 'or' operator to zero, and shifting by zero. Such expressions may be the result of automated refactorings not followed through to completion and are unlikely to be originally intended. Examples: '// Warning: operation is pointless and can be replaced with just `flags`\n // 0xFFFF_FFFF is the maximum value for an integer, and both literals are treated\n // as 32 bit integer literals.\n int bits = flags & 0xFFFF_FFFF;\n\n // Warning: operation is pointless and can be replaced with just `bits`\n // OR-ing with 0 always outputs the other operand.\n int or = bits | 0x0;\n\n // Warning: operation is pointless, as always results in 0\n int xor = or ^ or;' Inspection ID: PointlessBitwiseExpression", + "markdown": "Reports pointless bitwise expressions.\n\n\nSuch expressions include applying the `&` operator to the maximum value for the given type, applying the\n`or` operator to zero, and shifting by zero. Such expressions may be the result of automated\nrefactorings not followed through to completion and are unlikely to be originally intended.\n\n**Examples:**\n\n\n // Warning: operation is pointless and can be replaced with just `flags`\n // 0xFFFF_FFFF is the maximum value for an integer, and both literals are treated\n // as 32 bit integer literals.\n int bits = flags & 0xFFFF_FFFF;\n\n // Warning: operation is pointless and can be replaced with just `bits`\n // OR-ing with 0 always outputs the other operand.\n int or = bits | 0x0;\n\n // Warning: operation is pointless, as always results in 0\n int xor = or ^ or;\n\nInspection ID: PointlessBitwiseExpression" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PointlessBitwiseExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Bitwise operation issues", + "index": 103, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CustomSecurityManager", + "shortDescription": { + "text": "Custom 'SecurityManager'" + }, + "fullDescription": { + "text": "Reports user-defined subclasses of 'java.lang.SecurityManager'. While not necessarily representing a security hole, such classes should be thoroughly and professionally inspected for possible security issues. Example: 'class CustomSecurityManager extends SecurityManager {\n }' Inspection ID: CustomSecurityManager", + "markdown": "Reports user-defined subclasses of `java.lang.SecurityManager`.\n\n\nWhile not necessarily representing a security hole, such classes should be thoroughly\nand professionally inspected for possible security issues.\n\n**Example:**\n\n\n class CustomSecurityManager extends SecurityManager {\n }\n\nInspection ID: CustomSecurityManager" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CustomSecurityManager", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectEquality", + "shortDescription": { + "text": "Object comparison using '==', instead of 'equals()'" + }, + "fullDescription": { + "text": "Reports code that uses '==' or '!=' rather than 'equals()' to test for object equality. Comparing objects using '==' or '!=' is often a bug, because it compares objects by identity instead of equality. Comparisons to 'null' are not reported. Array, 'String' and 'Number' comparisons are reported by separate inspections. Example: 'if (list1 == list2) {\n return;\n }' After the quick-fix is applied: 'if (Objects.equals(list1, list2)) {\n return;\n }' Use the inspection settings to configure exceptions for this inspection. Inspection ID: ObjectEquality", + "markdown": "Reports code that uses `==` or `!=` rather than `equals()` to test for object equality.\n\n\nComparing objects using `==` or `!=` is often a bug,\nbecause it compares objects by identity instead of equality.\nComparisons to `null` are not reported.\n\n\nArray, `String` and `Number` comparisons are reported by separate inspections.\n\n**Example:**\n\n if (list1 == list2) {\n return;\n }\n\nAfter the quick-fix is applied:\n\n if (Objects.equals(list1, list2)) {\n return;\n }\n\nUse the inspection settings to configure exceptions for this inspection.\n\nInspection ID: ObjectEquality" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ObjectEquality", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TimeToString", + "shortDescription": { + "text": "Call to 'Time.toString()'" + }, + "fullDescription": { + "text": "Reports 'toString()' calls on 'java.sql.Time' objects. Such calls are usually incorrect in an internationalized environment. Inspection ID: TimeToString", + "markdown": "Reports `toString()` calls on `java.sql.Time` objects. Such calls are usually incorrect in an internationalized environment.\n\nInspection ID: TimeToString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToTimeToString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicateThrows", + "shortDescription": { + "text": "Duplicate throws" + }, + "fullDescription": { + "text": "Reports duplicate exceptions in a method 'throws' list. Example: 'void f() throws Exception, Exception {}' After the quick-fix is applied: 'void f() throws Exception {}' Use the Ignore exceptions subclassing others option to ignore exceptions subclassing other exceptions. Inspection ID: DuplicateThrows", + "markdown": "Reports duplicate exceptions in a method `throws` list.\n\nExample:\n\n\n void f() throws Exception, Exception {}\n\nAfter the quick-fix is applied:\n\n\n void f() throws Exception {}\n\n\nUse the **Ignore exceptions subclassing others** option to ignore exceptions subclassing other exceptions.\n\nInspection ID: DuplicateThrows" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicateThrows", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnstableTypeUsedInSignature", + "shortDescription": { + "text": "Unstable type is used in signature" + }, + "fullDescription": { + "text": "Reports declarations of classes, methods, and fields that reference an unstable API type in the signature, but are not marked with the same unstable annotation. This inspection ensures that the signatures of a public API do not expose any unstable (internal, experimental) types. For example, if a method returns an experimental class, the method itself is considered experimental because incompatible changes of the type (deletion or move to another package) lead to incompatible method signature changes. Use the list below to specify which annotations mark an unstable API. Inspection ID: UnstableTypeUsedInSignature", + "markdown": "Reports declarations of classes, methods, and fields that reference an unstable API type in the signature, but are not marked with the same unstable annotation.\n\n\nThis inspection ensures that the signatures of a public API do not expose any *unstable* (internal, experimental) types.\nFor example, if a method returns an *experimental* class, the method itself is considered *experimental*\nbecause incompatible changes of the type (deletion or move to another package) lead to incompatible method signature changes.\n\nUse the list below to specify which annotations mark an unstable API.\n\nInspection ID: UnstableTypeUsedInSignature" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnstableTypeUsedInSignature", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PrivateMemberAccessBetweenOuterAndInnerClass", + "shortDescription": { + "text": "Synthetic accessor call" + }, + "fullDescription": { + "text": "Reports references from a nested class to non-constant 'private' members of an outer class. For such references, javac will generate package-private synthetic accessor methods, which may compromise the security because members appearing to be private will in fact be accessible from the entire package. A nested class and its outer class are compiled to separate class files. The Java virtual machine normally prohibits access from a class to private fields and methods of another class. To enable access from a nested class to private members of an outer class, javac creates a package-private synthetic accessor method. By making the 'private' member package-private instead, the actual accessibility is made explicit. This also saves a little bit of memory, which may improve performance in resource constrained environments. This inspection only reports if the language level of the project or module is 10 or lower. Under Java 11 and higher accessor methods are not generated anymore, because of nest-based access control (JEP 181). Example: 'class Outer {\n private void x() {}\n\n class Inner {\n void y() {\n x();\n }\n }\n }' After the quick fix is applied: 'class Outer {\n void x() {}\n\n class Inner {\n void y() {\n x();\n }\n }\n }' Inspection ID: PrivateMemberAccessBetweenOuterAndInnerClass", + "markdown": "Reports references from a nested class to non-constant `private` members of an outer class. For such references, javac will generate package-private synthetic accessor methods, which may compromise the security because members appearing to be private will in fact be accessible from the entire package.\n\n\nA nested class and its outer class are compiled to separate\nclass files. The Java virtual machine normally prohibits access from a class to private fields and methods of\nanother class. To enable access from a nested class to private members of an outer class, javac creates a package-private\nsynthetic accessor method.\n\n\nBy making the `private` member package-private instead, the actual accessibility is made explicit.\nThis also saves a little bit of memory, which may improve performance in resource constrained environments.\n\n\nThis inspection only reports if the language level of the project or module is 10 or lower.\nUnder Java 11 and higher accessor methods are not generated anymore,\nbecause of nest-based access control ([JEP 181](https://openjdk.org/jeps/181)).\n\n**Example:**\n\n\n class Outer {\n private void x() {}\n\n class Inner {\n void y() {\n x();\n }\n }\n }\n\nAfter the quick fix is applied:\n\n\n class Outer {\n void x() {}\n\n class Inner {\n void y() {\n x();\n }\n }\n }\n\nInspection ID: PrivateMemberAccessBetweenOuterAndInnerClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SyntheticAccessorCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassIndependentOfModule", + "shortDescription": { + "text": "Class independent of its module" + }, + "fullDescription": { + "text": "Reports classes that: do not depend on any other class in their module are not a dependency for any other class in their module Such classes are an indication of ad-hoc or incoherent modularisation strategies, and may often profitably be moved. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassIndependentOfModule", + "markdown": "Reports classes that:\n\n* do not depend on any other class in their module\n* are not a dependency for any other class in their module\n\nSuch classes are an indication of ad-hoc or incoherent modularisation strategies,\nand may often profitably be moved.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassIndependentOfModule" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassIndependentOfModule", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Modularization issues", + "index": 66, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SystemRunFinalizersOnExit", + "shortDescription": { + "text": "Call to 'System.runFinalizersOnExit()'" + }, + "fullDescription": { + "text": "Reports calls to 'System.runFinalizersOnExit()'. This call is one of the most dangerous in the Java language. It is inherently non-thread-safe, may result in data corruption, a deadlock, and may affect parts of the program far removed from its call point. It is deprecated and was removed in JDK 11, and its use is strongly discouraged. This inspection only reports if the language level of the project or module is 10 or lower. Inspection ID: SystemRunFinalizersOnExit", + "markdown": "Reports calls to `System.runFinalizersOnExit()`.\n\n\nThis call is one of the most dangerous in the Java language. It is inherently non-thread-safe,\nmay result in data corruption, a deadlock, and may affect parts of the program far removed from its call point.\nIt is deprecated and was removed in JDK 11, and its use is strongly discouraged.\n\nThis inspection only reports if the language level of the project or module is 10 or lower.\n\nInspection ID: SystemRunFinalizersOnExit" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CallToSystemRunFinalizersOnExit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PatternVariablesCanBeReplacedWithCast", + "shortDescription": { + "text": "Using 'instanceof' with patterns" + }, + "fullDescription": { + "text": "Reports 'instanceof' with patterns and suggests converting them to ordinary 'instanceof' with casts. This inspection makes it possible to move 'instanceof' with patterns to a codebase using an earlier Java version by applying the quick-fix. Note that the result can be not completely equivalent to the original 'instanceof' with patterns when a complex expression before 'instanceof' is used. In this case this expression will be reevaluated. Example: 'if (object instanceof String txt && txt.length() == 1) {\n System.out.println(txt);\n } else {\n return;\n }\n System.out.println(txt);' After the quick-fix is applied: 'if (object instanceof String && ((String) object).length() ==1) {\n String txt = (String) object;\n System.out.println(txt);\n } else {\n return;\n }\n String txt = (String) object;\n System.out.println(txt);' Inspection ID: PatternVariablesCanBeReplacedWithCast New in 2023.1", + "markdown": "Reports `instanceof` with patterns and suggests converting them to ordinary `instanceof` with casts.\n\nThis inspection makes it possible to move `instanceof` with patterns to a codebase using an earlier Java version\nby applying the quick-fix.\n\n\nNote that the result can be not completely equivalent to the original `instanceof` with patterns when\na complex expression before `instanceof` is used. In this case this expression will be reevaluated.\n\nExample:\n\n\n if (object instanceof String txt && txt.length() == 1) {\n System.out.println(txt);\n } else {\n return;\n }\n System.out.println(txt);\n\nAfter the quick-fix is applied:\n\n\n if (object instanceof String && ((String) object).length() ==1) {\n String txt = (String) object;\n System.out.println(txt);\n } else {\n return;\n }\n String txt = (String) object;\n System.out.println(txt);\n\nInspection ID: PatternVariablesCanBeReplacedWithCast\n\nNew in 2023.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "PatternVariablesCanBeReplacedWithCast", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParameterTypePreventsOverriding", + "shortDescription": { + "text": "Parameter type prevents overriding" + }, + "fullDescription": { + "text": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method. Example: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n}' After the quick-fix is applied: 'public class A {\n public void method(Object o) {}\n}\n\npublic class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n}' Inspection ID: ParameterTypePreventsOverriding", + "markdown": "Reports parameter types of a subclass method that have the same name as the parameter type of the corresponding super method but belong to a different package. In these cases, the subclass method cannot override the super method.\n\n**Example:**\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(Object o) {} // warning on parameter type\n class Object {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class A {\n public void method(Object o) {}\n }\n\n public class B extends A {\n public void method(java.lang.Object o) {} // new parameter type\n class Object {}\n }\n\n\nInspection ID: ParameterTypePreventsOverriding" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ParameterTypePreventsOverriding", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceInefficientStreamCount", + "shortDescription": { + "text": "Inefficient Stream API call chains ending with count()" + }, + "fullDescription": { + "text": "Reports Stream API call chains ending with a 'count()' operation, that are optimizable. The following call chains can be replaced by this inspection: 'Collection.stream().count()' → 'Collection.size()'. In Java 8 'Collection.stream().count()' actually iterates over the collection elements to count them, while 'Collection.size()' is much faster for most of the collections. 'Stream.flatMap(Collection::stream).count()' → 'Stream.mapToLong(Collection::size).sum()'. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up. 'Stream.filter(o -> ...).count() > 0' → 'Stream.anyMatch(o -> ...)'. Unlike the original call, 'anyMatch()' may stop the computation as soon as a matching element is found. 'Stream.filter(o -> ...).count() == 0' → 'Stream.noneMatch(o -> ...)'. Similar to the above. Note that if the replacement involves a short-circuiting operation like 'anyMatch()', there could be a visible behavior change, if the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: ReplaceInefficientStreamCount", + "markdown": "Reports Stream API call chains ending with a `count()` operation, that are optimizable.\n\n\nThe following call chains can be replaced by this inspection:\n\n* `Collection.stream().count()` → `Collection.size()`. In Java 8 `Collection.stream().count()` actually iterates over the collection elements to count them, while `Collection.size()` is much faster for most of the collections.\n* `Stream.flatMap(Collection::stream).count()` → `Stream.mapToLong(Collection::size).sum()`. Similarly, there's no need to iterate over all the nested collections. Instead, their sizes could be summed up.\n* `Stream.filter(o -> ...).count() > 0` → `Stream.anyMatch(o -> ...)`. Unlike the original call, `anyMatch()` may stop the computation as soon as a matching element is found.\n* `Stream.filter(o -> ...).count() == 0` → `Stream.noneMatch(o -> ...)`. Similar to the above.\n\n\nNote that if the replacement involves a short-circuiting operation like `anyMatch()`, there could be a visible behavior change,\nif the intermediate stream operations produce side effects. In general, side effects should be avoided in Stream API calls.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: ReplaceInefficientStreamCount" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ReplaceInefficientStreamCount", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ManualArrayToCollectionCopy", + "shortDescription": { + "text": "Manual array to collection copy" + }, + "fullDescription": { + "text": "Reports code that uses a loop to copy the contents of an array into a collection. A shorter and potentially faster (depending on the collection implementation) way to do this is using 'Collection.addAll(Arrays.asList())' or 'Collections.addAll()'. Only loops without additional statements inside are reported. Example: 'void addAll(List list, String[] arr) {\n for (int i = 0; i < arr.length; i++) {\n String s = arr[i];\n list.add(s);\n }\n }' After the quick-fix is applied: 'void addAll(List list, String[] arr) {\n Collections.addAll(list, arr);\n }' Inspection ID: ManualArrayToCollectionCopy", + "markdown": "Reports code that uses a loop to copy the contents of an array into a collection.\n\n\nA shorter and potentially faster (depending on the collection implementation) way to do this is using `Collection.addAll(Arrays.asList())` or `Collections.addAll()`.\n\n\nOnly loops without additional statements inside are reported.\n\n**Example:**\n\n\n void addAll(List list, String[] arr) {\n for (int i = 0; i < arr.length; i++) {\n String s = arr[i];\n list.add(s);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void addAll(List list, String[] arr) {\n Collections.addAll(list, arr);\n }\n\n\nInspection ID: ManualArrayToCollectionCopy" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ManualArrayToCollectionCopy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwitchLabeledRuleCanBeCodeBlock", + "shortDescription": { + "text": "Labeled switch rule can have code block" + }, + "fullDescription": { + "text": "Reports rules of 'switch' expressions or enhanced 'switch' statements with an expression body. These can be converted to code blocks. Example: 'String message = switch (errorCode) {\n case 404 -> \"Not found!\";\n ...\n };' After the quick-fix is applied: 'String message = switch (errorCode) {\n case 404 -> {\n yield \"Not found!\";\n }\n ...\n };' This inspection depends on the Java feature 'Enhanced 'switch' blocks', which is available since Java 14. Inspection ID: SwitchLabeledRuleCanBeCodeBlock New in 2019.1", + "markdown": "Reports rules of `switch` expressions or enhanced `switch` statements with an expression body. These can be converted to code blocks.\n\nExample:\n\n\n String message = switch (errorCode) {\n case 404 -> \"Not found!\";\n ...\n };\n\nAfter the quick-fix is applied:\n\n\n String message = switch (errorCode) {\n case 404 -> {\n yield \"Not found!\";\n }\n ...\n };\n\nThis inspection depends on the Java feature 'Enhanced 'switch' blocks', which is available since Java 14.\n\nInspection ID: SwitchLabeledRuleCanBeCodeBlock\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SwitchLabeledRuleCanBeCodeBlock", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExtractMethodRecommender", + "shortDescription": { + "text": "Method can be extracted" + }, + "fullDescription": { + "text": "Suggests extracting fragments of code to a separate method to make code more clear. This inspection has a number of heuristics to select good candidates for extraction, including the following ones. The extracted fragment has no non-local control flow The extracted fragment has exactly one output variable There are no similar uses of output variable inside the extracted fragment and outside it The extracted fragment has only few input parameters (no more than three by default; configured with the inspection option) The extracted fragment is not smaller than the configured length (500 characters by default) but no bigger than 60% of the containing method body Inspection ID: ExtractMethodRecommender", + "markdown": "Suggests extracting fragments of code to a separate method to make code more clear. This inspection has a number of heuristics to select good candidates for extraction, including the following ones.\n\n* The extracted fragment has no non-local control flow\n* The extracted fragment has exactly one output variable\n* There are no similar uses of output variable inside the extracted fragment and outside it\n* The extracted fragment has only few input parameters (no more than three by default; configured with the inspection option)\n* The extracted fragment is not smaller than the configured length (500 characters by default) but no bigger than 60% of the containing method body\n\nInspection ID: ExtractMethodRecommender" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExtractMethodRecommender", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringOperationCanBeSimplified", + "shortDescription": { + "text": "Redundant 'String' operation" + }, + "fullDescription": { + "text": "Reports redundant calls to 'String' constructors and methods like 'toString()' or 'substring()' that can be replaced with a simpler expression. For example, calls to these methods can be safely removed in code like '\"string\".substring(0)', '\"string\".toString()', or 'new StringBuilder().toString().substring(1,3)'. Example: 'System.out.println(new String(\"message\"));' After the quick-fix is applied: 'System.out.println(\"message\");' Note that the quick-fix removes the redundant constructor call, and this may affect 'String' referential equality. If you need to preserve it, even though it is considered bad practice, suppress the warning or use the inspection setting to ignore redundant 'String' constructor calls. Use the Do not report String constructor calls option below to not report code like the example above. This will avoid changing the outcome of String comparisons with '==' or '!=' after applying the quick-fix in code that uses 'new String()' calls to guarantee a different object identity. Use the Do not report single argument substring() calls option below to not report code like the following. 'stringBuilder.append(string.substring(5));' which can be replaced with the following. 'stringBuilder.append(string, 5, string.length());' Inspection ID: StringOperationCanBeSimplified New in 2018.1", + "markdown": "Reports redundant calls to `String` constructors and methods like `toString()` or `substring()` that can be replaced with a simpler expression.\n\nFor example, calls to these methods can be safely removed in code\nlike `\"string\".substring(0)`, `\"string\".toString()`, or\n`new StringBuilder().toString().substring(1,3)`.\n\nExample:\n\n\n System.out.println(new String(\"message\"));\n\nAfter the quick-fix is applied:\n\n\n System.out.println(\"message\");\n\n\nNote that the quick-fix removes the redundant constructor call, and this may affect `String` referential equality.\nIf you need to preserve it, even though it is considered bad practice, suppress the warning or use the inspection setting to ignore\nredundant `String` constructor calls.\n\n\nUse the **Do not report String constructor calls** option below to not report code like the example above.\nThis will avoid changing the outcome of String comparisons with `==` or `!=` after applying\nthe quick-fix in code that uses `new String()` calls to guarantee a different object identity.\n\n\nUse the **Do not report single argument substring() calls** option below to not report code like the following.\n\n\n stringBuilder.append(string.substring(5));\n\nwhich can be replaced with the following.\n\n\n stringBuilder.append(string, 5, string.length());\n\nInspection ID: StringOperationCanBeSimplified\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringOperationCanBeSimplified", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassReferencesSubclass", + "shortDescription": { + "text": "Class references one of its subclasses" + }, + "fullDescription": { + "text": "Reports classes which contain references to one of their subclasses. Such references may be confusing and violate several rules of object-oriented design. Example: 'class Entity {\n // Warning: the class references its subclass\n void compare(SimpleEntity entity) {\n ...\n }\n }\n class SimpleEntity extends Entity {\n ...\n }' Inspection ID: ClassReferencesSubclass", + "markdown": "Reports classes which contain references to one of their subclasses. Such references may be confusing and violate several rules of object-oriented design.\n\nExample:\n\n\n class Entity {\n // Warning: the class references its subclass\n void compare(SimpleEntity entity) {\n ...\n }\n }\n class SimpleEntity extends Entity {\n ...\n }\n\nInspection ID: ClassReferencesSubclass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassReferencesSubclass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaReflectionMemberAccess", + "shortDescription": { + "text": "Reflective access to non-existent or not visible class member" + }, + "fullDescription": { + "text": "Reports reflective access to fields and methods that don't exist or aren't visible. Example: 'Field stringHashField() throws NoSuchFieldException {\n return String.class.getField(\"hash\");\n }' After the quick-fix is applied: 'Field stringHashField() throws NoSuchFieldException {\n return String.class.getDeclaredField(\"hash\");\n }' With a 'final' class, it's clear if there is a field or method with the specified name in the class. With non-'final' classes, it's possible that a subclass has a field or method with that name, so there could be false positives. Use the inspection's settings to get rid of such false positives everywhere or with specific classes. Inspection ID: JavaReflectionMemberAccess New in 2017.2", + "markdown": "Reports reflective access to fields and methods that don't exist or aren't visible.\n\nExample:\n\n\n Field stringHashField() throws NoSuchFieldException {\n return String.class.getField(\"hash\");\n }\n\nAfter the quick-fix is applied:\n\n\n Field stringHashField() throws NoSuchFieldException {\n return String.class.getDeclaredField(\"hash\");\n }\n\n\nWith a `final` class, it's clear if there is a field or method with the specified name in the class.\n\n\nWith non-`final` classes, it's possible that a subclass has a field or method with that name, so there could be false positives.\nUse the inspection's settings to get rid of such false positives everywhere or with specific classes.\n\nInspection ID: JavaReflectionMemberAccess\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "JavaReflectionMemberAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Reflective access", + "index": 104, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObviousNullCheck", + "shortDescription": { + "text": "Null-check method is called with obviously non-null argument" + }, + "fullDescription": { + "text": "Reports if a null-checking method (for example, 'Objects.requireNonNull' or 'Assert.assertNotNull') is called on a value that is obviously non-null (for example, a newly created object). Such a check is redundant and may indicate a programming error. Example: 'final String greeting = Objects.requireNonNull(\"Hi!\");' After the quick-fix is applied: 'final String greeting = \"Hi!\";' New in 2017.2 Inspection ID: ObviousNullCheck", + "markdown": "Reports if a null-checking method (for example, `Objects.requireNonNull` or `Assert.assertNotNull`) is called on a value that is obviously non-null (for example, a newly created object). Such a check is redundant and may indicate a programming error.\n\n**Example:**\n\n\n final String greeting = Objects.requireNonNull(\"Hi!\");\n\nAfter the quick-fix is applied:\n\n\n final String greeting = \"Hi!\";\n\nNew in 2017.2\n\nInspection ID: ObviousNullCheck" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ObviousNullCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerialVersionUIDNotStaticFinal", + "shortDescription": { + "text": "'serialVersionUID' field not declared 'private static final long'" + }, + "fullDescription": { + "text": "Reports 'Serializable' classes whose 'serialVersionUID' field is not declared 'private static final long'. Example: 'class SampleClass implements Serializable {\n private long serialVersionUID = 1; // field of a Serializable class is not declared 'private static final long'\n\n public SampleClass() {\n System.out.println(serialVersionUID);\n }\n }' Inspection ID: SerialVersionUIDNotStaticFinal", + "markdown": "Reports `Serializable` classes whose `serialVersionUID` field is not declared `private static final long`.\n\n**Example:**\n\n\n class SampleClass implements Serializable {\n private long serialVersionUID = 1; // field of a Serializable class is not declared 'private static final long'\n\n public SampleClass() {\n System.out.println(serialVersionUID);\n }\n }\n\nInspection ID: SerialVersionUIDNotStaticFinal" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SerialVersionUIDWithWrongSignature", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InnerClassOnInterface", + "shortDescription": { + "text": "Inner class of interface" + }, + "fullDescription": { + "text": "Reports inner classes in 'interface' classes. Some coding standards discourage the use of such classes. The inspection doesn't report enum classes and annotation interfaces. Use the Ignore inner interfaces of interfaces option to ignore inner interfaces. For example: 'interface I {\n interface Inner {\n }\n }' Inspection ID: InnerClassOnInterface", + "markdown": "Reports inner classes in `interface` classes.\n\nSome coding standards\ndiscourage the use of such classes. The inspection doesn't report enum classes and annotation interfaces.\n\n\nUse the **Ignore inner interfaces of interfaces** option to ignore inner interfaces. For example:\n\n\n interface I {\n interface Inner {\n }\n }\n\nInspection ID: InnerClassOnInterface" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InnerClassOfInterface", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DateToString", + "shortDescription": { + "text": "Call to 'Date.toString()'" + }, + "fullDescription": { + "text": "Reports 'toString()' calls on 'java.util.Date' objects. Such calls are usually incorrect in an internationalized environment. Inspection ID: DateToString", + "markdown": "Reports `toString()` calls on `java.util.Date` objects. Such calls are usually incorrect in an internationalized environment.\n\nInspection ID: DateToString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToDateToString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IterableUsedAsVararg", + "shortDescription": { + "text": "Iterable is used as vararg" + }, + "fullDescription": { + "text": "Reports suspicious usages of 'Collection' or 'Iterable' in vararg method calls. For example, in the following method: ' boolean contains(T needle, T... haystack) {...}' a call like 'if(contains(\"item\", listOfStrings)) {...}' looks suspicious as the list will be wrapped into a single element array. Such code can be successfully compiled and will likely run without exceptions, but it's probably used by mistake. This inspection depends on the Java feature 'Variable arity methods', which is available since Java 5. Inspection ID: IterableUsedAsVararg New in 2019.2", + "markdown": "Reports suspicious usages of `Collection` or `Iterable` in vararg method calls.\n\nFor example, in the following method:\n\n\n boolean contains(T needle, T... haystack) {...}\n\na call like\n\n\n if(contains(\"item\", listOfStrings)) {...}\n\nlooks suspicious as the list will be wrapped into a single element array.\nSuch code can be successfully compiled and will likely run without\nexceptions, but it's probably used by mistake.\n\nThis inspection depends on the Java feature 'Variable arity methods', which is available since Java 5.\n\nInspection ID: IterableUsedAsVararg\n\nNew in 2019.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IterableUsedAsVararg", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodNameSameAsParentName", + "shortDescription": { + "text": "Method name same as parent class name" + }, + "fullDescription": { + "text": "Reports methods that have the same name as the superclass of the method's class, as such a method name may be confusing. This inspection doesn't check interfaces or superclasses deep in the hierarchy. Example: 'class Parent {}\n class Child extends Parent {\n public Parent Parent() {\n return null;\n }\n }' A quick-fix that renames such methods is available only in the editor. Inspection ID: MethodNameSameAsParentName", + "markdown": "Reports methods that have the same name as the superclass of the method's class, as such a method name may be confusing.\n\nThis inspection doesn't check interfaces or superclasses deep in the hierarchy.\n\n**Example:**\n\n\n class Parent {}\n class Child extends Parent {\n public Parent Parent() {\n return null;\n }\n }\n\nA quick-fix that renames such methods is available only in the editor.\n\n\nInspection ID: MethodNameSameAsParentName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodNameSameAsParentName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Method", + "index": 91, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnreachableCatch", + "shortDescription": { + "text": "Unreachable catch section" + }, + "fullDescription": { + "text": "Reports catch sections which are never executed, even if allowed by the Java Language Specification. While unreachable catch sections are normally disallowed by Java compiler and reported as compilation errors, the analysis mandated by the Java language is not complete for some cases. This inspection provides enhanced analysis and reports some unreachable catch sections which are not reported by the compiler. Such sections are redundant and could be safely removed. Example: 'void method() {\n try { \n throw new FileNotFoundException(); \n }\n catch (FileNotFoundException e) { \n \n }\n catch (IOException e) {\n // this catch is allowed by specification\n // but never executed\n }\n }' The quick-fix is provided, which removes the redundant catch section: 'void method() {\n try { \n throw new FileNotFoundException(); \n }\n catch (FileNotFoundException e) { \n \n }\n }' Inspection ID: UnreachableCatch New in 2025.1", + "markdown": "Reports catch sections which are never executed, even if allowed by the Java Language Specification.\n\n\nWhile unreachable catch sections are normally disallowed by Java compiler and reported as compilation errors,\nthe analysis mandated by the Java language is not complete for some cases.\nThis inspection provides enhanced analysis and reports some unreachable catch sections which are not reported by the compiler.\nSuch sections are redundant and could be safely removed.\n\n**Example:**\n\n\n void method() {\n try { \n throw new FileNotFoundException(); \n }\n catch (FileNotFoundException e) { \n \n }\n catch (IOException e) {\n // this catch is allowed by specification\n // but never executed\n }\n }\n\nThe quick-fix is provided, which removes the redundant catch section:\n\n\n void method() {\n try { \n throw new FileNotFoundException(); \n }\n catch (FileNotFoundException e) { \n \n }\n }\n\nInspection ID: UnreachableCatch\n\nNew in 2025.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnreachableCatch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedLabel", + "shortDescription": { + "text": "Unused label" + }, + "fullDescription": { + "text": "Reports labels that are not targets of any 'break' or 'continue' statements. Example: 'label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }' After the quick-fix is applied, the label is removed: 'for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }' Inspection ID: UnusedLabel", + "markdown": "Reports labels that are not targets of any `break` or `continue` statements.\n\n**Example:**\n\n\n label: for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nAfter the quick-fix is applied, the label is removed:\n\n\n for (int i = 0; i < 10; i++) {\n if (i == 3) {\n break;\n }\n }\n\nInspection ID: UnusedLabel" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedLabel", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicFieldAccessedInSynchronizedContext", + "shortDescription": { + "text": "Non-private field accessed in 'synchronized' context" + }, + "fullDescription": { + "text": "Reports non-'final', non-'private' fields that are accessed in a synchronized context. A non-'private' field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\" access may result in unexpectedly inconsistent data structures. Example: 'class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }' Inspection ID: PublicFieldAccessedInSynchronizedContext", + "markdown": "Reports non-`final`, non-`private` fields that are accessed in a synchronized context.\n\n\nA non-`private` field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\"\naccess may result in unexpectedly inconsistent data structures.\n\n**Example:**\n\n\n class Bar {\n public String field1;\n }\n public Bar myBar;\n\n synchronized public void sample() {\n myBar.field1 = \"bar\";\n }\n\nInspection ID: PublicFieldAccessedInSynchronizedContext" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonPrivateFieldAccessedInSynchronizedContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForeachStatement", + "shortDescription": { + "text": "Enhanced 'for' statement" + }, + "fullDescription": { + "text": "Reports enhanced 'for' statements. Example: 'for (int x: Arrays.asList(1, 2, 3)) {\n System.out.println(x);\n }' After the quick-fix is applied: 'for (Iterator iterator = Arrays.asList(1, 2, 3).iterator(); iterator.hasNext(); ) {\n final int x = iterator.next();\n System.out.println(x);\n }' Enhanced 'for' statement appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: ForeachStatement", + "markdown": "Reports enhanced `for` statements.\n\nExample:\n\n\n for (int x: Arrays.asList(1, 2, 3)) {\n System.out.println(x);\n }\n\nAfter the quick-fix is applied:\n\n\n for (Iterator iterator = Arrays.asList(1, 2, 3).iterator(); iterator.hasNext(); ) {\n final int x = iterator.next();\n System.out.println(x);\n }\n\n\n*Enhanced* `for` *statement* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: ForeachStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ForeachStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level issues", + "index": 62, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LambdaParameterNamingConvention", + "shortDescription": { + "text": "Lambda parameter naming convention" + }, + "fullDescription": { + "text": "Reports lambda parameters whose names are too short, too long, or do not follow the specified regular expression pattern. Example: 'Function id = X -> X;' should be reported if the inspection is enabled with the default settings in which a parameter name should start with a lowercase letter. Configure the inspection: Use the fields in the Options section to specify the minimum length, maximum length, and a regular expression expected for lambda parameter names. Specify 0 in order not to check the length of names. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: LambdaParameterNamingConvention", + "markdown": "Reports lambda parameters whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** `Function id = X -> X;`\nshould be reported if the inspection is enabled with the default settings in which a parameter name should start with a lowercase letter.\n\nConfigure the inspection:\n\n\nUse the fields in the **Options** section to specify the minimum length, maximum length, and a regular expression expected for lambda parameter names.\nSpecify **0** in order not to check the length of names.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: LambdaParameterNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LambdaParameterNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LawOfDemeter", + "shortDescription": { + "text": "Law of Demeter" + }, + "fullDescription": { + "text": "Reports Law of Demeter violations. The Law of Demeter is not really a law, but specifies a style guideline: never call a method on an object received from another call. The code that follows this guideline is easier to maintain, adapt, and refactor, has less coupling between methods, less duplication, and better information hiding. On the other hand, you may need to write many wrapper methods to meet this guideline. Example: 'boolean pay(Customer c, Invoice invoice) {\n int dollars = c.getWallet().contents; // violation\n if (dollars >= invoice.getAmount()) {\n Wallet w = c.getWallet();\n w.subtract(invoice.getAmount()); // violation\n return true;\n }\n return false;\n }' The above example might be better implemented as a method 'payInvoice(Invoice invoice)' in 'Customer'. Use the Ignore calls to library methods and access to library fields option to ignore Law of Demeter violations that can't be fixed without changing a library. Inspection ID: LawOfDemeter", + "markdown": "Reports [Law of Demeter](https://en.wikipedia.org/wiki/Law_of_Demeter) violations.\n\n\nThe Law of Demeter is not really a law, but specifies a style guideline: never call a method on an object received from another call.\nThe code that follows this guideline is easier to maintain, adapt, and refactor, has less coupling between methods, less duplication,\nand better information hiding. On the other hand, you may need to write many wrapper methods to meet this guideline.\n\n**Example:**\n\n\n boolean pay(Customer c, Invoice invoice) {\n int dollars = c.getWallet().contents; // violation\n if (dollars >= invoice.getAmount()) {\n Wallet w = c.getWallet();\n w.subtract(invoice.getAmount()); // violation\n return true;\n }\n return false;\n }\n\nThe above example might be better implemented as a method `payInvoice(Invoice invoice)` in `Customer`.\n\n\nUse the **Ignore calls to library methods and access to library fields** option to ignore Law of Demeter violations\nthat can't be fixed without changing a library.\n\nInspection ID: LawOfDemeter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LawOfDemeter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Data flow", + "index": 22, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OptionalUsedAsFieldOrParameterType", + "shortDescription": { + "text": "'Optional' used as field or parameter type" + }, + "fullDescription": { + "text": "Reports any cases in which 'java.util.Optional', 'java.util.OptionalDouble', 'java.util.OptionalInt', 'java.util.OptionalLong', or 'com.google.common.base.Optional' are used as types for fields or parameters. 'Optional' was designed to provide a limited mechanism for library method return types in which a clear way to represent \"no result\" was needed. Using a field with the 'java.util.Optional' type is also problematic if the class needs to be 'Serializable', as 'java.util.Optional' is not serializable. Example: 'class MyClass {\n Optional name; // Optional field\n\n // Optional parameter\n void setName(Optional name) {\n this.name = name;\n }\n }' Inspection ID: OptionalUsedAsFieldOrParameterType", + "markdown": "Reports any cases in which `java.util.Optional`, `java.util.OptionalDouble`, `java.util.OptionalInt`, `java.util.OptionalLong`, or `com.google.common.base.Optional` are used as types for fields or parameters.\n\n`Optional` was designed to provide a limited mechanism for library method return types in which a clear way to represent \"no result\"\nwas needed.\n\nUsing a field with the `java.util.Optional` type is also problematic if the class needs to be\n`Serializable`, as `java.util.Optional` is not serializable.\n\nExample:\n\n\n class MyClass {\n Optional name; // Optional field\n\n // Optional parameter\n void setName(Optional name) {\n this.name = name;\n }\n }\n\nInspection ID: OptionalUsedAsFieldOrParameterType" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "OptionalUsedAsFieldOrParameterType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceAllDot", + "shortDescription": { + "text": "Suspicious regex expression argument" + }, + "fullDescription": { + "text": "Reports calls to 'String.replaceAll()' or 'String.split()' where the first argument is a single regex meta character argument. The regex meta characters are one of '.$|()[{^?*+\\'. They have a special meaning in regular expressions. For example, calling '\"ab.cd\".replaceAll(\".\", \"-\")' produces '\"-----\"', because the dot matches any character. Most likely the escaped variant '\"\\\\.\"' was intended instead. Using 'File.separator' as a regex is also reported. The 'File.separator' has a platform specific value. It equals to '/' on Linux and Mac but equals to '\\' on Windows, which is not a valid regular expression, so such code is not portable. Example: 's.replaceAll(\".\", \"-\");' After the quick-fix is applied: 's.replaceAll(\"\\\\.\", \"-\");' Inspection ID: ReplaceAllDot", + "markdown": "Reports calls to `String.replaceAll()` or `String.split()` where the first argument is a single regex meta character argument.\n\n\nThe regex meta characters are one of `.$|()[{^?*+\\`. They have a special meaning in regular expressions.\nFor example, calling `\"ab.cd\".replaceAll(\".\", \"-\")` produces `\"-----\"`, because the dot matches any character.\nMost likely the escaped variant `\"\\\\.\"` was intended instead.\n\n\nUsing `File.separator` as a regex is also reported. The `File.separator` has a platform specific value. It\nequals to `/` on Linux and Mac but equals to `\\` on Windows, which is not a valid regular expression, so\nsuch code is not portable.\n\n**Example:**\n\n\n s.replaceAll(\".\", \"-\");\n\nAfter the quick-fix is applied:\n\n\n s.replaceAll(\"\\\\.\", \"-\");\n\n\nInspection ID: ReplaceAllDot" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousRegexArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForCanBeForeach", + "shortDescription": { + "text": "'for' loop can be replaced with enhanced for loop" + }, + "fullDescription": { + "text": "Reports 'for' loops that iterate over collections or arrays, and can be automatically replaced with an enhanced 'for' loop (foreach iteration syntax). Example: 'for (Iterator iterator = list.iterator(); iterator.hasNext(); ) {\n String item = iterator.next();\n System.out.println(item);\n }' After the quick-fix is applied: 'for (String item : list) {\n System.out.println(item);\n }' Use the Report indexed 'java.util.List' loops option to find loops involving 'list.get(index)' calls. Generally, these loops can be replaced with enhanced 'for' loops, unless they modify an underlying list in the process, for example, by calling 'list.remove(index)'. If the latter is the case, the enhanced 'for' loop may throw 'ConcurrentModificationException'. Also, in some cases, 'list.get(index)' loops may work a little bit faster. Use the Do not report iterations over untyped collections option to ignore collections without type parameters. This prevents the creation of enhanced 'for' loop variables of the 'java.lang.Object' type and the insertion of casts where the loop variable is used. This inspection depends on the Java feature 'For-each loops', which is available since Java 5. Inspection ID: ForCanBeForeach", + "markdown": "Reports `for` loops that iterate over collections or arrays, and can be automatically replaced with an enhanced `for` loop (foreach iteration syntax).\n\n**Example:**\n\n\n for (Iterator iterator = list.iterator(); iterator.hasNext(); ) {\n String item = iterator.next();\n System.out.println(item);\n }\n\nAfter the quick-fix is applied:\n\n\n for (String item : list) {\n System.out.println(item);\n }\n\n\nUse the **Report indexed 'java.util.List' loops** option to find loops involving `list.get(index)` calls.\nGenerally, these loops can be replaced with enhanced `for` loops,\nunless they modify an underlying list in the process, for example, by calling `list.remove(index)`.\nIf the latter is the case, the enhanced `for` loop may throw `ConcurrentModificationException`.\nAlso, in some cases, `list.get(index)` loops may work a little bit faster.\n\n\nUse the **Do not report iterations over untyped collections** option to ignore collections without type parameters.\nThis prevents the creation of enhanced `for` loop variables of the `java.lang.Object` type and the insertion of casts\nwhere the loop variable is used.\n\nThis inspection depends on the Java feature 'For-each loops', which is available since Java 5.\n\nInspection ID: ForCanBeForeach" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ForLoopReplaceableByForEach", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AmbiguousFieldAccess", + "shortDescription": { + "text": "Access to inherited field looks like access to element from surrounding code" + }, + "fullDescription": { + "text": "Reports access to a superclass field from an anonymous, inner or local class, if a local variable, parameter, or field with the same name is available in the code surrounding the class. In this case it may seem that an element from the surrounding code is accessed, when in fact it is an access to a field from the superclass. To clarify the intent of the code, it is recommended to add an explicit 'super' qualifier to the field access. Example: 'class First {\n protected String ambiguous;\n }\n class Second {\n void foo(String ambiguous) {\n new First() {\n {\n System.out.println(ambiguous); // the field is accessed, not the parameter\n }\n };\n }\n }' After the quick-fix is applied: 'class First {\n protected String ambiguous;\n }\n class Second {\n void foo(String ambiguous) {\n new First() {\n {\n System.out.println(super.ambiguous);\n }\n };\n }\n }' Inspection ID: AmbiguousFieldAccess", + "markdown": "Reports access to a superclass field from an anonymous, inner or local class, if a local variable, parameter, or field with the same name is available in the code surrounding the class. In this case it may seem that an element from the surrounding code is accessed, when in fact it is an access to a field from the superclass.\n\n\nTo clarify the intent of the code, it is recommended to add an explicit\n`super` qualifier to the field access.\n\n**Example:**\n\n\n class First {\n protected String ambiguous;\n }\n class Second {\n void foo(String ambiguous) {\n new First() {\n {\n System.out.println(ambiguous); // the field is accessed, not the parameter\n }\n };\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class First {\n protected String ambiguous;\n }\n class Second {\n void foo(String ambiguous) {\n new First() {\n {\n System.out.println(super.ambiguous);\n }\n };\n }\n }\n\nInspection ID: AmbiguousFieldAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AmbiguousFieldAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonProtectedConstructorInAbstractClass", + "shortDescription": { + "text": "Public constructor in abstract class" + }, + "fullDescription": { + "text": "Reports 'public' constructors of 'abstract' classes. Constructors of 'abstract' classes can only be called from the constructors of their subclasses, declaring them 'public' may be confusing. The quick-fix makes such constructors protected. Example: 'public abstract class Foo {\n public Foo () { // warning: has 'public' modifier\n /* ... */\n }\n }' After the quick-fix is applied: 'public abstract class Foo {\n protected Foo () {\n /* ... */\n }\n }' Configure the inspection: Use the Ignore for non-public classes option below to ignore 'public' constructors in non-public classes. Inspection ID: NonProtectedConstructorInAbstractClass", + "markdown": "Reports `public` constructors of `abstract` classes.\n\n\nConstructors of `abstract` classes can only be called from the constructors of\ntheir subclasses, declaring them `public` may be confusing.\n\nThe quick-fix makes such constructors protected.\n\n**Example:**\n\n\n public abstract class Foo {\n public Foo () { // warning: has 'public' modifier\n /* ... */\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public abstract class Foo {\n protected Foo () {\n /* ... */\n }\n }\n\nConfigure the inspection:\n\nUse the **Ignore for non-public classes** option below to ignore `public` constructors in non-public classes.\n\nInspection ID: NonProtectedConstructorInAbstractClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstructorNotProtectedInAbstractClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageVisibleField", + "shortDescription": { + "text": "Package-visible field" + }, + "fullDescription": { + "text": "Reports fields that are declared without any access modifier (also known as package-private). Constants (that is, fields marked 'static' and 'final') are not reported. Example: 'public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }' Inspection ID: PackageVisibleField", + "markdown": "Reports fields that are declared without any access modifier (also known as package-private).\n\nConstants (that is, fields marked `static` and `final`) are not reported.\n\n**Example:**\n\n\n public class A {\n Object object; // warning\n final static int MODE = 0; // constant, no warning\n }\n\nInspection ID: PackageVisibleField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PackageVisibleField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Encapsulation", + "index": 59, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComparableImplementedButEqualsNotOverridden", + "shortDescription": { + "text": "'Comparable' implemented but 'equals()' not overridden" + }, + "fullDescription": { + "text": "Reports classes that implement 'java.lang.Comparable' but do not override 'equals()'. If 'equals()' is not overridden, the 'equals()' implementation is not consistent with the 'compareTo()' implementation. If an object of such a class is added to a collection such as 'java.util.SortedSet', this collection will violate the contract of 'java.util.Set', which is defined in terms of 'equals()'. Example: 'class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n }' After the quick fix is applied: 'class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n\n @Override\n public boolean equals(Object o) {\n return o instanceof Length && compareTo((Length) o) == 0;\n }\n }' Inspection ID: ComparableImplementedButEqualsNotOverridden", + "markdown": "Reports classes that implement `java.lang.Comparable` but do not override `equals()`.\n\n\nIf `equals()`\nis not overridden, the `equals()` implementation is not consistent with\nthe `compareTo()` implementation. If an object of such a class is added\nto a collection such as `java.util.SortedSet`, this collection will violate\nthe contract of `java.util.Set`, which is defined in terms of\n`equals()`.\n\n**Example:**\n\n\n class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n }\n\nAfter the quick fix is applied:\n\n\n class Length implements Comparable {\n private int cm = 0;\n\n @Override\n public int compareTo(@NotNull Length o) {\n if (cm == o.cm) return 0;\n return cm < o.cm ? -1 : 1;\n }\n\n @Override\n public boolean equals(Object o) {\n return o instanceof Length && compareTo((Length) o) == 0;\n }\n }\n\nInspection ID: ComparableImplementedButEqualsNotOverridden" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ComparableImplementedButEqualsNotOverridden", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InstantiationOfUtilityClass", + "shortDescription": { + "text": "Instantiation of utility class" + }, + "fullDescription": { + "text": "Reports instantiation of utility classes using the 'new' keyword. In utility classes, all fields and methods are 'static'. Instantiation of such classes is most likely unnecessary and indicates a mistake. Example: 'class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }' To prevent utility classes from being instantiated, it's recommended to use a 'private' constructor. Inspection ID: InstantiationOfUtilityClass", + "markdown": "Reports instantiation of utility classes using the `new` keyword.\n\n\nIn utility classes, all fields and methods are `static`.\nInstantiation of such classes is most likely unnecessary and indicates a mistake.\n\n**Example:**\n\n\n class MyUtils {\n public static double cube(double x) {\n return x * x * x;\n }\n }\n class Main {\n public static void main(String[] args) {\n // Instantiation of utility class\n MyUtils utils = new MyUtils();\n }\n }\n\n\nTo prevent utility classes from being instantiated,\nit's recommended to use a `private` constructor.\n\nInspection ID: InstantiationOfUtilityClass" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InstantiationOfUtilityClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MapReplaceableByEnumMap", + "shortDescription": { + "text": "'Map' can be replaced with 'EnumMap'" + }, + "fullDescription": { + "text": "Reports instantiations of 'java.util.Map' objects whose key types are enumerated classes. Such 'java.util.Map' objects can be replaced with 'java.util.EnumMap' objects. 'java.util.EnumMap' implementations can be much more efficient because the underlying data structure is a simple array. Example: 'Map myEnums = new HashMap<>();' After the quick-fix is applied: 'Map myEnums = new EnumMap<>(MyEnum.class);' Inspection ID: MapReplaceableByEnumMap", + "markdown": "Reports instantiations of `java.util.Map` objects whose key types are enumerated classes. Such `java.util.Map` objects can be replaced with `java.util.EnumMap` objects.\n\n\n`java.util.EnumMap` implementations can be much more efficient\nbecause the underlying data structure is a simple array.\n\n**Example:**\n\n\n Map myEnums = new HashMap<>();\n\nAfter the quick-fix is applied:\n\n\n Map myEnums = new EnumMap<>(MyEnum.class);\n\nInspection ID: MapReplaceableByEnumMap" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MapReplaceableByEnumMap", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TrailingWhitespacesInTextBlock", + "shortDescription": { + "text": "Trailing whitespace in text block" + }, + "fullDescription": { + "text": "Reports text blocks with trailing whitespace characters. Trailing whitespace is considered incidental and will be stripped away by the Java compiler. Example (where spaces are indicated with dots): '..String.count.=.\"\"\"\n....one\n....two....\n....three\n....\"\"\";' Two quick-fixes are provided. One to remove the trailing whitespace, and one to escape the trailing whitespace so that it will not be removed by the compiler: '..String.count.=.\"\"\"\n....one\n....two...\\s\n....three\n....\"\"\";' This inspection depends on the Java feature 'Text block literals', which is available since Java 15. Inspection ID: TrailingWhitespacesInTextBlock New in 2021.1", + "markdown": "Reports text blocks with trailing whitespace characters. Trailing whitespace is considered incidental and will be stripped away by the Java compiler.\n\n**Example (where spaces are indicated with dots):**\n\n\n ..String.count.=.\"\"\"\n ....one\n ....two....\n ....three\n ....\"\"\";\n\nTwo quick-fixes are provided.\nOne to remove the trailing whitespace, and one to escape the trailing whitespace so that it will not be removed by the compiler:\n\n\n ..String.count.=.\"\"\"\n ....one\n ....two...\\s\n ....three\n ....\"\"\";\n\nThis inspection depends on the Java feature 'Text block literals', which is available since Java 15.\n\nInspection ID: TrailingWhitespacesInTextBlock\n\nNew in 2021.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TrailingWhitespacesInTextBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReturnNull", + "shortDescription": { + "text": "Return of 'null'" + }, + "fullDescription": { + "text": "Reports 'return' statements with 'null' return values. While occasionally useful, this construct may make the code more prone to failing with a 'NullPointerException'. If a method is designed to return 'null', it is suggested to mark it with the '@Nullable' annotation - such methods will be ignored by this inspection. Example: 'class Person {\n public String getName () {\n return null;\n }\n }' After the quick-fix is applied: 'class Person {\n public @Nullable String getName () {\n return null;\n }\n }' If the return type is 'java.util.Optional', an additional quick-fix to convert 'null' to 'Optional.empty()' is suggested. Use the following options to configure the inspection: Whether to ignore 'private' methods. This will also ignore return of 'null' from anonymous classes and lambdas. Whether 'null' values on array returns, collection object returns, plain object returns, or a combination of the three should be reported. Return of 'null' in methods with return type 'java.util.Optional' are always reported. Click Configure annotations to specify which annotations should be considered 'nullable'. Inspection ID: ReturnNull", + "markdown": "Reports `return` statements with `null` return values. While occasionally useful, this construct may make the code more prone to failing with a `NullPointerException`.\n\n\nIf a method is designed to return `null`, it is suggested to mark it with the\n`@Nullable` annotation - such methods will be ignored by this inspection.\n\n**Example:**\n\n\n class Person {\n public String getName () {\n return null;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Person {\n public @Nullable String getName () {\n return null;\n }\n }\n\n\nIf the return type is `java.util.Optional`, an additional quick-fix to convert\n`null` to `Optional.empty()` is suggested.\n\n\nUse the following options to configure the inspection:\n\n* Whether to ignore `private` methods. This will also ignore return of `null` from anonymous classes and lambdas.\n* Whether `null` values on array returns, collection object returns, plain object returns, or a combination of the three should be reported. Return of `null` in methods with return type `java.util.Optional` are always reported.\n* Click **Configure annotations** to specify which annotations should be considered 'nullable'.\n\nInspection ID: ReturnNull" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReturnOfNull", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs/Nullability problems", + "index": 121, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NewClassNamingConvention", + "shortDescription": { + "text": "Class naming convention" + }, + "fullDescription": { + "text": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class produces a warning because the length of its name is 6, which is less than 8: 'public class MyTest{}'. A quick-fix that renames such classes is available only in the editor. Configure the inspection: Use the list in the Options section to specify which classes should be checked. Deselect the checkboxes for the classes for which you want to skip the check. For each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the provided input fields. Specify 0 in the length fields to skip corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: NewClassNamingConvention", + "markdown": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for tests, and the specified length for the minimum class name is 8 (the default), the following test class\nproduces a warning because the length of its name is 6, which is less than 8: `public class MyTest{}`.\n\nA quick-fix that renames such classes is available only in the editor.\n\nConfigure the inspection:\n\n\nUse the list in the **Options** section to specify which classes should be checked. Deselect the checkboxes for the classes for which\nyou want to skip the check.\n\nFor each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the\nprovided input fields. Specify **0** in the length fields to skip corresponding checks.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: NewClassNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NewClassNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Class", + "index": 68, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoggingStringTemplateAsArgument", + "shortDescription": { + "text": "String template as argument to logging call" + }, + "fullDescription": { + "text": "Reports string templates that are used as arguments to SLF4J and Log4j 2 logging methods. The method 'org.apache.logging.log4j.Logger.log()' and its overloads are supported only for all log levels option. String templates are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled. Example (for Kotlin): 'val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")' After the quick-fix is applied (for Kotlin): 'val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)' Note that the suggested replacement might not be equivalent to the original code, for example, when string templates contain method calls or assignment expressions. Use the Warn on list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated. Use the Do not warn when only expressions with primitive types, their wrappers or String are included option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance. Use the Do not warn when call only with an exception as argument after message argument option to ignore calls, which only contain an exception as an argument after the message argument. For example, it could be useful to adjust the inspection's behavior with a custom code style. Inspection ID: LoggingStringTemplateAsArgument New in 2023.1", + "markdown": "Reports string templates that are used as arguments to **SLF4J** and **Log4j 2** logging methods. The method `org.apache.logging.log4j.Logger.log()` and its overloads are supported only for **all log levels** option. String templates are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: $variable1\")\n\n**After the quick-fix is applied (for Kotlin):**\n\n\n val variable1 = getVariable()\n logger.info(\"variable1: {}\", variable1)\n\n\nNote that the suggested replacement might not be equivalent to the original code, for example,\nwhen string templates contain method calls or assignment expressions.\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be always enabled, and the arguments will always be evaluated.\n* Use the **Do not warn when only expressions with primitive types, their wrappers or String are included** option to ignore string templates, which contain only expressions with primitive types, their wrappers or String. For example, it could be useful to prevent loading lazy collections. Note that, creating string even only with expressions with primitive types, their wrappers or String at runtime can negatively impact performance.\n* Use the **Do not warn when call only with an exception as argument after message argument** option to ignore calls, which only contain an exception as an argument after the message argument. For example, it could be useful to adjust the inspection's behavior with a custom code style.\n\nInspection ID: LoggingStringTemplateAsArgument\n\nNew in 2023.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "LoggingStringTemplateAsArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Logging", + "index": 46, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnpredictableBigDecimalConstructorCall", + "shortDescription": { + "text": "Unpredictable 'BigDecimal' constructor call" + }, + "fullDescription": { + "text": "Reports calls to 'BigDecimal' constructors that accept a 'double' value. These constructors produce 'BigDecimal' that is equal to the supplied 'double' value. However, because doubles are encoded in the IEEE-754 64-bit double-precision binary floating-point format, the exact value can be unexpected. For example, 'new BigDecimal(0.1)' yields a 'BigDecimal' object with value '0.1000000000000000055511151231257827021181583404541015625', which is the nearest number to 0.1 representable as a 'double'. To get a 'BigDecimal' that contains the expected value '0.1', use either 'new BigDecimal(\"0.1\")' or 'BigDecimal.valueOf(0.1)'. Example: 'class Constructor {\n void foo() {\n new BigDecimal(0.1);\n }\n }' After the quick-fix is applied: 'class Constructor {\n void foo() {\n new BigDecimal(\"0.1\");\n }\n }' Inspection ID: UnpredictableBigDecimalConstructorCall", + "markdown": "Reports calls to `BigDecimal` constructors that accept a `double` value. These constructors produce `BigDecimal` that is equal to the supplied `double` value. However, because doubles are encoded in the IEEE-754 64-bit double-precision binary floating-point format, the exact value can be unexpected.\n\nFor example, `new BigDecimal(0.1)` yields a `BigDecimal` object with value\n`0.1000000000000000055511151231257827021181583404541015625`,\nwhich is the nearest number to 0.1 representable as a `double`.\nTo get a `BigDecimal` that contains the expected value `0.1`,\nuse either `new BigDecimal(\"0.1\")` or `BigDecimal.valueOf(0.1)`.\n\n**Example:**\n\n\n class Constructor {\n void foo() {\n new BigDecimal(0.1);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Constructor {\n void foo() {\n new BigDecimal(\"0.1\");\n }\n }\n\nInspection ID: UnpredictableBigDecimalConstructorCall" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnpredictableBigDecimalConstructorCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseCompareMethod", + "shortDescription": { + "text": "'compare()' method can be used to compare numbers" + }, + "fullDescription": { + "text": "Reports expressions that can be replaced by a call to the 'Integer.compare()' method or a similar method from the 'Long', 'Short', 'Byte', 'Double' or 'Float' classes, instead of more verbose or less efficient constructs. If 'x' and 'y' are boxed integers, then 'x.compareTo(y)' is suggested, if they are primitives 'Integer.compare(x, y)' is suggested. Example: 'public int compare(int x, int y) {\n return x > y ? 1 : x < y ? -1 : 0;\n }' After the quick-fix is applied: 'public int compare(int x, int y) {\n return Integer.compare(x, y);\n }' Note that 'Double.compare' and 'Float.compare' slightly change the code semantics. In particular, they make '-0.0' and '0.0' distinguishable ('Double.compare(-0.0, 0.0)' yields -1). Also, they consistently process 'NaN' value. In most of the cases, this semantics change actually improves the code. Use the checkbox to disable this inspection for floating point numbers if semantics change is unacceptable in your case. Inspection ID: UseCompareMethod New in 2017.2", + "markdown": "Reports expressions that can be replaced by a call to the `Integer.compare()` method or a similar method from the `Long`, `Short`, `Byte`, `Double` or `Float` classes, instead of more verbose or less efficient constructs.\n\nIf `x` and `y` are boxed integers, then `x.compareTo(y)` is suggested,\nif they are primitives `Integer.compare(x, y)` is suggested.\n\n**Example:**\n\n\n public int compare(int x, int y) {\n return x > y ? 1 : x < y ? -1 : 0;\n }\n\nAfter the quick-fix is applied:\n\n\n public int compare(int x, int y) {\n return Integer.compare(x, y);\n }\n\n\nNote that `Double.compare` and `Float.compare` slightly change the code semantics. In particular,\nthey make `-0.0` and `0.0` distinguishable (`Double.compare(-0.0, 0.0)` yields -1).\nAlso, they consistently process `NaN` value. In most of the cases, this semantics change actually improves the\ncode. Use the checkbox to disable this inspection for floating point numbers if semantics change is unacceptable\nin your case.\n\nInspection ID: UseCompareMethod\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseCompareMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IntegerDivisionInFloatingPointContext", + "shortDescription": { + "text": "Integer division in floating-point context" + }, + "fullDescription": { + "text": "Reports integer divisions where the result is used as a floating-point number. Such division is often an error and may have unexpected results due to the truncation that happens in integer division. Example: 'float x = 3.0F + 3 * 2 / 5;' After the quick-fix is applied: 'float x = 3.0F + ((float) (3 * 2)) /5;' Inspection ID: IntegerDivisionInFloatingPointContext", + "markdown": "Reports integer divisions where the result is used as a floating-point number. Such division is often an error and may have unexpected results due to the truncation that happens in integer division.\n\n**Example:**\n\n\n float x = 3.0F + 3 * 2 / 5;\n\nAfter the quick-fix is applied:\n\n\n float x = 3.0F + ((float) (3 * 2)) /5;\n\nInspection ID: IntegerDivisionInFloatingPointContext" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IntegerDivisionInFloatingPointContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssertWithoutMessage", + "shortDescription": { + "text": "Message missing on assertion" + }, + "fullDescription": { + "text": "Reports calls to 'assertXXX()' or 'fail()' without an error message string argument. An error message on assertion failure may help clarify the test case's intent. Example: 'assertTrue(checkValid());' After the quick-fix is applied: 'assertTrue(checkValid(), \"|\");' The message argument is added before or after the existing arguments according to the assertions framework that you use. Inspection ID: AssertWithoutMessage", + "markdown": "Reports calls to `assertXXX()` or `fail()` without an error message string argument. An error message on assertion failure may help clarify the test case's intent.\n\n**Example:**\n\n\n assertTrue(checkValid());\n\nAfter the quick-fix is applied:\n\n assertTrue(checkValid(), \"|\");\n\n\nThe message argument is added before or after the existing arguments according to the assertions framework that you use.\n\nInspection ID: AssertWithoutMessage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssertWithoutMessage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Test frameworks", + "index": 102, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MoveFieldAssignmentToInitializer", + "shortDescription": { + "text": "Field assignment can be moved to initializer" + }, + "fullDescription": { + "text": "Suggests replacing initialization of fields using assignment with initialization in the field declaration. Only reports if the field assignment is located in an instance or static initializer, and joining it with the field declaration is likely to be safe. In other cases, like assignment inside a constructor, the quick-fix is provided without highlighting, as the fix may change the semantics. Example: 'class MyClass {\n static final int intConstant;\n \n static {\n intConstant = 10;\n }\n }' The quick fix moves the assigned value to the field initializer removing the class initializer if possible: 'class MyClass {\n static final int intConstant = 10;\n }' Since 2017.2 Inspection ID: MoveFieldAssignmentToInitializer", + "markdown": "Suggests replacing initialization of fields using assignment with initialization in the field declaration.\n\nOnly reports if the field assignment is located in an instance or static initializer, and\njoining it with the field declaration is likely to be safe.\nIn other cases, like assignment inside a constructor, the quick-fix is provided without highlighting,\nas the fix may change the semantics.\n\nExample:\n\n\n class MyClass {\n static final int intConstant;\n \n static {\n intConstant = 10;\n }\n }\n\nThe quick fix moves the assigned value to the field initializer removing the class initializer if possible:\n\n\n class MyClass {\n static final int intConstant = 10;\n }\n\nSince 2017.2\n\nInspection ID: MoveFieldAssignmentToInitializer" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MoveFieldAssignmentToInitializer", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionalBreakInInfiniteLoop", + "shortDescription": { + "text": "Conditional break inside loop" + }, + "fullDescription": { + "text": "Reports conditional breaks at the beginning or at the end of a loop and suggests adding a loop condition instead to shorten the code. Example: 'while (true) {\n if (i == 23) break;\n i++;\n }' After the quick fix is applied: 'while (i != 23) {\n i++;\n }' Inspection ID: ConditionalBreakInInfiniteLoop", + "markdown": "Reports conditional breaks at the beginning or at the end of a loop and suggests adding a loop condition instead to shorten the code.\n\nExample:\n\n\n while (true) {\n if (i == 23) break;\n i++;\n }\n\nAfter the quick fix is applied:\n\n\n while (i != 23) {\n i++;\n }\n\nInspection ID: ConditionalBreakInInfiniteLoop" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConditionalBreakInInfiniteLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringConcatenationInFormatCall", + "shortDescription": { + "text": "String concatenation as argument to 'format()' call" + }, + "fullDescription": { + "text": "Reports non-constant string concatenations used as a format string argument. While occasionally intended, this is usually a misuse of a formatting method and may even cause security issues if the variables used in the concatenated string contain special characters like '%'. Also, sometimes this could be the result of mistakenly concatenating a string format argument by typing a '+' when a ',' was meant. Example: 'static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }' Here, the 'userName' will be interpreted as a part of format string, which may result in 'IllegalFormatException' (for example, if 'userName' is '\"%\"') or in using an enormous amount of memory (for example, if 'userName' is '\"%2000000000%\"'). The call should be probably replaced with 'String.format(\"Hello, %s\", userName);'. This inspection checks calls to formatting methods on 'java.util.Formatter', 'java.lang.String', 'java.io.PrintWriter', or 'java.io.PrintStream'. Inspection ID: StringConcatenationInFormatCall", + "markdown": "Reports non-constant string concatenations used as a format string argument.\n\n\nWhile occasionally intended, this is usually a misuse of a formatting method\nand may even cause security issues if the variables used in the concatenated string\ncontain special characters like `%`.\n\n\nAlso, sometimes this could be the result\nof mistakenly concatenating a string format argument by typing a `+` when a `,` was meant.\n\n**Example:**\n\n\n static String formatGreeting(String userName) {\n return String.format(\"Hello, \" + userName);\n }\n\n\nHere, the `userName` will be interpreted as a part of format string, which may result\nin `IllegalFormatException` (for example, if `userName` is `\"%\"`) or\nin using an enormous amount of memory (for example, if `userName` is `\"%2000000000%\"`).\nThe call should be probably replaced with `String.format(\"Hello, %s\", userName);`.\n\n\nThis inspection checks calls to formatting methods on\n`java.util.Formatter`,\n`java.lang.String`,\n`java.io.PrintWriter`,\nor `java.io.PrintStream`.\n\nInspection ID: StringConcatenationInFormatCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringConcatenationInFormatCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnqualifiedInnerClassAccess", + "shortDescription": { + "text": "Unqualified inner class access" + }, + "fullDescription": { + "text": "Reports references to inner classes that are not qualified with the name of the enclosing class. Example: 'import foo.Foo.Bar;\n\n class Foo {\n class Bar {}\n }\n\n class Baz {\n void f(Bar bar) {}\n }' After the quick-fix is applied: 'class Foo {\n class Bar {}\n }\n\n class Baz {\n void f(Foo.Bar bar) {}\n }' Use the inspection settings to ignore references to inner classes within the same class, which therefore do not require an import. Inspection ID: UnqualifiedInnerClassAccess", + "markdown": "Reports references to inner classes that are not qualified with the name of the enclosing class.\n\n**Example:**\n\n\n import foo.Foo.Bar;\n\n class Foo {\n class Bar {}\n }\n\n class Baz {\n void f(Bar bar) {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n class Bar {}\n }\n\n class Baz {\n void f(Foo.Bar bar) {}\n }\n\n\nUse the inspection settings to ignore references to inner classes within the same class,\nwhich therefore do not require an import.\n\n\nInspection ID: UnqualifiedInnerClassAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnqualifiedInnerClassAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantClassCall", + "shortDescription": { + "text": "Redundant 'isInstance()' or 'cast()' call" + }, + "fullDescription": { + "text": "Reports redundant calls of 'java.lang.Class' methods. For example, 'Xyz.class.isInstance(object)' can be replaced with 'object instanceof Xyz'. The instanceof check is preferred: even though the performance will probably be the same as these methods are intrinsics, they better indicate a static check. Inspection ID: RedundantClassCall New in 2018.2", + "markdown": "Reports redundant calls of `java.lang.Class` methods.\n\nFor example, `Xyz.class.isInstance(object)` can be replaced with `object instanceof Xyz`.\nThe instanceof check is preferred: even though the performance will probably be the same as these methods are intrinsics,\nthey better indicate a static check.\n\nInspection ID: RedundantClassCall\n\nNew in 2018.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantClassCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WaitWhileHoldingTwoLocks", + "shortDescription": { + "text": "'wait()' while holding two locks" + }, + "fullDescription": { + "text": "Reports calls to 'wait()' methods that may occur while the current thread is holding two locks. Since calling 'wait()' only releases one lock on its target, waiting with two locks held can easily lead to a deadlock. Example: 'synchronized (lockA) {\n synchronized (lockB) {\n lockB.wait(); //warning\n //thread A is stuck here holding lockA\n }\n }\n\n synchronized (lockA) { //thread B can't enter the block and release thread A\n lockB.notify();\n }' Inspection ID: WaitWhileHoldingTwoLocks", + "markdown": "Reports calls to `wait()` methods that may occur while the current thread is holding two locks.\n\n\nSince calling `wait()` only releases one lock on its target,\nwaiting with two locks held can easily lead to a deadlock.\n\n**Example:**\n\n\n synchronized (lockA) {\n synchronized (lockB) {\n lockB.wait(); //warning\n //thread A is stuck here holding lockA\n }\n }\n\n synchronized (lockA) { //thread B can't enter the block and release thread A\n lockB.notify();\n }\n\nInspection ID: WaitWhileHoldingTwoLocks" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "WaitWhileHoldingTwoLocks", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryStringEscape", + "shortDescription": { + "text": "Unnecessarily escaped character" + }, + "fullDescription": { + "text": "Reports unnecessarily escaped characters in 'String' literals, and optionally 'char' literals. Escaped tab characters ('\\t') are not reported, even though escaping them is not required, because tab characters are hard to tell apart from spaces. Examples: 'String s = \"\\'Scare\\' quotes\";\n String t = \"\"\"\n All you need is\\n\\tLove\\n\"\"\";' After the quick-fix is applied: 'String s = \"'Scare' quotes\";\n String t = \"\"\"\n All you need is\n \\tLove\n \"\"\";' Inspection ID: UnnecessaryStringEscape", + "markdown": "Reports unnecessarily escaped characters in `String` literals, and optionally `char` literals.\n\nEscaped tab characters (`\\t`) are not reported, even though escaping them is not required,\nbecause tab characters are hard to tell apart from spaces.\n\nExamples:\n\n\n String s = \"\\'Scare\\' quotes\";\n String t = \"\"\"\n All you need is\\n\\tLove\\n\"\"\";\n\nAfter the quick-fix is applied:\n\n\n String s = \"'Scare' quotes\";\n String t = \"\"\"\n All you need is\n \\tLove\n \"\"\";\n\nInspection ID: UnnecessaryStringEscape" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryStringEscape", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerializableInnerClassWithNonSerializableOuterClass", + "shortDescription": { + "text": "Serializable non-'static' inner class with non-Serializable outer class" + }, + "fullDescription": { + "text": "Reports non-static inner classes that implement 'Serializable' and are declared inside a class that doesn't implement 'Serializable'. Such classes are unlikely to serialize correctly due to implicit references to the outer class. Example: 'class A {\n class Main implements Serializable {\n }\n }' Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Whether to ignore 'Serializable' anonymous classes. Inspection ID: SerializableInnerClassWithNonSerializableOuterClass", + "markdown": "Reports non-static inner classes that implement `Serializable` and are declared inside a class that doesn't implement `Serializable`.\n\n\nSuch classes are unlikely to serialize correctly due to implicit references to the outer class.\n\n**Example:**\n\n\n class A {\n class Main implements Serializable {\n }\n }\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization.\n* Whether to ignore `Serializable` anonymous classes.\n\nInspection ID: SerializableInnerClassWithNonSerializableOuterClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SerializableInnerClassWithNonSerializableOuterClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousListRemoveInLoop", + "shortDescription": { + "text": "Suspicious 'List.remove()' in loop" + }, + "fullDescription": { + "text": "Reports 'list.remove(index)' calls inside an ascending counted loop. This is suspicious as the list becomes shorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable after the removal, but probably removing via an iterator or using the 'removeIf()' method (Java 8 and later) is a more robust alternative. If you don't expect that 'remove()' will be called more than once in a loop, consider adding a 'break' after it. Example: 'public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }' The code looks like '1 2 3 4' is going to be printed, but in reality, '3' will be skipped in the output. Inspection ID: SuspiciousListRemoveInLoop New in 2018.2", + "markdown": "Reports `list.remove(index)` calls inside an ascending counted loop.\n\n\nThis is suspicious as the list becomes\nshorter after the removal, and the next element gets skipped. A simple fix is to decrease the index variable\nafter the removal,\nbut probably removing via an iterator or using the `removeIf()` method (Java 8 and later) is a more robust alternative.\nIf you don't expect that `remove()` will be called more than once in a loop, consider adding a `break` after it.\n\n**Example:**\n\n public static void main(String[] args) {\n process(new ArrayList<>(\n Arrays.asList(\"1\", \"2\", \"|\", \"3\", \"4\")));\n }\n\n static void process(List list) {\n for (int i = 0; i < list.size(); i++) {\n if (list.get(i).equals(\"|\")) {\n list.remove(i);\n continue;\n }\n System.out.println(list.get(i));\n }\n }\n\nThe code looks like `1 2 3 4` is going to be printed, but in reality, `3` will be skipped in the output.\n\nInspection ID: SuspiciousListRemoveInLoop\n\nNew in 2018.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousListRemoveInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NegativeIntConstantInLongContext", + "shortDescription": { + "text": "Negative int hexadecimal constant in long context" + }, + "fullDescription": { + "text": "Reports negative int hexadecimal constants in long context. Such constants are implicitly widened to long, which means their higher bits will become 1 rather than 0 (e.g., 0xFFFF_FFFF will become 0xFFFF_FFFF_FFFF_FFFFL). Unlikely this is intended, and even if it is, using an explicit long constant would be less confusing. Example: '// Warning: this is int constant -1 which is widened to long\n // becoming 0xFFFF_FFFF_FFFF_FFFFL.\n long mask = 0xFFFF_FFFF;' Inspection ID: NegativeIntConstantInLongContext New in 2022.3", + "markdown": "Reports negative int hexadecimal constants in long context. Such constants are implicitly widened to long, which means their higher bits will become 1 rather than 0 (e.g., 0xFFFF_FFFF will become 0xFFFF_FFFF_FFFF_FFFFL). Unlikely this is intended, and even if it is, using an explicit long constant would be less confusing.\n\n**Example:**\n\n\n // Warning: this is int constant -1 which is widened to long\n // becoming 0xFFFF_FFFF_FFFF_FFFFL.\n long mask = 0xFFFF_FFFF;\n\nInspection ID: NegativeIntConstantInLongContext\n\nNew in 2022.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NegativeIntConstantInLongContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldCanBeLocal", + "shortDescription": { + "text": "Field can be local variable" + }, + "fullDescription": { + "text": "Reports redundant class fields that can be replaced with local variables. If all local usages of a field are preceded by assignments to that field, the field can be removed, and its usages can be replaced with local variables. Inspection ID: FieldCanBeLocal", + "markdown": "Reports redundant class fields that can be replaced with local variables.\n\nIf all local usages of a field are preceded by assignments to that field, the\nfield can be removed, and its usages can be replaced with local variables.\n\nInspection ID: FieldCanBeLocal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FieldCanBeLocal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UrlHashCode", + "shortDescription": { + "text": "Call to 'equals()' or 'hashCode()' on 'URL' object" + }, + "fullDescription": { + "text": "Reports 'hashCode()' and 'equals()' calls on 'java.net.URL' objects and calls that add 'URL' objects to maps and sets. 'URL''s 'equals()' and 'hashCode()' methods can perform a DNS lookup to resolve the host name. This may cause significant delays, depending on the availability and speed of the network and the DNS server. Using 'java.net.URI' instead of 'java.net.URL' will avoid the DNS lookup. Example: 'boolean urlEquals(URL url1, URL url2) {\n return url1.equals(url2);\n }' Inspection ID: UrlHashCode", + "markdown": "Reports `hashCode()` and `equals()` calls on `java.net.URL` objects and calls that add `URL` objects to maps and sets.\n\n\n`URL`'s `equals()` and `hashCode()` methods can perform a DNS lookup to resolve the host name.\nThis may cause significant delays, depending on the availability and speed of the network and the DNS server.\nUsing `java.net.URI` instead of `java.net.URL` will avoid the DNS lookup.\n\n**Example:**\n\n\n boolean urlEquals(URL url1, URL url2) {\n return url1.equals(url2);\n }\n\nInspection ID: UrlHashCode" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UrlHashCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DefaultAnnotationParam", + "shortDescription": { + "text": "Default annotation parameter value" + }, + "fullDescription": { + "text": "Reports annotation parameters that are assigned to their 'default' value. Example: '@interface Test {\n Class expected() default Throwable.class;\n }\n\n @Test(expected = Throwable.class)\n void testSmth() {}' After the quick-fix is applied: '@Test()\n void testSmth() {}' Inspection ID: DefaultAnnotationParam", + "markdown": "Reports annotation parameters that are assigned to their `default` value.\n\nExample:\n\n\n @interface Test {\n Class expected() default Throwable.class;\n }\n\n @Test(expected = Throwable.class)\n void testSmth() {}\n\nAfter the quick-fix is applied:\n\n\n @Test()\n void testSmth() {}\n\nInspection ID: DefaultAnnotationParam" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DefaultAnnotationParam", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WhileLoopSpinsOnField", + "shortDescription": { + "text": "'while' loop spins on field" + }, + "fullDescription": { + "text": "Reports 'while' loops that spin on the value of a non-'volatile' field, waiting for it to be changed by another thread. In addition to being potentially extremely CPU intensive when little work is done inside the loop, such loops are likely to have different semantics from what was intended. The Java Memory Model allows such loops to never complete even if another thread changes the field's value. Additionally, since Java 9 it's recommended to call 'Thread.onSpinWait()' inside a spin loop on a 'volatile' field, which may significantly improve performance on some hardware. Example: 'class SpinsOnField {\n boolean ready = false;\n\n void run() {\n while (!ready) {\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }' After the quick-fix is applied: 'class SpinsOnField {\n volatile boolean ready = false;\n\n void run() {\n while (!ready) {\n Thread.onSpinWait();\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }' Use the inspection options to only report empty 'while' loops. Inspection ID: WhileLoopSpinsOnField", + "markdown": "Reports `while` loops that spin on the value of a non-`volatile` field, waiting for it to be changed by another thread.\n\n\nIn addition to being potentially extremely CPU intensive when little work is done inside the loop, such\nloops are likely to have different semantics from what was intended.\nThe Java Memory Model allows such loops to never complete even if another thread changes the field's value.\n\n\nAdditionally, since Java 9 it's recommended to call `Thread.onSpinWait()` inside a spin loop\non a `volatile` field, which may significantly improve performance on some hardware.\n\n**Example:**\n\n\n class SpinsOnField {\n boolean ready = false;\n\n void run() {\n while (!ready) {\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class SpinsOnField {\n volatile boolean ready = false;\n\n void run() {\n while (!ready) {\n Thread.onSpinWait();\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }\n\n\nUse the inspection options to only report empty `while` loops.\n\n\nInspection ID: WhileLoopSpinsOnField" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "WhileLoopSpinsOnField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IfStatementWithIdenticalBranches", + "shortDescription": { + "text": "'if' statement with identical branches or common parts" + }, + "fullDescription": { + "text": "Reports 'if' statements in which common parts can be extracted from the branches. These common parts are independent from the condition and make 'if' statements harder to understand. Example: 'if (x > 12) {\n doSomethingBefore();\n doSomethingDifferent1();\n doSomethingAfter();\n } else {\n doSomethingBefore();\n doSomethingDifferent2();\n doSomethingAfter();\n }' After the quick-fix is applied: 'doSomethingBefore();\n if (x > 12) {\n doSomethingDifferent1();\n } else {\n doSomethingDifferent2();\n }\n doSomethingAfter();' Updated in 2018.1 Inspection ID: IfStatementWithIdenticalBranches", + "markdown": "Reports `if` statements in which common parts can be extracted from the branches.\n\nThese common parts are independent from the condition and make `if` statements harder to understand.\n\nExample:\n\n\n if (x > 12) {\n doSomethingBefore();\n doSomethingDifferent1();\n doSomethingAfter();\n } else {\n doSomethingBefore();\n doSomethingDifferent2();\n doSomethingAfter();\n }\n\nAfter the quick-fix is applied:\n\n\n doSomethingBefore();\n if (x > 12) {\n doSomethingDifferent1();\n } else {\n doSomethingDifferent2();\n }\n doSomethingAfter();\n\nUpdated in 2018.1\n\nInspection ID: IfStatementWithIdenticalBranches" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "IfStatementWithIdenticalBranches", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InterfaceWithOnlyOneDirectInheritor", + "shortDescription": { + "text": "Interface with a single direct inheritor" + }, + "fullDescription": { + "text": "Reports interfaces that have precisely one direct inheritor. While such interfaces may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the interface with its inheritor. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Inspection ID: InterfaceWithOnlyOneDirectInheritor", + "markdown": "Reports interfaces that have precisely one direct inheritor. While such interfaces may offer admirable clarity of design, in memory-constrained or bandwidth-limited environments, they needlessly increase the total footprint of the application. Consider merging the interface with its inheritor.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\nInspection ID: InterfaceWithOnlyOneDirectInheritor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InterfaceWithOnlyOneDirectInheritor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InstanceofChain", + "shortDescription": { + "text": "Chain of 'instanceof' checks" + }, + "fullDescription": { + "text": "Reports any chains of 'if'-'else' statements all of whose conditions are 'instanceof' expressions or class equality expressions (e.g. comparison with 'String.class'). Such constructions usually indicate a failure in object-oriented design which dictates that such type-based dispatch should be done via polymorphic method calls rather than explicit chains of type tests. Example: 'double getArea(Shape shape) {\n // Warning: abstraction failure.\n // It would be better to declare a getArea()\n // abstract method in the shape interface\n // and implement it in every inheritor.\n if (shape instanceof Point) {\n return 0;\n }\n if (shape instanceof Circle) {\n return Math.PI *\n Math.pow(((Circle) shape).radius(), 2);\n }\n if (shape instanceof Rectangle) {\n return ((Rectangle) shape).width() *\n ((Rectangle) shape).height();\n }\n throw new IllegalArgumentException();\n }' Use the checkbox below to ignore 'instanceof' expressions on library classes. Inspection ID: InstanceofChain", + "markdown": "Reports any chains of `if`-`else` statements all of whose conditions are `instanceof` expressions or class equality expressions (e.g. comparison with `String.class`). Such constructions usually indicate a failure in object-oriented design which dictates that such type-based dispatch should be done via polymorphic method calls rather than explicit chains of type tests.\n\nExample:\n\n\n double getArea(Shape shape) {\n // Warning: abstraction failure.\n // It would be better to declare a getArea()\n // abstract method in the shape interface\n // and implement it in every inheritor.\n if (shape instanceof Point) {\n return 0;\n }\n if (shape instanceof Circle) {\n return Math.PI *\n Math.pow(((Circle) shape).radius(), 2);\n }\n if (shape instanceof Rectangle) {\n return ((Rectangle) shape).width() *\n ((Rectangle) shape).height();\n }\n throw new IllegalArgumentException();\n }\n\n\nUse the checkbox below to ignore `instanceof` expressions on library classes.\n\n\nInspection ID: InstanceofChain" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ChainOfInstanceofChecks", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BlockMarkerComments", + "shortDescription": { + "text": "Block marker comment" + }, + "fullDescription": { + "text": "Reports comments which are used as code block markers. The quick-fix removes such comments. Example: 'while (i < 10) {\n i++;\n } // end while' After the quick-fix is applied: 'while (i < 10) {\n i++;\n }' Inspection ID: BlockMarkerComments", + "markdown": "Reports comments which are used as code block markers. The quick-fix removes such comments.\n\nExample:\n\n\n while (i < 10) {\n i++;\n } // end while\n\nAfter the quick-fix is applied:\n\n\n while (i < 10) {\n i++;\n }\n\nInspection ID: BlockMarkerComments" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BlockMarkerComments", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerializableHasSerializationMethods", + "shortDescription": { + "text": "Serializable class without 'readObject()' and 'writeObject()'" + }, + "fullDescription": { + "text": "Reports 'Serializable' classes that do not implement 'readObject()' and 'writeObject()' methods. If 'readObject()' and 'writeObject()' methods are not implemented, the default serialization algorithms are used, which may be sub-optimal for performance and compatibility in many environments. Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Whether to ignore 'Serializable' classes without non-static fields. Whether to ignore 'Serializable' anonymous classes. Inspection ID: SerializableHasSerializationMethods", + "markdown": "Reports `Serializable` classes that do not implement `readObject()` and `writeObject()` methods.\n\n\nIf `readObject()` and `writeObject()` methods are not implemented,\nthe default serialization algorithms are used,\nwhich may be sub-optimal for performance and compatibility in many environments.\n\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization.\n* Whether to ignore `Serializable` classes without non-static fields.\n* Whether to ignore `Serializable` anonymous classes.\n\nInspection ID: SerializableHasSerializationMethods" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SerializableHasSerializationMethods", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SynchronizeOnLock", + "shortDescription": { + "text": "Synchronization on a 'Lock' object" + }, + "fullDescription": { + "text": "Reports 'synchronized' blocks that lock on an instance of 'java.util.concurrent.locks.Lock'. Such synchronization is almost certainly unintended, and appropriate versions of '.lock()' and '.unlock()' should be used instead. Example: 'final ReentrantLock lock = new ReentrantLock();\n\n public void foo() {\n synchronized (lock) {}\n }' Inspection ID: SynchronizeOnLock", + "markdown": "Reports `synchronized` blocks that lock on an instance of `java.util.concurrent.locks.Lock`. Such synchronization is almost certainly unintended, and appropriate versions of `.lock()` and `.unlock()` should be used instead.\n\n**Example:**\n\n\n final ReentrantLock lock = new ReentrantLock();\n\n public void foo() {\n synchronized (lock) {}\n }\n\nInspection ID: SynchronizeOnLock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SynchroniziationOnLockObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BadExceptionCaught", + "shortDescription": { + "text": "Prohibited 'Exception' caught" + }, + "fullDescription": { + "text": "Reports 'catch' clauses that catch an inappropriate exception. Some exceptions, for example 'java.lang.NullPointerException' or 'java.lang.IllegalMonitorStateException', represent programming errors and therefore almost certainly should not be caught in production code. Example: 'try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }' Use the Prohibited exceptions list to specify which exceptions should be reported. Inspection ID: BadExceptionCaught", + "markdown": "Reports `catch` clauses that catch an inappropriate exception.\n\nSome exceptions, for example\n`java.lang.NullPointerException` or\n`java.lang.IllegalMonitorStateException`, represent programming errors\nand therefore almost certainly should not be caught in production code.\n\n**Example:**\n\n\n try {\n return component.getMousePosition(true) != null;\n } catch (NullPointerException e) { // warning: Prohibited exception 'NullPointerException' caught\n return false;\n }\n\nUse the **Prohibited exceptions** list to specify which exceptions should be reported.\n\n\nInspection ID: BadExceptionCaught" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ProhibitedExceptionCaught", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IdempotentLoopBody", + "shortDescription": { + "text": "Idempotent loop body" + }, + "fullDescription": { + "text": "Reports loops whose second and all subsequent iterations do not produce any additional side effects other than the one produced by the first iteration, which can indicate a programming error. Such loops may iterate only zero, one, or infinite number of times. If the infinite number of times case is unreachable, such a loop can be replaced with an 'if' statement. Otherwise, there's a possibility that the program can get stuck. Example: 'public void foo(String baseName, String names) {\n int suffix = 1;\n String name = baseName;\n while (names.contains(name)) {\n // error: suffix is not updated making loop body idempotent\n name = baseName + suffix;\n }\n }' Inspection ID: IdempotentLoopBody New in 2018.1", + "markdown": "Reports loops whose second and all subsequent iterations do not produce any additional side effects other than the one produced by the first iteration, which can indicate a programming error.\n\nSuch loops may iterate only zero, one, or infinite number of times.\nIf the infinite number of times case is unreachable, such a loop can be replaced with an `if` statement.\nOtherwise, there's a possibility that the program can get stuck.\n\nExample:\n\n\n public void foo(String baseName, String names) {\n int suffix = 1;\n String name = baseName;\n while (names.contains(name)) {\n // error: suffix is not updated making loop body idempotent\n name = baseName + suffix;\n }\n }\n\nInspection ID: IdempotentLoopBody\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IdempotentLoopBody", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantImplements", + "shortDescription": { + "text": "Redundant interface declaration" + }, + "fullDescription": { + "text": "Reports interfaces in a class' 'implements' list or an interface's 'extends' list that are already implemented by a superclass or extended by a superinterface. Such declarations are unnecessary and may be safely removed. Example: 'class X implements One, Two {\n }\n interface One {}\n interface Two extends One {}' After the quick-fix is applied: 'class X implements Two {\n }\n interface One {}\n interface Two extends One {}' Use the options to not report on 'Serializable' or 'Externalizable' in an 'extends' or 'implements' list. Inspection ID: RedundantImplements", + "markdown": "Reports interfaces in a class' `implements` list or an interface's `extends` list that are already implemented by a superclass or extended by a superinterface. Such declarations are unnecessary and may be safely removed.\n\n**Example:**\n\n\n class X implements One, Two {\n }\n interface One {}\n interface Two extends One {}\n\nAfter the quick-fix is applied:\n\n\n class X implements Two {\n }\n interface One {}\n interface Two extends One {}\n\n\nUse the options to not report on `Serializable` or `Externalizable`\nin an `extends` or `implements` list.\n\nInspection ID: RedundantImplements" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantInterfaceDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InstanceofCatchParameter", + "shortDescription": { + "text": "'instanceof' on 'catch' parameter" + }, + "fullDescription": { + "text": "Reports cases in which an 'instanceof' expression is used for testing the type of a parameter in a 'catch' block. Testing the type of 'catch' parameters is usually better done by having separate 'catch' blocks instead of using 'instanceof'. Example: 'void foo(Runnable runnable) {\n try {\n runnable.run();\n } catch (Throwable throwable) {\n if (throwable instanceof NoClassDefFoundError) { // warning: 'instanceof' on 'catch' parameter 'throwable'\n System.out.println(\"Class not found!\");\n }\n }\n }' Inspection ID: InstanceofCatchParameter", + "markdown": "Reports cases in which an `instanceof` expression is used for testing the type of a parameter in a `catch` block.\n\nTesting the type of `catch` parameters is usually better done by having separate\n`catch` blocks instead of using `instanceof`.\n\n**Example:**\n\n\n void foo(Runnable runnable) {\n try {\n runnable.run();\n } catch (Throwable throwable) {\n if (throwable instanceof NoClassDefFoundError) { // warning: 'instanceof' on 'catch' parameter 'throwable'\n System.out.println(\"Class not found!\");\n }\n }\n }\n\nInspection ID: InstanceofCatchParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InstanceofCatchParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantScheduledForRemovalAnnotation", + "shortDescription": { + "text": "Redundant @ScheduledForRemoval annotation" + }, + "fullDescription": { + "text": "Reports usages of '@ApiStatus.ScheduledForRemoval' annotation without 'inVersion' attribute in code which targets Java 9 or newer version. Such usages can be replaced by 'forRemoval' attribute in '@Deprecated' annotation to simplify code. Inspection ID: RedundantScheduledForRemovalAnnotation New in 2022.1", + "markdown": "Reports usages of `@ApiStatus.ScheduledForRemoval` annotation without `inVersion` attribute in code which targets Java 9 or newer version.\n\n\nSuch usages can be replaced by `forRemoval` attribute in `@Deprecated` annotation to simplify code.\n\nInspection ID: RedundantScheduledForRemovalAnnotation\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantScheduledForRemovalAnnotation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OptionalGetWithoutIsPresent", + "shortDescription": { + "text": "Optional.get() is called without isPresent() check" + }, + "fullDescription": { + "text": "Reports calls to 'get()' on an 'Optional' without checking that it has a value. Calling 'Optional.get()' on an empty 'Optional' instance will throw an exception. Example: 'void x(List list) {\n final Optional optional =\n list.stream().filter(x -> x > 10).findFirst();\n final Integer result = optional.get(); // problem here\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalGetWithoutIsPresent", + "markdown": "Reports calls to `get()` on an `Optional` without checking that it has a value.\n\nCalling `Optional.get()` on an empty `Optional` instance will throw an exception.\n\n**Example:**\n\n\n void x(List list) {\n final Optional optional =\n list.stream().filter(x -> x > 10).findFirst();\n final Integer result = optional.get(); // problem here\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalGetWithoutIsPresent" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "OptionalGetWithoutIsPresent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FrequentlyUsedInheritorInspection", + "shortDescription": { + "text": "Class may extend a commonly used base class" + }, + "fullDescription": { + "text": "Reports classes or interfaces that can be replaced with an implementation or extension of a more specific commonly used class or interface. For this inspection to work, a superclass needs to be in project source files and the project needs to use the IntelliJ IDEA build system. Example: 'class MyInheritor implements A {} // B suggested on the A reference\n\n interface A {}\n\n abstract class B implements A {}\n\n abstract class C1 extends B {}\n abstract class C2 extends B {}\n abstract class C3 extends B {}\n abstract class C4 extends B {}\n abstract class C5 extends B {}' By default, this inspection doesn't highlight issues in the editor but only provides a quick-fix. New in 2017.2 Inspection ID: FrequentlyUsedInheritorInspection", + "markdown": "Reports classes or interfaces that can be replaced with an implementation or extension of a more specific commonly used class or interface.\n\nFor this inspection to work, a superclass needs to be in project source files and the project needs to use the IntelliJ IDEA build system.\n\n**Example:**\n\n\n class MyInheritor implements A {} // B suggested on the A reference\n\n interface A {}\n\n abstract class B implements A {}\n\n abstract class C1 extends B {}\n abstract class C2 extends B {}\n abstract class C3 extends B {}\n abstract class C4 extends B {}\n abstract class C5 extends B {}\n\nBy default, this inspection doesn't highlight issues in the editor but only provides a quick-fix.\n\nNew in 2017.2\n\nInspection ID: FrequentlyUsedInheritorInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "FrequentlyUsedInheritorInspection", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OnDemandImport", + "shortDescription": { + "text": "'*' import" + }, + "fullDescription": { + "text": "Reports any 'import' statements that cover entire packages ('* imports'). Some coding standards prohibit such 'import' statements. You can configure IntelliJ IDEA to detect and fix such statements with its Optimize Imports command. Go to Settings | Editor | Code Style | Java | Imports, make sure that the Use single class import option is enabled, and specify values in the Class count to use import with '*' and Names count to use static import with '*' fields. Thus this inspection is mostly useful for offline reporting on code bases that you don't intend to change. Inspection ID: OnDemandImport", + "markdown": "Reports any `import` statements that cover entire packages ('\\* imports').\n\nSome coding standards prohibit such `import` statements.\n\n\nYou can configure IntelliJ IDEA to detect and fix such statements with its **Optimize Imports**\ncommand. Go to [Settings \\| Editor \\| Code Style \\| Java \\| Imports](settings://preferences.sourceCode.Java?Use%20single%20class%20import),\nmake sure that the **Use single class import** option is enabled, and specify values in the\n**Class count to use import with '\\*'** and **Names count to use static import with '\\*'** fields.\nThus this inspection is mostly useful for offline reporting on code bases that you don't\nintend to change.\n\nInspection ID: OnDemandImport" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OnDemandImport", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Imports", + "index": 21, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FallthruInSwitchStatement", + "shortDescription": { + "text": "Fallthrough in 'switch' statement" + }, + "fullDescription": { + "text": "Reports 'fall-through' in a 'switch' statement. Fall-through occurs when a series of executable statements after a 'case' label is not guaranteed to transfer control before the next 'case' label. For example, this can happen if the branch is missing a 'break' statement. In that case, control falls through to the statements after that 'switch' label, even though the 'switch' expression is not equal to the value of the fallen-through label. While occasionally intended, this construction is confusing and is often the result of a typo. This inspection ignores any fall-through commented with a text matching the regex pattern '(?i)falls?\\s*thro?u'. There is a fix that adds a 'break' to the branch that can fall through to the next branch. Example: 'switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n // no break here\n } else {\n break;\n }\n case (6):\n System.out.println(\"4\");\n }' After the quick-fix is applied: 'switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n } else {\n break;\n }\n break;\n case (6):\n System.out.println(\"4\");\n }' Inspection ID: FallthruInSwitchStatement", + "markdown": "Reports 'fall-through' in a `switch` statement.\n\nFall-through occurs when a series of executable statements after a `case` label is not guaranteed\nto transfer control before the next `case` label. For example, this can happen if the branch is missing a `break` statement.\nIn that case, control falls through to the statements after\nthat `switch` label, even though the `switch` expression is not equal to\nthe value of the fallen-through label. While occasionally intended, this construction is confusing and is often the result of a typo.\n\n\nThis inspection ignores any fall-through commented with a text matching the regex pattern `(?i)falls?\\s*thro?u`.\n\nThere is a fix that adds a `break` to the branch that can fall through to the next branch.\n\nExample:\n\n\n switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n // no break here\n } else {\n break;\n }\n case (6):\n System.out.println(\"4\");\n }\n\nAfter the quick-fix is applied:\n\n\n switch(x) {\n case (4):\n if (condition) {\n System.out.println(\"3\");\n } else {\n break;\n }\n break;\n case (6):\n System.out.println(\"4\");\n }\n\n\nInspection ID: FallthruInSwitchStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "fallthrough", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantOperationOnEmptyContainer", + "shortDescription": { + "text": "Redundant operation on empty container" + }, + "fullDescription": { + "text": "Reports redundant operations on empty collections, maps or arrays. Iterating, removing elements, sorting, and some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug. Example: 'if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }' Inspection ID: RedundantOperationOnEmptyContainer New in 2019.1", + "markdown": "Reports redundant operations on empty collections, maps or arrays.\n\n\nIterating, removing elements, sorting,\nand some other operations on empty collections have no effect and can be removed. Also, they may be a signal of a bug.\n\n**Example:**\n\n\n if (numbers.isEmpty()){\n //error due to the missed negation\n int max = numbers.stream().max(Comparator.naturalOrder()).get();\n ...\n }\n\nInspection ID: RedundantOperationOnEmptyContainer\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantOperationOnEmptyContainer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OptionalIsPresent", + "shortDescription": { + "text": "Non functional style 'Optional.isPresent()' usage" + }, + "fullDescription": { + "text": "Reports 'Optional' expressions used as 'if' or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read. Example: 'if (str.isPresent()) str.get().trim();' After the quick-fix is applied: 'str.ifPresent(String::trim);' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalIsPresent", + "markdown": "Reports `Optional` expressions used as `if` or conditional expression conditions, that can be rewritten in a functional style. The result is often shorter and easier to read.\n\nExample:\n\n\n if (str.isPresent()) str.get().trim();\n\nAfter the quick-fix is applied:\n\n\n str.ifPresent(String::trim);\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalIsPresent" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OptionalIsPresent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AtomicFieldUpdaterNotStaticFinal", + "shortDescription": { + "text": "'AtomicFieldUpdater' field not declared 'static final'" + }, + "fullDescription": { + "text": "Reports fields of types: 'java.util.concurrent.atomic.AtomicLongFieldUpdater' 'java.util.concurrent.atomic.AtomicIntegerFieldUpdater' 'java.util.concurrent.atomic.AtomicReferenceFieldUpdater' that are not 'static final'. Because only one atomic field updater is needed for updating a 'volatile' field in all instances of a class, it can almost always be 'static'. Making the updater 'final' allows the JVM to optimize access for improved performance. Example: 'class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater

idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }' After the quick-fix is applied: 'class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }' Inspection ID: AtomicFieldUpdaterNotStaticFinal", + "markdown": "Reports fields of types:\n\n* `java.util.concurrent.atomic.AtomicLongFieldUpdater`\n* `java.util.concurrent.atomic.AtomicIntegerFieldUpdater`\n* `java.util.concurrent.atomic.AtomicReferenceFieldUpdater`\n\nthat are not `static final`. Because only one atomic field updater is needed for updating a `volatile` field in all instances of a class, it can almost always be `static`.\n\nMaking the updater `final` allows the JVM to optimize access for improved performance.\n\n**Example:**\n\n\n class Main {\n private volatile int id;\n private AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private volatile int id;\n private static final AtomicIntegerFieldUpdater
idFieldUpdater = AtomicIntegerFieldUpdater.newUpdater(Main.class, \"id\");\n }\n\nInspection ID: AtomicFieldUpdaterNotStaticFinal" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AtomicFieldUpdaterNotStaticFinal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldNamingConvention", + "shortDescription": { + "text": "Field naming convention" + }, + "fullDescription": { + "text": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern. Example: if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant produces a warning because the length of its name is 3, which is less than 5: 'public static final int MAX = 42;'. A quick-fix that renames such fields is available only in the editor. Configure the inspection: Use the list in the Options section to specify which fields should be checked. Deselect the checkboxes for the fields for which you want to skip the check. For each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the provided input fields. Specify 0 in the length fields to skip the corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: FieldNamingConvention", + "markdown": "Reports fields whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** if the inspection is enabled for constants, and the minimum specified length for a field name is 5 (the default), the following constant\nproduces a warning because the length of its name is 3, which is less than 5: `public static final int MAX = 42;`.\n\nA quick-fix that renames such fields is available only in the editor.\n\nConfigure the inspection:\n\nUse the list in the **Options** section to specify which fields should be checked. Deselect the checkboxes for the fields for which\nyou want to skip the check.\n\nFor each field type, specify the minimum length, maximum length, and the regular expression expected for field names using the\nprovided input fields.\nSpecify **0** in the length fields to skip the corresponding checks.\n\nRegular expressions should be specified in the standard\n`java.util.regex` format.\n\nInspection ID: FieldNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FieldNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java8MapForEach", + "shortDescription": { + "text": "Map.forEach() can be used" + }, + "fullDescription": { + "text": "Suggests replacing 'for(Entry entry : map.entrySet()) {...}' or 'map.entrySet().forEach(entry -> ...)' with 'map.forEach((key, value) -> ...)'. Example 'void print(Map map) {\n map.entrySet().forEach(entry -> {\n String str = entry.getKey();\n System.out.println(str + \":\" + entry.getValue());\n });\n }' After the quick-fix is applied: 'void print(Map map) {\n map.forEach((str, value) -> System.out.println(str + \":\" + value));\n }' When the Do not report loops option is enabled, only 'entrySet().forEach()' cases will be reported. However, the quick-fix action will be available for 'for'-loops as well. This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: Java8MapForEach New in 2017.1", + "markdown": "Suggests replacing `for(Entry entry : map.entrySet()) {...}` or `map.entrySet().forEach(entry -> ...)` with `map.forEach((key, value) -> ...)`.\n\nExample\n\n\n void print(Map map) {\n map.entrySet().forEach(entry -> {\n String str = entry.getKey();\n System.out.println(str + \":\" + entry.getValue());\n });\n }\n\nAfter the quick-fix is applied:\n\n\n void print(Map map) {\n map.forEach((str, value) -> System.out.println(str + \":\" + value));\n }\n\n\nWhen the **Do not report loops** option is enabled, only `entrySet().forEach()` cases will be reported.\nHowever, the quick-fix action will be available for `for`-loops as well.\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: Java8MapForEach\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Java8MapForEach", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassNamePrefixedWithPackageName", + "shortDescription": { + "text": "Class name prefixed with package name" + }, + "fullDescription": { + "text": "Reports classes whose names are prefixed with their package names, ignoring differences in capitalization. While occasionally having such names is reasonable, they are often used due to a poor naming scheme, may be redundant and annoying. Example: 'package byteCode;\n class ByteCodeAnalyzer {}' A quick-fix that renames such classes is available only in the editor. Inspection ID: ClassNamePrefixedWithPackageName", + "markdown": "Reports classes whose names are prefixed with their package names, ignoring differences in capitalization.\n\nWhile occasionally having such names is reasonable, they are often used due to a poor naming scheme, may be redundant and\nannoying.\n\n**Example:**\n\n\n package byteCode;\n class ByteCodeAnalyzer {}\n\nA quick-fix that renames such classes is available only in the editor.\n\n\nInspection ID: ClassNamePrefixedWithPackageName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassNamePrefixedWithPackageName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Class", + "index": 68, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantConditionalExpression", + "shortDescription": { + "text": "Constant conditional expression" + }, + "fullDescription": { + "text": "Reports conditional expressions in which the condition is either a 'true' or 'false' constant. These expressions sometimes occur as a result of automatic refactorings and may be simplified. Example: 'return true ? \"Yes\" : \"No\";' After quick-fix is applied: 'return \"Yes\";' Inspection ID: ConstantConditionalExpression", + "markdown": "Reports conditional expressions in which the condition is either a `true` or `false` constant. These expressions sometimes occur as a result of automatic refactorings and may be simplified.\n\nExample:\n\n\n return true ? \"Yes\" : \"No\";\n\nAfter quick-fix is applied:\n\n\n return \"Yes\";\n\nInspection ID: ConstantConditionalExpression" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantConditionalExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SameParameterValue", + "shortDescription": { + "text": "Method parameter always has the same value" + }, + "fullDescription": { + "text": "Reports method parameters that always have the same constant value. Example: 'static void printPoint(int x, int y) { // x is always 0\n System.out.println(x + \", \" + y);\n }\n\n public static void main(String[] args) {\n printPoint(0, 1);\n printPoint(0, 2);\n }' The quick-fix inlines the constant value. This may simplify the method implementation. Use the Ignore when a quick-fix can not be provided option to suppress the inspections when: the parameter is modified inside the method the parameter value that is being passed is a reference to an inaccessible field (Java ony) the parameter is a vararg (Java only) Use the Maximal method visibility option to control the maximum visibility of methods to be reported. Use the Minimal method usage count to report parameter field to specify the minimal number of method usages with the same parameter value. Inspection ID: SameParameterValue", + "markdown": "Reports method parameters that always have the same constant value.\n\nExample:\n\n\n static void printPoint(int x, int y) { // x is always 0\n System.out.println(x + \", \" + y);\n }\n\n public static void main(String[] args) {\n printPoint(0, 1);\n printPoint(0, 2);\n }\n\nThe quick-fix inlines the constant value. This may simplify the method implementation.\n\n\nUse the **Ignore when a quick-fix can not be provided** option to suppress the inspections when:\n\n* the parameter is modified inside the method\n* the parameter value that is being passed is a reference to an inaccessible field (Java ony)\n* the parameter is a vararg (Java only)\n\n\nUse the **Maximal method visibility** option to control the maximum visibility of methods to be reported.\n\n\nUse the **Minimal method usage count to report parameter** field to specify the minimal number of method usages with the same parameter value.\n\nInspection ID: SameParameterValue" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SameParameterValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CatchMayIgnoreException", + "shortDescription": { + "text": "Catch block may ignore exception" + }, + "fullDescription": { + "text": "Reports 'catch' blocks that are empty or may ignore an exception. While occasionally intended, empty 'catch' blocks may complicate debugging. Also, ignoring a 'catch' parameter might be wrong. Finally, the static code analyzer reports if it detects that a 'catch' block may silently ignore important VM exceptions like 'NullPointerException'. Ignoring such an exception (without logging or rethrowing it) may hide a bug. The inspection won't report any 'catch' parameters named 'ignore' or 'ignored'. Conversely, the inspection will warn you about any 'catch' parameters named 'ignore' or 'ignored' that are actually in use. Additionally, the inspection won't report 'catch' parameters inside test sources named 'expected' or 'ok'. You can use a quick-fix to change the exception name to 'ignored'. For empty catch blocks, an additional quick-fix to generate the catch body is suggested. You can modify the \"Catch Statement Body\" template on the Code tab in Settings | Editor | File and Code Templates. Example: 'try {\n throwingMethod();\n } catch (IOException ex) {\n\n }' After the quick-fix is applied: 'try {\n System.out.println(System.in.read());\n } catch (IOException ignored) {\n\n }' Configure the inspection: Use the Do not warn when 'catch' block contains a comment option to ignore 'catch' blocks with comments. Use the Do not warn when 'catch' block is not empty option to ignore 'catch' blocks that contain statements or comments inside, while the variable itself is not used. Use the Do not warn when exception named 'ignore(d)' is not actually ignored option to ignore variables named 'ignored' if they are in use. Inspection ID: CatchMayIgnoreException New in 2018.1", + "markdown": "Reports `catch` blocks that are empty or may ignore an exception.\n\nWhile occasionally intended, empty `catch` blocks may complicate debugging.\nAlso, ignoring a `catch` parameter might be wrong.\nFinally, the static code analyzer reports if it detects that a `catch` block may silently ignore important VM\nexceptions like `NullPointerException`. Ignoring such an exception\n(without logging or rethrowing it) may hide a bug.\n\n\nThe inspection won't report any `catch` parameters named `ignore` or `ignored`.\nConversely, the inspection will warn you about any `catch` parameters named `ignore` or `ignored` that are actually in use.\nAdditionally, the inspection won't report `catch` parameters inside test sources named `expected` or `ok`.\n\n\nYou can use a quick-fix to change the exception name to `ignored`.\nFor empty **catch** blocks, an additional quick-fix to generate the **catch** body is suggested.\nYou can modify the \"Catch Statement Body\" template on the Code tab in\n[Settings \\| Editor \\| File and Code Templates](settings://fileTemplates).\n\n**Example:**\n\n\n try {\n throwingMethod();\n } catch (IOException ex) {\n\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n System.out.println(System.in.read());\n } catch (IOException ignored) {\n\n }\n\nConfigure the inspection:\n\n* Use the **Do not warn when 'catch' block contains a comment** option to ignore `catch` blocks with comments.\n* Use the **Do not warn when 'catch' block is not empty** option to ignore `catch` blocks that contain statements or comments inside, while the variable itself is not used.\n* Use the **Do not warn when exception named 'ignore(d)' is not actually ignored** option to ignore variables named `ignored` if they are in use.\n\nInspection ID: CatchMayIgnoreException\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CatchMayIgnoreException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithTooManyDependents", + "shortDescription": { + "text": "Class with too many dependents" + }, + "fullDescription": { + "text": "Reports a class on which too many other classes are directly dependent. Any modification to such a class may require changing many other classes, which may be expensive. Only top-level classes are reported. Use the field below to specify the maximum allowed number of dependents for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassWithTooManyDependents", + "markdown": "Reports a class on which too many other classes are directly dependent.\n\nAny modification to such a class may require changing many other classes, which may be expensive.\n\nOnly top-level classes are reported.\n\nUse the field below to specify the maximum allowed number of dependents for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassWithTooManyDependents" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithTooManyDependents", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Dependency issues", + "index": 93, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RecordStoreResource", + "shortDescription": { + "text": "'RecordStore' opened but not safely closed" + }, + "fullDescription": { + "text": "Reports Java ME 'javax.microedition.rms.RecordStore' resources that are not opened in front of a 'try' block and closed in the corresponding 'finally' block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }' Inspection ID: RecordStoreResource", + "markdown": "Reports Java ME `javax.microedition.rms.RecordStore` resources that are not opened in front of a `try` block and closed in the corresponding `finally` block.\n\nSuch resources may be inadvertently leaked if an exception is thrown before the resource is closed.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n void foo1() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // warning\n }\n void foo2() throws RecordStoreException {\n RecordStore rs = RecordStore.openRecordStore(\"bar\", true); // no warning\n try {\n /* ... */\n } finally {\n rs.closeRecordStore();\n }\n }\n\nInspection ID: RecordStoreResource" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RecordStoreOpenedButNotSafelyClosed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectsEqualsCanBeSimplified", + "shortDescription": { + "text": "'Objects.equals()' can be replaced with 'equals()'" + }, + "fullDescription": { + "text": "Reports calls to 'Objects.equals(a, b)' in which the first argument is statically known to be non-null. Such a call can be safely replaced with 'a.equals(b)' or 'a == b' if both arguments are primitives. Example: 'String defaultName = \"default\";\n boolean isDefault = Objects.equals(defaultName, name);' After the quick-fix is applied: 'String defaultName = \"default\";\n boolean isDefault = defaultName.equals(name);' This inspection depends on the Java feature 'java.util.Objects API', which is available since Java 7. Inspection ID: ObjectsEqualsCanBeSimplified New in 2018.3", + "markdown": "Reports calls to `Objects.equals(a, b)` in which the first argument is statically known to be non-null.\n\nSuch a call can be safely replaced with `a.equals(b)` or `a == b` if both arguments are primitives.\n\nExample:\n\n\n String defaultName = \"default\";\n boolean isDefault = Objects.equals(defaultName, name);\n\nAfter the quick-fix is applied:\n\n\n String defaultName = \"default\";\n boolean isDefault = defaultName.equals(name);\n\nThis inspection depends on the Java feature 'java.util.Objects API', which is available since Java 7.\n\nInspection ID: ObjectsEqualsCanBeSimplified\n\nNew in 2018.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ObjectsEqualsCanBeSimplified", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WrongPackageStatement", + "shortDescription": { + "text": "Wrong package statement" + }, + "fullDescription": { + "text": "Detects 'package' statements that do not correspond to the project directory structure. Also, reports classes without 'package' statements if the class is not located directly in source root directory. While it's not strictly mandated by Java language, it's good practise to keep classes from package 'com.example.myapp' inside a 'com/example/myapp' directory directly under a source root. Failure to do this may confuse code readers and make some tools work incorrectly. Inspection ID: WrongPackageStatement", + "markdown": "Detects `package` statements that do not correspond to the project directory structure. Also, reports classes without `package` statements if the class is not located directly in source root directory.\n\nWhile it's not strictly mandated by Java language, it's good practise to keep classes\nfrom package `com.example.myapp` inside a `com/example/myapp` directory directly under\na source root. Failure to do this may confuse code readers and make some tools work incorrectly.\n\nInspection ID: WrongPackageStatement" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "WrongPackageStatement", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassLoaderInstantiation", + "shortDescription": { + "text": "'ClassLoader' instantiation" + }, + "fullDescription": { + "text": "Reports instantiations of the 'java.lang.ClassLoader' class. While often benign, any instantiations of 'ClassLoader' should be closely examined in any security audit. Example: 'Class loadExtraClass(String name) throws Exception {\n try(URLClassLoader loader =\n new URLClassLoader(new URL[]{new URL(\"extraClasses/\")})) {\n return loader.loadClass(name);\n }\n }'\n Inspection ID: ClassLoaderInstantiation", + "markdown": "Reports instantiations of the `java.lang.ClassLoader` class.\n\nWhile often benign, any instantiations of `ClassLoader` should be closely examined in any security audit.\n\n**Example:**\n\n Class loadExtraClass(String name) throws Exception {\n try(URLClassLoader loader =\n new URLClassLoader(new URL[]{new URL(\"extraClasses/\")})) {\n return loader.loadClass(name);\n }\n }\n \nInspection ID: ClassLoaderInstantiation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassLoaderInstantiation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldNotUsedInToString", + "shortDescription": { + "text": "Field not used in 'toString()' method" + }, + "fullDescription": { + "text": "Reports fields that are not used in the 'toString()' method of a class. Helps discover fields added after the 'toString()' method was last updated. The quick-fix regenerates the 'toString()' method. In the Generate | toString() dialog, it is possible to exclude fields from this check. This inspection will also check for problems with getter methods if the Enable getters in code generation option is enabled there. Example: 'public class Relevant {\n private String name; // not used in toString()\n private int index;\n private int length;\n\n @Override\n public String toString() {\n return \"Relevant{\" + \"index=\" + index +\n \", length=\" + length + '}';\n }\n }' After the quick-fix is applied: 'public class Relevant {\n private String name;\n private int index;\n private int length;\n\n @Override\n public String toString() {\n return \"Relevant{\" + \"name='\" + name + '\\'' +\n \", index=\" + index + \", length=\" + length + '}';\n }\n }' Inspection ID: FieldNotUsedInToString", + "markdown": "Reports fields that are not used in the `toString()` method of a class.\n\nHelps discover fields added after the `toString()` method was last updated.\nThe quick-fix regenerates the `toString()` method.\n\n\nIn the **Generate \\| toString()** dialog, it is possible to exclude fields from this check.\nThis inspection will also check for problems with getter methods if the *Enable getters in code generation* option is enabled there.\n\nExample:\n\n\n public class Relevant {\n private String name; // not used in toString()\n private int index;\n private int length;\n\n @Override\n public String toString() {\n return \"Relevant{\" + \"index=\" + index +\n \", length=\" + length + '}';\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Relevant {\n private String name;\n private int index;\n private int length;\n\n @Override\n public String toString() {\n return \"Relevant{\" + \"name='\" + name + '\\'' +\n \", index=\" + index + \", length=\" + length + '}';\n }\n }\n\nInspection ID: FieldNotUsedInToString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FieldNotUsedInToString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/toString() issues", + "index": 123, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MigrateToJavaLangIo", + "shortDescription": { + "text": "Method from 'java.lang.IO' class can be used" + }, + "fullDescription": { + "text": "Reports 'System.out.println()' and 'System.out.print()' calls and suggests replacing them with methods from 'java.lang.IO' class. This inspection helps migrate code to use the newer 'java.lang.IO' class Example: 'System.out.println(\"Hello, World!\");' After the quick-fix is applied: 'IO.println(\"Hello, World!\");' Configure the inspection: Use the Report in regular classes option to report and suggest fixes in regular classes Use the Report in compact source files option to report and suggest fixes in compact source files This inspection depends on the Java feature 'java.lang.IO utility class', which is available since Java 25. Inspection ID: MigrateToJavaLangIo New in 2025.2", + "markdown": "Reports `System.out.println()` and `System.out.print()` calls and suggests replacing them with methods from `java.lang.IO` class.\n\n\nThis inspection helps migrate code to use the newer `java.lang.IO` class\n\n\n**Example:**\n\n System.out.println(\"Hello, World!\");\n\nAfter the quick-fix is applied:\n\n IO.println(\"Hello, World!\");\n\nConfigure the inspection:\n\n* Use the **Report in regular classes** option to report and suggest fixes in regular classes\n* Use the **Report in compact source files** option to report and suggest fixes in compact source files\n\nThis inspection depends on the Java feature 'java.lang.IO utility class', which is available since Java 25.\n\nInspection ID: MigrateToJavaLangIo\n\nNew in 2025.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MigrateToJavaLangIo", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 25", + "index": 92, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CovariantEquals", + "shortDescription": { + "text": "Covariant 'equals()'" + }, + "fullDescription": { + "text": "Reports 'equals()' methods taking an argument type other than 'java.lang.Object' if the containing class does not have other overloads of 'equals()' that take 'java.lang.Object' as its argument type. A covariant version of 'equals()' does not override the 'Object.equals(Object)' method. It may cause unexpected behavior at runtime. For example, if the class is used to construct one of the standard collection classes, which expect that the 'Object.equals(Object)' method is overridden. Example: 'class Foo {\n public boolean equals(Foo foo) { // warning\n return false;\n }\n }\n class Bar {\n public boolean equals(Bar bar) { // no warning here\n return false;\n }\n @Override\n public boolean equals(Object obj) {\n return false;\n }\n }' Inspection ID: CovariantEquals", + "markdown": "Reports `equals()` methods taking an argument type other than `java.lang.Object` if the containing class does not have other overloads of `equals()` that take `java.lang.Object` as its argument type.\n\n\nA covariant version of `equals()` does not override the\n`Object.equals(Object)` method. It may cause unexpected\nbehavior at runtime. For example, if the class is used to construct\none of the standard collection classes, which expect that the\n`Object.equals(Object)` method is overridden.\n\n**Example:**\n\n\n class Foo {\n public boolean equals(Foo foo) { // warning\n return false;\n }\n }\n class Bar {\n public boolean equals(Bar bar) { // no warning here\n return false;\n }\n @Override\n public boolean equals(Object obj) {\n return false;\n }\n }\n\nInspection ID: CovariantEquals" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CovariantEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Convert2Lambda", + "shortDescription": { + "text": "Anonymous type can be replaced with lambda" + }, + "fullDescription": { + "text": "Reports anonymous classes which can be replaced with lambda expressions. Example: 'new Thread(new Runnable() {\n @Override\n public void run() {\n // run thread\n }\n });' After the quick-fix is applied: 'new Thread(() -> {\n // run thread\n });' Note that if an anonymous class is converted into a stateless lambda, the same lambda object can be reused by Java runtime during subsequent invocations. On the other hand, when an anonymous class is used, separate objects are created every time. Thus, applying the quick-fix can cause the semantics change in rare cases, e.g. when anonymous class instances are used as 'HashMap' keys. Use the Report when interface is not annotated with @FunctionalInterface option to ignore the cases in which an anonymous class implements an interface without '@FunctionalInterface' annotation. This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: Convert2Lambda", + "markdown": "Reports anonymous classes which can be replaced with lambda expressions.\n\nExample:\n\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n // run thread\n }\n });\n\nAfter the quick-fix is applied:\n\n\n new Thread(() -> {\n // run thread\n });\n\n\nNote that if an anonymous class is converted into a stateless lambda, the same lambda object\ncan be reused by Java runtime during subsequent invocations. On the other hand, when an anonymous class is used,\nseparate objects are created every time. Thus, applying the quick-fix can cause the semantics change in rare cases,\ne.g. when anonymous class instances are used as `HashMap` keys.\n\n\nUse the **Report when interface is not annotated with @FunctionalInterface** option to ignore the cases in which an anonymous\nclass implements an interface without `@FunctionalInterface` annotation.\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: Convert2Lambda" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Convert2Lambda", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NativeMethods", + "shortDescription": { + "text": "Native method" + }, + "fullDescription": { + "text": "Reports methods declared 'native'. Native methods are inherently unportable. Inspection ID: NativeMethods", + "markdown": "Reports methods declared `native`. Native methods are inherently unportable.\n\nInspection ID: NativeMethods" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NativeMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifiableIfStatement", + "shortDescription": { + "text": "'if' statement can be replaced with conditional or boolean expression" + }, + "fullDescription": { + "text": "Reports 'if' statements that can be replaced with conditions using the '&&', '||', '==', '!=', or '?:' operator. The result is usually shorter, but not always clearer, so it's not advised to apply the fix in every case. Example: 'if (condition) return true; else return foo;' After the quick-fix is applied: 'return condition || foo;' Configure the inspection: Use the Don't suggest '?:' operator option to disable the warning when the '?:' operator is suggested. In this case, only '&&', '||', '==', and '!=' suggestions will be highlighted. The quick-fix will still be available in the editor. Use the Ignore chained 'if' statements option to disable the warning for 'if-else' chains. The quick-fix will still be available in the editor. Inspection ID: SimplifiableIfStatement New in 2018.2", + "markdown": "Reports `if` statements that can be replaced with conditions using the `&&`, `||`, `==`, `!=`, or `?:` operator.\n\nThe result is usually shorter, but not always clearer, so it's not advised to apply the fix in every case.\n\nExample:\n\n\n if (condition) return true; else return foo;\n\nAfter the quick-fix is applied:\n\n\n return condition || foo;\n\nConfigure the inspection:\n\n* Use the **Don't suggest '?:' operator** option to disable the warning when the `?:` operator is suggested. In this case, only `&&`, `||`, `==`, and `!=` suggestions will be highlighted. The quick-fix will still be available in the editor.\n* Use the **Ignore chained 'if' statements** option to disable the warning for `if-else` chains. The quick-fix will still be available in the editor.\n\nInspection ID: SimplifiableIfStatement\n\nNew in 2018.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifiableIfStatement", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EqualsWithItself", + "shortDescription": { + "text": "'equals()' called on itself" + }, + "fullDescription": { + "text": "Reports calls to 'equals()', 'compareTo()' or similar, that compare an object for equality with itself. The method contracts of these methods specify that such calls will always return 'true' for 'equals()' or '0' for 'compareTo()'. The inspection also checks calls to 'Objects.equals()', 'Objects.deepEquals()', 'Arrays.equals()', 'Comparator.compare()', 'assertEquals()' methods of test frameworks (JUnit, TestNG, AssertJ), 'Integer.compare()', 'Integer.compareUnsigned()' and similar methods. Note that in rare cases, the inspection may report 'equals()' calls that return false, because while the expressions on the both sides are the same, they produce separate objects, and comparison is performed on references, rather than on content. The simplest example is 'new Object().equals(new Object())'. In any case, such calls are suspicious, and likely something else was intended. Example: 'class Foo {\n boolean foo(Object o) {\n return o.equals(o); // warning\n }\n\n boolean bar(String[] ss) {\n return Arrays.equals(ss, ss); // warning\n }\n}' Inspection ID: EqualsWithItself", + "markdown": "Reports calls to `equals()`, `compareTo()` or similar, that compare an object for equality with itself. The method contracts of these methods specify that such calls will always return `true` for `equals()` or `0` for `compareTo()`. The inspection also checks calls to `Objects.equals()`, `Objects.deepEquals()`, `Arrays.equals()`, `Comparator.compare()`, `assertEquals()` methods of test frameworks (JUnit, TestNG, AssertJ), `Integer.compare()`, `Integer.compareUnsigned()` and similar methods.\n\n\nNote that in rare cases, the inspection may report `equals()` calls that return false, because while the expressions\non the both sides are the same, they produce separate objects, and comparison is performed on references, rather than on content.\nThe simplest example is `new Object().equals(new Object())`. In any case, such calls are suspicious, and likely\nsomething else was intended.\n\n**Example:**\n\n\n class Foo {\n boolean foo(Object o) {\n return o.equals(o); // warning\n }\n\n boolean bar(String[] ss) {\n return Arrays.equals(ss, ss); // warning\n }\n }\n\nInspection ID: EqualsWithItself" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EqualsWithItself", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassInheritanceDepth", + "shortDescription": { + "text": "Class too deep in inheritance tree" + }, + "fullDescription": { + "text": "Reports classes that are too deep in the inheritance hierarchy. Classes that are too deeply inherited may be confusing and indicate that a refactoring is necessary. All superclasses from a library are treated as a single superclass, libraries are considered unmodifiable. Use the Inheritance depth limit field to specify the maximum inheritance depth for a class. Inspection ID: ClassInheritanceDepth", + "markdown": "Reports classes that are too deep in the inheritance hierarchy.\n\nClasses that are too deeply inherited may be confusing and indicate that a refactoring is necessary.\n\nAll superclasses from a library are treated as a single superclass, libraries are considered unmodifiable.\n\nUse the **Inheritance depth limit** field to specify the maximum inheritance depth for a class.\n\nInspection ID: ClassInheritanceDepth" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassTooDeepInInheritanceTree", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class metrics", + "index": 90, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThrowCaughtLocally", + "shortDescription": { + "text": "'throw' caught by containing 'try' statement" + }, + "fullDescription": { + "text": "Reports 'throw' statements whose exceptions are always caught by containing 'try' statements. Using 'throw' statements as a \"goto\" to change the local flow of control is confusing and results in poor performance. Example: 'try {\n if (!Files.isDirectory(PROJECTS)) {\n throw new IllegalStateException(\"Directory not found.\"); // warning: 'throw' caught by containing 'try' statement\n }\n ...\n } catch (Exception e) {\n LOG.error(\"run failed\");\n }' Use the Ignore rethrown exceptions option to ignore exceptions that are rethrown. Inspection ID: ThrowCaughtLocally", + "markdown": "Reports `throw` statements whose exceptions are always caught by containing `try` statements.\n\nUsing `throw`\nstatements as a \"goto\" to change the local flow of control is confusing and results in poor performance.\n\n**Example:**\n\n\n try {\n if (!Files.isDirectory(PROJECTS)) {\n throw new IllegalStateException(\"Directory not found.\"); // warning: 'throw' caught by containing 'try' statement\n }\n ...\n } catch (Exception e) {\n LOG.error(\"run failed\");\n }\n\nUse the **Ignore rethrown exceptions** option to ignore exceptions that are rethrown.\n\nInspection ID: ThrowCaughtLocally" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ThrowCaughtLocally", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MarkedForRemoval", + "shortDescription": { + "text": "Usage of API marked for removal" + }, + "fullDescription": { + "text": "Reports usages of deprecated APIs (classes, fields, and methods) that are marked for removal with '@Deprecated(forRemoval=true)'. The code that uses an API marked for removal may cause a runtime error with a future version of the API. That is why the recommended severity for this inspection is Error. You can change the severity to Warning if you want to use the same code highlighting as in ordinary deprecation. Inspection ID: MarkedForRemoval New in 2017.3", + "markdown": "Reports usages of deprecated APIs (classes, fields, and methods) that are marked for removal with `@Deprecated(`**forRemoval**`=true)`.\n\n\nThe code that uses an API marked for removal may cause a runtime error with a future version of the API. That is why\nthe recommended severity for this inspection is *Error*.\n\n\nYou can change the severity to *Warning* if you want to use the same code highlighting as in ordinary deprecation.\n\nInspection ID: MarkedForRemoval\n\nNew in 2017.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "removal", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonSerializableWithSerialVersionUIDField", + "shortDescription": { + "text": "Non-serializable class with 'serialVersionUID'" + }, + "fullDescription": { + "text": "Reports non-'Serializable' classes that define a 'serialVersionUID' field. A 'serialVersionUID' field in that context normally indicates an error because the field will be ignored and the class will not be serialized. Example: 'public class IWantToSerializeThis {\n private static final long serialVersionUID = 2669293150219020249L;\n }' Inspection ID: NonSerializableWithSerialVersionUIDField", + "markdown": "Reports non-`Serializable` classes that define a `serialVersionUID` field. A `serialVersionUID` field in that context normally indicates an error because the field will be ignored and the class will not be serialized.\n\n**Example:**\n\n\n public class IWantToSerializeThis {\n private static final long serialVersionUID = 2669293150219020249L;\n }\n\nInspection ID: NonSerializableWithSerialVersionUIDField" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NonSerializableClassWithSerialVersionUID", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SynchronizeOnValueBasedClass", + "shortDescription": { + "text": "Value-based warnings" + }, + "fullDescription": { + "text": "Reports attempts to synchronize on an instance of a value-based class that produce compile-time warnings and raise run-time exceptions starting from Java 16. For example, 'java.lang.Double' is annotated with 'jdk.internal.ValueBased', so the following code will produce a compile-time warning: 'Double d = 20.0;\nsynchronized (d) { ... } // javac warning' Inspection ID: SynchronizeOnValueBasedClass New in 2021.1", + "markdown": "Reports attempts to synchronize on an instance of a value-based class that produce compile-time warnings and raise run-time exceptions starting from Java 16.\n\n\nFor example, `java.lang.Double` is annotated with `jdk.internal.ValueBased`, so the following code will\nproduce a compile-time warning:\n\n\n Double d = 20.0;\n synchronized (d) { ... } // javac warning\n\nInspection ID: SynchronizeOnValueBasedClass\n\nNew in 2021.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "synchronization", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Compiler issues", + "index": 94, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NestedConditionalExpression", + "shortDescription": { + "text": "Nested conditional expression" + }, + "fullDescription": { + "text": "Reports nested conditional expressions as they may result in extremely confusing code. Example: 'int y = a == 10 ? b == 20 ? 10 : a : b;' Inspection ID: NestedConditionalExpression", + "markdown": "Reports nested conditional expressions as they may result in extremely confusing code.\n\nExample:\n\n\n int y = a == 10 ? b == 20 ? 10 : a : b;\n\n\nInspection ID: NestedConditionalExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NestedConditionalExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BulkFileAttributesRead", + "shortDescription": { + "text": "Bulk 'Files.readAttributes()' call can be used" + }, + "fullDescription": { + "text": "Reports multiple sequential 'java.io.File' attribute checks, such as: 'isDirectory()' 'isFile()' 'lastModified()' 'length()' Such calls can be replaced with a bulk 'Files.readAttributes()' call. This is usually more performant than multiple separate attribute checks. Example: 'boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }' After the quick-fix is applied: 'boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }' This inspection does not show a warning if 'IOException' is not handled in the current context, but the quick-fix is still available. Note that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if the file does not exist at all. This inspection only reports if the language level of the project or module is 7 or higher. Inspection ID: BulkFileAttributesRead New in 2022.1", + "markdown": "Reports multiple sequential `java.io.File` attribute checks, such as:\n\n* `isDirectory()`\n* `isFile()`\n* `lastModified()`\n* `length()`\n\nSuch calls can be replaced with a bulk `Files.readAttributes()` call. This is usually more performant than multiple separate attribute checks.\n\nExample:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n return file.isFile() && file.lastModified() > lastModified;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean isNewFile(File file, long lastModified) throws IOException {\n var fileAttributes = Files.readAttributes(file.toPath(), BasicFileAttributes.class);\n return fileAttributes.isRegularFile() && fileAttributes.lastModifiedTime().toMillis() > lastModified;\n }\n\nThis inspection does not show a warning if `IOException` is not handled in the current context, but the quick-fix is still available.\n\nNote that the replacements are usually not completely equivalent and should be applied with care. In particular, the behavior could differ if\nthe file does not exist at all.\n\nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nInspection ID: BulkFileAttributesRead\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BulkFileAttributesRead", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WhileCanBeForeach", + "shortDescription": { + "text": "'while' loop can be replaced with enhanced 'for' loop" + }, + "fullDescription": { + "text": "Reports 'while' loops that iterate over collections and can be replaced with enhanced 'for' loops (foreach iteration syntax). Example: 'Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }' Can be replaced with: 'for (Object obj : c) {\n System.out.println(obj);\n }' This inspection depends on the Java feature 'For-each loops', which is available since Java 5. Inspection ID: WhileCanBeForeach", + "markdown": "Reports `while` loops that iterate over collections and can be replaced with enhanced `for` loops (foreach iteration syntax).\n\n**Example:**\n\n\n Iterator it = c.iterator();\n while(it.hasNext()) {\n Object obj = it.next();\n System.out.println(obj);\n }\n\nCan be replaced with:\n\n\n for (Object obj : c) {\n System.out.println(obj);\n }\n\nThis inspection depends on the Java feature 'For-each loops', which is available since Java 5.\n\nInspection ID: WhileCanBeForeach" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WhileLoopReplaceableByForEach", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ImplicitNumericConversion", + "shortDescription": { + "text": "Implicit numeric conversion" + }, + "fullDescription": { + "text": "Reports implicit conversion between numeric types. Implicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs. Example: 'double m(int i) {\n return i * 10;\n }' After the quick-fix is applied: 'double m(int i) {\n return (double) (i * 10);\n }' Configure the inspection: Use the Ignore widening conversions option to ignore implicit conversion that cannot result in data loss (for example, 'int'->'long'). Use the Ignore conversions from and to 'char' option to ignore conversion from and to 'char'. The inspection will still report conversion from and to floating-point numbers. Use the Ignore conversion from constants and literals to make the inspection ignore conversion from literals and compile-time constants. Inspection ID: ImplicitNumericConversion", + "markdown": "Reports implicit conversion between numeric types.\n\nImplicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs.\n\n**Example:**\n\n\n double m(int i) {\n return i * 10;\n }\n\nAfter the quick-fix is applied:\n\n\n double m(int i) {\n return (double) (i * 10);\n }\n\nConfigure the inspection:\n\n* Use the **Ignore widening conversions** option to ignore implicit conversion that cannot result in data loss (for example, `int`-\\>`long`).\n* Use the **Ignore conversions from and to 'char'** option to ignore conversion from and to `char`. The inspection will still report conversion from and to floating-point numbers.\n* Use the **Ignore conversion from constants and literals** to make the inspection ignore conversion from literals and compile-time constants.\n\nInspection ID: ImplicitNumericConversion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ImplicitNumericConversion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NotNullFieldNotInitialized", + "shortDescription": { + "text": "@NotNull field is not initialized" + }, + "fullDescription": { + "text": "Reports fields annotated as not-null that are not initialized in the constructor. Example: 'public class MyClass {\n private @NotNull String value;\n\n public void setValue(@NotNull String value) {\n this.value = value;\n }\n\n public @NotNull String getValue() {\n return value;\n }\n}' Such fields may violate the not-null constraint. In the example above, the 'setValue' parameter is annotated as not-null, but 'getValue' may return null if the setter was not called. Inspection ID: NotNullFieldNotInitialized", + "markdown": "Reports fields annotated as not-null that are not initialized in the constructor.\n\nExample:\n\n public class MyClass {\n private @NotNull String value;\n\n public void setValue(@NotNull String value) {\n this.value = value;\n }\n\n public @NotNull String getValue() {\n return value;\n }\n }\n\n\nSuch fields may violate the not-null constraint. In the example above, the `setValue` parameter is annotated as not-null, but\n`getValue` may return null if the setter was not called.\n\nInspection ID: NotNullFieldNotInitialized" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NotNullFieldNotInitialized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs/Nullability problems", + "index": 121, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverlyComplexBooleanExpression", + "shortDescription": { + "text": "Overly complex boolean expression" + }, + "fullDescription": { + "text": "Reports boolean expressions with too many terms. Such expressions may be confusing and bug-prone. Example: 'cond(x1) && cond(x2) ^ cond(x3) && cond(x4);' Configure the inspection: Use the Maximum number of terms field to specify the maximum number of terms allowed in a boolean expression. Use the Ignore pure conjunctions and disjunctions option to ignore boolean expressions which use only a single boolean operator repeatedly. Inspection ID: OverlyComplexBooleanExpression", + "markdown": "Reports boolean expressions with too many terms. Such expressions may be confusing and bug-prone.\n\nExample:\n\n\n cond(x1) && cond(x2) ^ cond(x3) && cond(x4);\n\nConfigure the inspection:\n\n* Use the **Maximum number of terms** field to specify the maximum number of terms allowed in a boolean expression.\n* Use the **Ignore pure conjunctions and disjunctions** option to ignore boolean expressions which use only a single boolean operator repeatedly.\n\nInspection ID: OverlyComplexBooleanExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyComplexBooleanExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwitchStatementsWithoutDefault", + "shortDescription": { + "text": "'switch' statement without 'default' branch" + }, + "fullDescription": { + "text": "Reports 'switch' statements that do not contain 'default' labels. Adding the 'default' label guarantees that all possible scenarios are covered, and it becomes easier to make assumptions about the current state of the program. Note that by default, the inspection does not report 'switch' statements if all cases for enums or 'sealed' classes are covered. Use the Ignore exhaustive switch statements option if you want to change this behavior. Inspection ID: SwitchStatementsWithoutDefault", + "markdown": "Reports `switch` statements that do not contain `default` labels.\n\nAdding the `default` label guarantees that all possible scenarios are covered, and it becomes\neasier to make assumptions about the current state of the program.\n\n\nNote that by default, the inspection does not report `switch` statements if all cases for enums or `sealed` classes are covered.\nUse the **Ignore exhaustive switch statements** option if you want to change this behavior.\n\n\nInspection ID: SwitchStatementsWithoutDefault" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SwitchStatementWithoutDefaultBranch", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NotifyCalledOnCondition", + "shortDescription": { + "text": "'notify()' or 'notifyAll()' called on 'java.util.concurrent.locks.Condition' object" + }, + "fullDescription": { + "text": "Reports calls to 'notify()' or 'notifyAll()' made on 'java.util.concurrent.locks.Condition' object. This is probably a programming error, and some variant of the 'signal()' or 'signalAll()' method was intended instead, otherwise 'IllegalMonitorStateException' may occur. Example: 'class C {\n final Lock l = new ReentrantLock();\n final Condition c = l.newCondition();\n\n void release() {\n l.lock();\n try {\n c.notifyAll(); // probably 'signalAll()' was intended here\n } finally {\n l.unlock();\n }\n }\n }' Inspection ID: NotifyCalledOnCondition", + "markdown": "Reports calls to `notify()` or `notifyAll()` made on `java.util.concurrent.locks.Condition` object.\n\n\nThis is probably a programming error, and some variant of the `signal()` or\n`signalAll()` method was intended instead, otherwise `IllegalMonitorStateException` may occur.\n\n**Example:**\n\n\n class C {\n final Lock l = new ReentrantLock();\n final Condition c = l.newCondition();\n\n void release() {\n l.lock();\n try {\n c.notifyAll(); // probably 'signalAll()' was intended here\n } finally {\n l.unlock();\n }\n }\n }\n\nInspection ID: NotifyCalledOnCondition" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NotifyCalledOnCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncompatibleMask", + "shortDescription": { + "text": "Incompatible bitwise mask operation" + }, + "fullDescription": { + "text": "Reports bitwise mask expressions which are guaranteed to evaluate to 'true' or 'false'. The inspection checks the expressions of the form '(var & constant1) == constant2' or '(var | constant1) == constant2', where 'constant1' and 'constant2' are incompatible bitmask constants. Example: '// Incompatible mask: as the mask ends in 00,\n // the result could be 0x1200 but not 0x1234\n if ((mask & 0xFF00) == 0x1234) {...}' Inspection ID: IncompatibleMask", + "markdown": "Reports bitwise mask expressions which are guaranteed to evaluate to `true` or `false`.\n\n\nThe inspection checks the expressions of the form `(var & constant1) == constant2` or\n`(var | constant1) == constant2`, where `constant1`\nand `constant2` are incompatible bitmask constants.\n\n**Example:**\n\n // Incompatible mask: as the mask ends in 00,\n // the result could be 0x1200 but not 0x1234\n if ((mask & 0xFF00) == 0x1234) {...}\n\nInspection ID: IncompatibleMask" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IncompatibleBitwiseMaskOperation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Bitwise operation issues", + "index": 103, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NewMethodNamingConvention", + "shortDescription": { + "text": "Method naming convention" + }, + "fullDescription": { + "text": "Reports methods whose names are too short, too long, or do not follow the specified regular expression pattern. Instance methods that override library methods and constructors are ignored by this inspection. Example: if the inspection is enabled for static methods, and the minimum specified method name length is 4 (the default), the following static method produces a warning, because the length of its name is 3, which is less than 4: 'public static int max(int a, int b)'. A quick-fix that renames such methods is available only in the editor. Configure the inspection: Use the list in the Options section to specify which methods should be checked. Deselect the checkboxes for the method types for which you want to skip the check. Specify 0 in the length fields to skip the corresponding checks. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: NewMethodNamingConvention", + "markdown": "Reports methods whose names are too short, too long, or do not follow the specified regular expression pattern.\n\nInstance methods that override library\nmethods and constructors are ignored by this inspection.\n\n**Example:** if the inspection is enabled for static methods, and the minimum specified method name length is 4 (the default),\nthe following static method produces a warning, because the length of its name is 3, which is less\nthan 4: `public static int max(int a, int b)`.\n\nA quick-fix that renames such methods is available only in the editor.\n\nConfigure the inspection:\n\nUse the list in the **Options** section to specify which methods should be checked. Deselect the checkboxes for the method types for which\nyou want to skip the check. Specify **0** in the length fields to skip the corresponding checks.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: NewMethodNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NewMethodNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Method", + "index": 91, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExplicitArgumentCanBeLambda", + "shortDescription": { + "text": "Explicit argument can be lambda" + }, + "fullDescription": { + "text": "Reports method calls that accept a non-trivial expression and can be replaced with an equivalent method call which accepts a lambda instead. Converting an expression to a lambda ensures that the expression won't be evaluated if it's not used inside the method. For example, 'optional.orElse(createDefaultValue())' can be converted to 'optional.orElseGet(this::createDefaultValue)'. This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: ExplicitArgumentCanBeLambda New in 2018.1", + "markdown": "Reports method calls that accept a non-trivial expression and can be replaced with an equivalent method call which accepts a lambda instead.\n\n\nConverting an expression to a lambda ensures that the expression won't be evaluated\nif it's not used inside the method. For example, `optional.orElse(createDefaultValue())` can be converted\nto `optional.orElseGet(this::createDefaultValue)`.\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: ExplicitArgumentCanBeLambda\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ExplicitArgumentCanBeLambda", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EqualsCalledOnEnumConstant", + "shortDescription": { + "text": "'equals()' called on enum value" + }, + "fullDescription": { + "text": "Reports 'equals()' calls on enum constants. Such calls can be replaced by an identity comparison ('==') because two enum constants are equal only when they have the same identity. A quick-fix is available to change the call to a comparison. Example: 'boolean foo(MyEnum value) {\n return value.equals(MyEnum.FOO);\n }' After the quick-fix is applied: 'boolean foo(MyEnum value) {\n return value == MyEnum.FOO;\n }' Inspection ID: EqualsCalledOnEnumConstant", + "markdown": "Reports `equals()` calls on enum constants.\n\nSuch calls can be replaced by an identity comparison (`==`) because two\nenum constants are equal only when they have the same identity.\n\nA quick-fix is available to change the call to a comparison.\n\n**Example:**\n\n\n boolean foo(MyEnum value) {\n return value.equals(MyEnum.FOO);\n }\n\nAfter the quick-fix is applied:\n\n\n boolean foo(MyEnum value) {\n return value == MyEnum.FOO;\n }\n\nInspection ID: EqualsCalledOnEnumConstant" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EqualsCalledOnEnumConstant", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverlyStrongTypeCast", + "shortDescription": { + "text": "Overly strong type cast" + }, + "fullDescription": { + "text": "Reports type casts that are overly strong. For instance, casting an object to 'ArrayList' when casting it to 'List' would do just as well. Note: much like the Redundant type cast inspection, applying the fix for this inspection may change the semantics of your program if you are intentionally using an overly strong cast to cause a 'ClassCastException' to be generated. Example: 'interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }' Use the checkbox below to ignore casts when there's a matching 'instanceof' check in the code. Inspection ID: OverlyStrongTypeCast", + "markdown": "Reports type casts that are overly strong. For instance, casting an object to `ArrayList` when casting it to `List` would do just as well.\n\n\n**Note:** much like the *Redundant type cast*\ninspection, applying the fix for this inspection may change the semantics of your program if you are\nintentionally using an overly strong cast to cause a `ClassCastException` to be generated.\n\nExample:\n\n\n interface Super {\n void doSmth();\n }\n interface Sub extends Super { }\n\n void use(Object obj) {\n // Warning: ((Super)obj).doSmth() could be used\n ((Sub)obj).doSmth();\n }\n\n\nUse the checkbox below to ignore casts when there's a matching `instanceof` check in the code.\n\nInspection ID: OverlyStrongTypeCast" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyStrongTypeCast", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaLangImport", + "shortDescription": { + "text": "Unnecessary import from the 'java.lang' package" + }, + "fullDescription": { + "text": "Reports 'import' statements that refer to the 'java.lang' package. 'java.lang' classes are always implicitly imported, so such import statements are redundant and confusing. Since IntelliJ IDEA can automatically detect and fix such statements with its Optimize Imports command, this inspection is mostly useful for offline reporting on code bases that you don't intend to change. Inspection ID: JavaLangImport", + "markdown": "Reports `import` statements that refer to the `java.lang` package.\n\n\n`java.lang` classes are always implicitly imported, so such import statements are\nredundant and confusing.\n\n\nSince IntelliJ IDEA can automatically detect and fix such statements with its **Optimize Imports** command, this inspection is mostly useful for offline reporting on code bases that you don't intend to change.\n\nInspection ID: JavaLangImport" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JavaLangImport", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Imports", + "index": 21, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UtilityClass", + "shortDescription": { + "text": "Utility class" + }, + "fullDescription": { + "text": "Reports utility classes. Utility classes have all fields and methods declared as 'static' and their presence may indicate a lack of object-oriented design. Use the Ignore if annotated by option to specify special annotations. The inspection ignores classes annotated with one of these annotations. Inspection ID: UtilityClass", + "markdown": "Reports utility classes.\n\nUtility classes have all fields and methods declared as `static` and their\npresence may indicate a lack of object-oriented design.\n\n\nUse the **Ignore if annotated by** option to specify special annotations. The inspection ignores classes annotated with one of\nthese annotations.\n\n\nInspection ID: UtilityClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UtilityClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassNameDiffersFromFileName", + "shortDescription": { + "text": "Class name differs from file name" + }, + "fullDescription": { + "text": "Reports top-level class names that don't match the name of a file containing them. While the Java specification allows for naming non-'public' classes this way, files with unmatched names may be confusing and decrease usefulness of various software tools. Inspection ID: ClassNameDiffersFromFileName", + "markdown": "Reports top-level class names that don't match the name of a file containing them.\n\nWhile the Java specification allows for naming non-`public` classes this way,\nfiles with unmatched names may be confusing and decrease usefulness of various software tools.\n\nInspection ID: ClassNameDiffersFromFileName" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassNameDiffersFromFileName", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HardcodedLineSeparators", + "shortDescription": { + "text": "Hardcoded line separator" + }, + "fullDescription": { + "text": "Reports linefeed ('\\n') and carriage return ('\\r') character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded. Example: 'String count = \"first\\nsecond\\rthird\";' Inspection ID: HardcodedLineSeparators", + "markdown": "Reports linefeed (`\\n`) and carriage return (`\\r`) character escape sequences used in string literals, character literals or text blocks. These characters are commonly used as line separators, and portability may suffer if they are hardcoded.\n\n**Example:**\n\n\n String count = \"first\\nsecond\\rthird\";\n\nInspection ID: HardcodedLineSeparators" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HardcodedLineSeparator", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryConstantArrayCreationExpression", + "shortDescription": { + "text": "Redundant 'new' expression in constant array creation" + }, + "fullDescription": { + "text": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment. Example: 'int[] foo = new int[] {42};' After the quick-fix is applied: 'int[] foo = {42};' Inspection ID: UnnecessaryConstantArrayCreationExpression", + "markdown": "Reports constant new array expressions that can be replaced with an array initializer. Array initializers can omit the type because it is already specified in the left side of the assignment.\n\n**Example:**\n\n\n int[] foo = new int[] {42};\n\nAfter the quick-fix is applied:\n\n\n int[] foo = {42};\n\nInspection ID: UnnecessaryConstantArrayCreationExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryConstantArrayCreationExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LabeledStatement", + "shortDescription": { + "text": "Labeled statement" + }, + "fullDescription": { + "text": "Reports labeled statements that can complicate refactorings and control flow of the method. Example: 'label:\n while (true) {\n // code\n }' Inspection ID: LabeledStatement", + "markdown": "Reports labeled statements that can complicate refactorings and control flow of the method.\n\nExample:\n\n\n label:\n while (true) {\n // code\n }\n\nInspection ID: LabeledStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LabeledStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IndexOfReplaceableByContains", + "shortDescription": { + "text": "'String.indexOf()' expression can be replaced with 'contains()'" + }, + "fullDescription": { + "text": "Reports comparisons with 'String.indexOf()' calls that can be replaced with a call to the 'String.contains()' method. Example: 'boolean b = \"abcd\".indexOf('e') >= 0;' After the quick-fix is applied: 'boolean b = \"abcd\".contains('e');' This inspection only reports if the language level of the project or module is 5 or higher. Inspection ID: IndexOfReplaceableByContains", + "markdown": "Reports comparisons with `String.indexOf()` calls that can be replaced with a call to the `String.contains()` method.\n\n**Example:**\n\n\n boolean b = \"abcd\".indexOf('e') >= 0;\n\nAfter the quick-fix is applied:\n\n\n boolean b = \"abcd\".contains('e');\n\nThis inspection only reports if the language level of the project or module is 5 or higher.\n\nInspection ID: IndexOfReplaceableByContains" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IndexOfReplaceableByContains", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringConcatenationArgumentToLogCall", + "shortDescription": { + "text": "Non-constant string concatenation as argument to logging call" + }, + "fullDescription": { + "text": "Reports non-constant string concatenations that are used as arguments to SLF4J and Log4j 2 logging methods. Non-constant concatenations are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled. Example: 'public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld(\" + i + \", \" + s + \", \" + b + \")\");\n // todo\n }\n }' After the quick-fix is applied: 'public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld({}, {}, {})\", i, s, b);\n // todo\n }\n }' Configure the inspection: Use the Warn on list to ignore certain higher logging levels. Higher logging levels may be enabled even in production, and the arguments will always be evaluated. Inspection ID: StringConcatenationArgumentToLogCall", + "markdown": "Reports non-constant string concatenations that are used as arguments to **SLF4J** and **Log4j 2** logging methods. Non-constant concatenations are evaluated at runtime even when the logging message is not logged; this can negatively impact performance. It is recommended to use a parameterized log message instead, which will not be evaluated when logging is disabled.\n\n**Example:**\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld(\" + i + \", \" + s + \", \" + b + \")\");\n // todo\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Vital {\n private static final Logger LOG = LoggerFactory.getLogger(Vital.class);\n\n public void saveTheWorld(int i, String s, boolean b) {\n LOG.info(\"saveTheWorld({}, {}, {})\", i, s, b);\n // todo\n }\n }\n\n\nConfigure the inspection:\n\n* Use the **Warn on** list to ignore certain higher logging levels. Higher logging levels may be enabled even in production, and the arguments will always be evaluated.\n\nInspection ID: StringConcatenationArgumentToLogCall" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "StringConcatenationArgumentToLogCall", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Logging", + "index": 98, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousNameCombination", + "shortDescription": { + "text": "Suspicious variable/parameter name combination" + }, + "fullDescription": { + "text": "Reports assignments and function calls in which the name of the target variable or the function parameter does not match the name of the value assigned to it. Example 1: 'int x = 0;\n int y = x; // x is used as a y-coordinate' Example 2: 'int x = 0, y = 0;\n // x is used as a y-coordinate and y as an x-coordinate\n Rectangle rc = new Rectangle(y, x, 20, 20);' Configure the inspection: Use the Group of names area to specify the names which should not be used together: an error is reported if the parameter name or assignment target name contains words from one group and the name of the assigned or passed variable contains words from a different group. Use the Ignore methods area to specify the methods that should not be checked but have a potentially suspicious name. For example, the 'Integer.compare()' parameters are named 'x' and 'y' but are unrelated to coordinates. Inspection ID: SuspiciousNameCombination", + "markdown": "Reports assignments and function calls in which the name of the target variable or the function parameter does not match the name of the value assigned to it.\n\nExample 1:\n\n\n int x = 0;\n int y = x; // x is used as a y-coordinate\n \nExample 2:\n\n\n int x = 0, y = 0;\n // x is used as a y-coordinate and y as an x-coordinate\n Rectangle rc = new Rectangle(y, x, 20, 20);\n\nConfigure the inspection:\n\nUse the **Group of names** area to specify the names which should not be used together: an error is reported\nif the parameter name or assignment target name contains words from one group and the name of the assigned or passed\nvariable contains words from a different group.\n\nUse the **Ignore methods** area to specify the methods that should not be checked but have a potentially suspicious name.\nFor example, the `Integer.compare()` parameters are named `x` and `y` but are unrelated to coordinates.\n\nInspection ID: SuspiciousNameCombination" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousNameCombination", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ImplicitDefaultCharsetUsage", + "shortDescription": { + "text": "Implicit platform default charset" + }, + "fullDescription": { + "text": "Reports method and constructor calls that implicitly use the platform default charset. Such calls can produce different results on systems that use a different default charset and may result in unexpected behaviour. Example: 'void foo(byte[] bytes) {\n String s = new String(bytes);\n}'\n You can use a quick-fix that specifies the explicit UTF-8 charset if the corresponding overloaded method is available. After the quick-fix is applied: 'void foo(byte[] bytes) {\n String s = new String(bytes, StandardCharsets.UTF_8);\n}'\n Inspection ID: ImplicitDefaultCharsetUsage", + "markdown": "Reports method and constructor calls that implicitly use the platform default charset. Such calls can produce different results on systems that use a different default charset and may result in unexpected behaviour.\n\n**Example:**\n\n void foo(byte[] bytes) {\n String s = new String(bytes);\n }\n\nYou can use a quick-fix that specifies the explicit UTF-8 charset if the corresponding overloaded method is available.\nAfter the quick-fix is applied:\n\n void foo(byte[] bytes) {\n String s = new String(bytes, StandardCharsets.UTF_8);\n }\n\nInspection ID: ImplicitDefaultCharsetUsage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ImplicitDefaultCharsetUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DesignForExtension", + "shortDescription": { + "text": "Design for extension" + }, + "fullDescription": { + "text": "Reports methods which are not 'static', 'private', 'final' or 'abstract', and whose bodies are not empty. Coding in a style that avoids such methods protects the contracts of classes from being broken by their subclasses. The benefit of this style is that subclasses cannot corrupt the state of the superclass by forgetting to call the super method. The cost is that subclasses are limited in their flexibility, in particular they cannot prevent execution of code in the superclass. Use the quick-fix to add the missing modifiers. Example: 'class Foo {\n public boolean equals(Object o) { return true; }\n }' After the quick-fix is applied: 'class Foo {\n public final boolean equals(Object o) { return true; }\n }' This inspection is intended for code that is going to be used in secure environments, and is probably not appropriate for less restrictive environments. Inspection ID: DesignForExtension", + "markdown": "Reports methods which are not `static`, `private`, `final` or `abstract`, and whose bodies are not empty.\n\n\nCoding in a style that avoids such methods protects the contracts of classes from being broken by their subclasses. The\nbenefit of this style is that subclasses cannot corrupt the state of the superclass by forgetting to call the super method. The cost is\nthat\nsubclasses are limited in their flexibility, in particular they cannot prevent execution of code in the superclass. Use the quick-fix to\nadd\nthe missing modifiers.\n\n**Example:**\n\n\n class Foo {\n public boolean equals(Object o) { return true; }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n public final boolean equals(Object o) { return true; }\n }\n\nThis inspection is intended for code that is going to be used in secure environments, and is probably not appropriate for less restrictive environments.\n\nInspection ID: DesignForExtension" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DesignForExtension", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyStreamApiCallChains", + "shortDescription": { + "text": "Stream API call chain can be simplified" + }, + "fullDescription": { + "text": "Reports stream API call chains that can be simplified. Simplification will often avoid some temporary object creation during collection traversal. The inspection replaces the following call chains: 'collection.stream().forEach()' → 'collection.forEach()' 'collection.stream().collect(toList/toSet/toCollection())' → 'new CollectionType<>(collection)' 'collection.stream().toArray()' → 'collection.toArray()' 'Arrays.asList().stream()' → 'Arrays.stream()' or 'Stream.of()' 'IntStream.range(0, array.length).mapToObj(idx -> array[idx])' → 'Arrays.stream(array)' 'IntStream.range(0, list.size()).mapToObj(idx -> list.get(idx))' → 'list.stream()' 'Collections.singleton().stream()' → 'Stream.of()' 'Collections.emptyList().stream()' → 'Stream.empty()' 'stream.filter().findFirst().isPresent()' → 'stream.anyMatch()' 'stream.collect(counting())' → 'stream.count()' 'stream.collect(maxBy())' → 'stream.max()' 'stream.collect(mapping())' → 'stream.map().collect()' 'stream.collect(reducing())' → 'stream.reduce()' 'stream.collect(summingInt())' → 'stream.mapToInt().sum()' 'stream.mapToObj(x -> x)' → 'stream.boxed()' 'stream.map(x -> {...; return x;})' → 'stream.peek(x -> ...)' '!stream.anyMatch()' → 'stream.noneMatch()' '!stream.anyMatch(x -> !(...))' → 'stream.allMatch()' 'stream.map().anyMatch(Boolean::booleanValue)' → 'stream.anyMatch()' 'IntStream.range(expr1, expr2).mapToObj(x -> array[x])' → 'Arrays.stream(array, expr1, expr2)' 'Collection.nCopies(count, ...)' → 'Stream.generate().limit(count)' 'stream.sorted(comparator).findFirst()' → 'Stream.min(comparator)' 'optional.orElseGet(() -> { throw new ...; })' → 'optional.orElseThrow()' Note that the replacement semantics may have minor differences in some cases. For example, 'Collections.synchronizedList(...).stream().forEach()' is not synchronized while 'Collections.synchronizedList(...).forEach()' is synchronized. Also, 'collect(Collectors.maxBy())' returns an empty 'Optional' if the resulting element is 'null' while 'Stream.max()' throws 'NullPointerException' in this case. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: SimplifyStreamApiCallChains", + "markdown": "Reports stream API call chains that can be simplified. Simplification will often avoid some temporary object creation during collection traversal.\n\n\nThe inspection replaces the following call chains:\n\n* `collection.stream().forEach()` → `collection.forEach()`\n* `collection.stream().collect(toList/toSet/toCollection())` → `new CollectionType<>(collection)`\n* `collection.stream().toArray()` → `collection.toArray()`\n* `Arrays.asList().stream()` → `Arrays.stream()` or `Stream.of()`\n* `IntStream.range(0, array.length).mapToObj(idx -> array[idx])` → `Arrays.stream(array)`\n* `IntStream.range(0, list.size()).mapToObj(idx -> list.get(idx))` → `list.stream()`\n* `Collections.singleton().stream()` → `Stream.of()`\n* `Collections.emptyList().stream()` → `Stream.empty()`\n* `stream.filter().findFirst().isPresent()` → `stream.anyMatch()`\n* `stream.collect(counting())` → `stream.count()`\n* `stream.collect(maxBy())` → `stream.max()`\n* `stream.collect(mapping())` → `stream.map().collect()`\n* `stream.collect(reducing())` → `stream.reduce()`\n* `stream.collect(summingInt())` → `stream.mapToInt().sum()`\n* `stream.mapToObj(x -> x)` → `stream.boxed()`\n* `stream.map(x -> {...; return x;})` → `stream.peek(x -> ...)`\n* `!stream.anyMatch()` → `stream.noneMatch()`\n* `!stream.anyMatch(x -> !(...))` → `stream.allMatch()`\n* `stream.map().anyMatch(Boolean::booleanValue)` → `stream.anyMatch()`\n* `IntStream.range(expr1, expr2).mapToObj(x -> array[x])` → `Arrays.stream(array, expr1, expr2)`\n* `Collection.nCopies(count, ...)` → `Stream.generate().limit(count)`\n* `stream.sorted(comparator).findFirst()` → `Stream.min(comparator)`\n* `optional.orElseGet(() -> { throw new ...; })` → `optional.orElseThrow()`\n\n\nNote that the replacement semantics may have minor differences in some cases. For example,\n`Collections.synchronizedList(...).stream().forEach()` is not synchronized while\n`Collections.synchronizedList(...).forEach()` is synchronized.\nAlso, `collect(Collectors.maxBy())` returns an empty `Optional` if the resulting element is\n`null` while `Stream.max()` throws `NullPointerException` in this case.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: SimplifyStreamApiCallChains" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SimplifyStreamApiCallChains", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OptionalContainsCollection", + "shortDescription": { + "text": "'Optional' contains array or collection" + }, + "fullDescription": { + "text": "Reports 'java.util.Optional' or 'com.google.common.base.Optional' types with an array or collection type parameter. In such cases, it is more clear to just use an empty array or collection to indicate the absence of result. Example: 'Optional> foo() {\n return Optional.empty();\n }' This code could look like: 'List foo() {\n return List.of();\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalContainsCollection", + "markdown": "Reports `java.util.Optional` or `com.google.common.base.Optional` types with an array or collection type parameter.\n\nIn such cases, it is more clear to just use an empty array or collection to indicate the absence of result.\n\n**Example:**\n\n\n Optional> foo() {\n return Optional.empty();\n }\n\nThis code could look like:\n\n\n List foo() {\n return List.of();\n }\n \nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalContainsCollection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OptionalContainsCollection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnknownGuard", + "shortDescription": { + "text": "Unknown '@GuardedBy' field" + }, + "fullDescription": { + "text": "Reports '@GuardedBy' annotations in which the specified guarding field is unknown. Example: 'private Object state;\n\n @GuardedBy(\"lock\") //unknown guard reference\n public void bar() {\n state = new Object();\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy' Inspection ID: UnknownGuard", + "markdown": "Reports `@GuardedBy` annotations in which the specified guarding field is unknown.\n\nExample:\n\n\n private Object state;\n\n @GuardedBy(\"lock\") //unknown guard reference\n public void bar() {\n state = new Object();\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`\n\nInspection ID: UnknownGuard" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnknownGuard", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Concurrency annotation issues", + "index": 60, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifiableAssertion", + "shortDescription": { + "text": "Simplifiable assertion" + }, + "fullDescription": { + "text": "Reports any 'assert' calls that can be replaced with simpler and equivalent calls. Example → Replacement 'assertEquals(true, x());' 'assertTrue(x());' 'assertTrue(y() != null);' 'assertNotNull(y());' 'assertTrue(z == z());' 'assertSame(z, z());' 'assertTrue(a.equals(a()));' 'assertEquals(a, a());' 'assertTrue(false);' 'fail();' Inspection ID: SimplifiableAssertion", + "markdown": "Reports any `assert` calls that can be replaced with simpler and equivalent calls.\n\n| Example | → | Replacement |\n|----------------------------------|---|-------------------------|\n| `assertEquals(`**true**`, x());` | | `assertTrue(x());` |\n| `assertTrue(y() != null);` | | `assertNotNull(y());` |\n| `assertTrue(z == z());` | | `assertSame(z, z());` |\n| `assertTrue(a.equals(a()));` | | `assertEquals(a, a());` |\n| `assertTrue(`**false**`);` | | `fail();` |\n\nInspection ID: SimplifiableAssertion" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SimplifiableAssertion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Test frameworks", + "index": 102, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InterfaceMethodClashesWithObject", + "shortDescription": { + "text": "Interface method clashes with method in 'Object'" + }, + "fullDescription": { + "text": "Reports interface methods that clash with the protected methods 'clone()' and 'finalize()' from the 'java.lang.Object' class. In an interface, it is possible to declare these methods with a return type that is incompatible with the 'java.lang.Object' methods. A class that implements such an interface will not be compilable. When the interface is functional, it remains possible to create a lambda from it, but this is not recommended. Example: '// Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }' Inspection ID: InterfaceMethodClashesWithObject", + "markdown": "Reports interface methods that clash with the **protected** methods `clone()` and `finalize()` from the `java.lang.Object` class.\n\nIn an interface, it is possible to declare these methods with a return type that is incompatible with the `java.lang.Object` methods.\nA class that implements such an interface will not be compilable.\nWhen the interface is functional, it remains possible to create a lambda from it, but this is not recommended.\n\nExample:\n\n\n // Warning: this interface cannot be implemented\n // by any class, only by a lambda or method reference\n interface MyInterface {\n double clone();\n }\n\nInspection ID: InterfaceMethodClashesWithObject" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InterfaceMethodClashesWithObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoadLibraryWithNonConstantString", + "shortDescription": { + "text": "Call to 'System.loadLibrary()' with non-constant string" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.System.loadLibrary()', 'java.lang.System.load()', 'java.lang.Runtime.loadLibrary()' and 'java.lang.Runtime.load()' which take a dynamically-constructed string as the name of the library. Constructed library name strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }' Use the inspection settings to consider any 'static final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'private static final String LIBRARY = getUserInput();' Inspection ID: LoadLibraryWithNonConstantString", + "markdown": "Reports calls to `java.lang.System.loadLibrary()`, `java.lang.System.load()`, `java.lang.Runtime.loadLibrary()` and `java.lang.Runtime.load()` which take a dynamically-constructed string as the name of the library.\n\n\nConstructed library name strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n void test(int i) {\n System.loadLibrary(\"foo\" + i);\n }\n\n\nUse the inspection settings to consider any `static final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n private static final String LIBRARY = getUserInput();\n\nInspection ID: LoadLibraryWithNonConstantString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LoadLibraryWithNonConstantString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticMethodOnlyUsedInOneClass", + "shortDescription": { + "text": "Static member only used from one other class" + }, + "fullDescription": { + "text": "Reports 'static' methods and fields that are only used from a class other than the containing class. Such members could be moved into the using class. Factory methods and members accessed from an anonymous class inside the member's class are ignored by this inspection. Convenience overloads, which call a method with the same name in the same class but have fewer parameters, are also ignored. Use the first checkbox to suppress this inspection when the static member is only used from a test class. Use the second checkbox below to ignore member usages from inside anonymous, local, or non-static inner classes. Use the third checkbox below to not warn on members that cannot be moved without problems, for example, because a method with an identical signature is already present in the target class, or because a field or a method used inside the method will not be accessible when this method is moved. Use the fourth checkbox to ignore members located in utility classes. Inspection ID: StaticMethodOnlyUsedInOneClass", + "markdown": "Reports `static` methods and fields that are only used from a class other than the containing class. Such members could be moved into the using class. Factory methods and members accessed from an anonymous class inside the member's class are ignored by this inspection. Convenience overloads, which call a method with the same name in the same class but have fewer parameters, are also ignored.\n\n\nUse the first checkbox to suppress this inspection when the static member is only used from a test class.\n\n\nUse the second checkbox below to ignore member usages from inside anonymous, local, or non-static inner classes.\n\n\nUse the third checkbox below to not warn on members that cannot be moved without problems,\nfor example, because a method with an identical signature is already present in the target class,\nor because a field or a method used inside the method will not be accessible when this method is moved.\n\n\nUse the fourth checkbox to ignore members located in utility classes.\n\nInspection ID: StaticMethodOnlyUsedInOneClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticMethodOnlyUsedInOneClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AbstractClassExtendsConcreteClass", + "shortDescription": { + "text": "Abstract class extends concrete class" + }, + "fullDescription": { + "text": "Reports 'abstract' classes that extend concrete classes. Inspection ID: AbstractClassExtendsConcreteClass", + "markdown": "Reports `abstract` classes that extend concrete classes.\n\nInspection ID: AbstractClassExtendsConcreteClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AbstractClassExtendsConcreteClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantEscapeInRegexReplacement", + "shortDescription": { + "text": "Redundant escape in regex replacement string" + }, + "fullDescription": { + "text": "Reports redundant escapes in the replacement string of regex methods. It is allowed to escape any character in a regex replacement string, but only for the '$' and '\\' characters is escaping necessary. Example: 'string.replaceAll(\"a\", \"\\\\b\");' After the quick-fix is applied: 'string.replaceAll(\"a\", \"b\");' New in 2022.3 Inspection ID: RedundantEscapeInRegexReplacement", + "markdown": "Reports redundant escapes in the replacement string of regex methods. It is allowed to escape any character in a regex replacement string, but only for the `$` and `\\` characters is escaping necessary.\n\n**Example:**\n\n\n string.replaceAll(\"a\", \"\\\\b\");\n\nAfter the quick-fix is applied:\n\n\n string.replaceAll(\"a\", \"b\");\n\nNew in 2022.3\n\nInspection ID: RedundantEscapeInRegexReplacement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantEscapeInRegexReplacement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java8CollectionRemoveIf", + "shortDescription": { + "text": "Loop can be replaced with 'Collection.removeIf()'" + }, + "fullDescription": { + "text": "Reports loops which can be collapsed into a single 'Collection.removeIf()' call. Example: 'for (Iterator it = collection.iterator(); it.hasNext(); ) {\n String aValue = it.next();\n if(shouldBeRemoved(aValue)) {\n it.remove();\n }\n }' After the quick-fix is applied: 'collection.removeIf(aValue -> shouldBeRemoved(aValue));' This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: Java8CollectionRemoveIf", + "markdown": "Reports loops which can be collapsed into a single `Collection.removeIf()` call.\n\nExample:\n\n\n for (Iterator it = collection.iterator(); it.hasNext(); ) {\n String aValue = it.next();\n if(shouldBeRemoved(aValue)) {\n it.remove();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n collection.removeIf(aValue -> shouldBeRemoved(aValue));\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: Java8CollectionRemoveIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Java8CollectionRemoveIf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LogStatementNotGuardedByLogCondition", + "shortDescription": { + "text": "Logging call not guarded by log condition" + }, + "fullDescription": { + "text": "Reports logging calls that are not surrounded by a guard condition. The evaluation of a call's arguments can be expensive. Surrounding a logging call with a guard clause prevents that cost when logging is disabled for the level used by the logging statement. This is especially useful for the least serious level (trace, debug, finest) of logging calls, because those are most often disabled in a production environment. Example: 'public class TestObject {\n void test(Object object) {\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }' After a quick-fix is applied: 'public class TestObject {\n void test(Object object) {\n if(LOG.isDebugEnabled()){\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }\n }' This inspection supports Log4j2 and the SLF4J logging frameworks (except builders). Inspection ID: LogStatementNotGuardedByLogCondition New in 2024.2", + "markdown": "Reports logging calls that are not surrounded by a guard condition. The evaluation of a call's arguments can be expensive. Surrounding a logging call with a guard clause prevents that cost when logging is disabled for the level used by the logging statement. This is especially useful for the least serious level (trace, debug, finest) of logging calls, because those are most often disabled in a production environment.\n\n**Example:**\n\n\n public class TestObject {\n void test(Object object) {\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }\n\nAfter a quick-fix is applied:\n\n\n public class TestObject {\n void test(Object object) {\n if(LOG.isDebugEnabled()){\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }\n }\n\nThis inspection supports *Log4j2* and the *SLF4J* logging frameworks (except builders).\n\nInspection ID: LogStatementNotGuardedByLogCondition\n\nNew in 2024.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LogStatementNotGuardedByLogCondition", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Logging", + "index": 46, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SynchronizedOnLiteralObject", + "shortDescription": { + "text": "Synchronization on an object initialized with a literal" + }, + "fullDescription": { + "text": "Reports 'synchronized' blocks that lock on an object initialized with a literal. String literals are interned and 'Character', 'Boolean' and 'Number' literals can be allocated from a cache. Because of this, it is possible that some other part of the system, which uses an object initialized with the same literal, is actually holding a reference to the exact same object. This can create unexpected dead-lock situations, if the lock object was thought to be private. Example: 'class Main {\n final String mutex = \"Mutex\";\n void method() {\n synchronized (mutex) {\n }\n }\n }' Use the Warn on all possible literals option to report any synchronization on 'String', 'Character', 'Boolean' and 'Number' objects. Inspection ID: SynchronizedOnLiteralObject", + "markdown": "Reports `synchronized` blocks that lock on an object initialized with a literal.\n\n\nString literals are interned and `Character`, `Boolean` and `Number` literals can be allocated from a cache.\nBecause of this, it is possible that some other part of the system, which uses an object initialized with the same literal, is actually\nholding a reference to the exact same object. This can create unexpected dead-lock situations, if the lock object was thought to be private.\n\n**Example:**\n\n\n class Main {\n final String mutex = \"Mutex\";\n void method() {\n synchronized (mutex) {\n }\n }\n }\n\n\nUse the **Warn on all possible literals** option to report any synchronization on\n`String`, `Character`, `Boolean` and `Number` objects.\n\nInspection ID: SynchronizedOnLiteralObject" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SynchronizedOnLiteralObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java9ReflectionClassVisibility", + "shortDescription": { + "text": "Reflective access across modules issues" + }, + "fullDescription": { + "text": "Reports 'Class.forName()' and 'ClassLoader.loadClass()' calls which try to access classes that aren't visible in the current scope due to Java 9 module accessibility rules. This inspection depends on the Java feature 'Modules', which is available since Java 9. Inspection ID: Java9ReflectionClassVisibility", + "markdown": "Reports `Class.forName()` and `ClassLoader.loadClass()` calls which try to access classes that aren't visible in the current scope due to Java 9 module accessibility rules.\n\nThis inspection depends on the Java feature 'Modules', which is available since Java 9.\n\nInspection ID: Java9ReflectionClassVisibility" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Java9ReflectionClassVisibility", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Reflective access", + "index": 104, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CharsetObjectCanBeUsed", + "shortDescription": { + "text": "Standard 'Charset' object can be used" + }, + "fullDescription": { + "text": "Reports methods and constructors in which constant charset 'String' literal (for example, '\"UTF-8\"') can be replaced with the predefined 'StandardCharsets.UTF_8' code. The code after the fix may work faster, because the charset lookup becomes unnecessary. Also, catching 'UnsupportedEncodingException' may become unnecessary as well. In this case, the catch block will be removed automatically. Example: 'try {\n byte[] bytes = \"str\".getBytes(\"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n }' After quick-fix is applied: 'byte[] bytes = \"str\".getBytes(StandardCharsets.UTF_8);' The inspection is available in Java 7 and later. Inspection ID: CharsetObjectCanBeUsed New in 2018.2", + "markdown": "Reports methods and constructors in which constant charset `String` literal (for example, `\"UTF-8\"`) can be replaced with the predefined `StandardCharsets.UTF_8` code.\n\nThe code after the fix may work faster, because the charset lookup becomes unnecessary.\nAlso, catching `UnsupportedEncodingException` may become unnecessary as well. In this case,\nthe catch block will be removed automatically.\n\nExample:\n\n\n try {\n byte[] bytes = \"str\".getBytes(\"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n }\n\nAfter quick-fix is applied:\n\n\n byte[] bytes = \"str\".getBytes(StandardCharsets.UTF_8);\n\nThe inspection is available in Java 7 and later.\n\nInspection ID: CharsetObjectCanBeUsed\n\nNew in 2018.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CharsetObjectCanBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SafeVarargsDetector", + "shortDescription": { + "text": "Possible heap pollution from parameterized vararg type" + }, + "fullDescription": { + "text": "Reports methods with variable arity, which can be annotated as '@SafeVarargs'. The '@SafeVarargs' annotation suppresses unchecked warnings about parameterized array creation at call sites. Example: 'public class Foo {\n private List list = new ArrayList<>();\n\n public final void safeVarargs(T... elements) {\n Collections.addAll(list, elements);\n }\n }' After the quick-fix is applied: 'public class Foo {\n private List list = new ArrayList<>();\n\n @SafeVarargs\n public final void safeVarargs(T... elements) {\n Collections.addAll(list, elements);\n }\n }' This annotation is not supported under Java 1.6 or earlier JVMs. Inspection ID: SafeVarargsDetector", + "markdown": "Reports methods with variable arity, which can be annotated as `@SafeVarargs`. The `@SafeVarargs` annotation suppresses unchecked warnings about parameterized array creation at call sites.\n\n**Example:**\n\n\n public class Foo {\n private List list = new ArrayList<>();\n\n public final void safeVarargs(T... elements) {\n Collections.addAll(list, elements);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Foo {\n private List list = new ArrayList<>();\n\n @SafeVarargs\n public final void safeVarargs(T... elements) {\n Collections.addAll(list, elements);\n }\n }\n\n\nThis annotation is not supported under Java 1.6 or earlier JVMs.\n\nInspection ID: SafeVarargsDetector" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "unchecked", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 7", + "index": 118, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComparatorMethodParameterNotUsed", + "shortDescription": { + "text": "Suspicious 'Comparator.compare()' implementation" + }, + "fullDescription": { + "text": "Reports problems in 'Comparator.compare()' and 'Comparable.compareTo()' implementations. The following cases are reported: A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly. It's evident that the method does not return '0' for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data. The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order. The comparison method returns 'Integer.MIN_VALUE'. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of 'Integer.MIN_VALUE' is 'Integer.MIN_VALUE'. Example: 'Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;' Inspection ID: ComparatorMethodParameterNotUsed", + "markdown": "Reports problems in `Comparator.compare()` and `Comparable.compareTo()` implementations.\n\nThe following cases are reported:\n\n* A parameter is not used. Most likely this is a typo and the other parameter is compared with itself, or the method is not implemented correctly.\n* It's evident that the method does not return `0` for the same elements. Such a comparison method violates the contract and can produce unpredictable results when equal elements are encountered. In particular, sorting may fail with an exception on some data.\n* The comparison method never returns positive or negative value. To fulfill the contract, if the comparison method returns positive values, it should also return negative ones if arguments are supplied in reversed order.\n* The comparison method returns `Integer.MIN_VALUE`. While allowed by the contract, it may be error-prone, as some call sites may incorrectly try to invert the return value of the comparison method using the unary minus operator. The negated value of `Integer.MIN_VALUE` is `Integer.MIN_VALUE`.\n\n**Example:**\n\n\n Comparator lambda =\n (a, b) -> a.length() > b.length()\n ? 0\n : Math.random() > 0.5 ? -1 : 1;\n\nInspection ID: ComparatorMethodParameterNotUsed" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ComparatorMethodParameterNotUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfSunClasses", + "shortDescription": { + "text": "Use of 'sun.*' classes" + }, + "fullDescription": { + "text": "Reports uses of classes from the 'sun.*' hierarchy. Such classes are non-portable between different JVMs. Inspection ID: UseOfSunClasses", + "markdown": "Reports uses of classes from the `sun.*` hierarchy. Such classes are non-portable between different JVMs.\n\nInspection ID: UseOfSunClasses" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfSunClasses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantCast", + "shortDescription": { + "text": "Redundant type cast" + }, + "fullDescription": { + "text": "Reports unnecessary cast expressions. Example: 'static Object toObject(String s) {\n return (Object) s;\n }' After the quick-fix is applied: 'static Object toObject(String s) {\n return s;\n }' Use the checkbox below to ignore clarifying casts, for example casts in collection calls where 'Object' is expected: 'static void removeFromList(List l, Object o) {\n l.remove((String)o);\n }' Inspection ID: RedundantCast", + "markdown": "Reports unnecessary cast expressions.\n\n**Example:**\n\n\n static Object toObject(String s) {\n return (Object) s;\n }\n\nAfter the quick-fix is applied:\n\n\n static Object toObject(String s) {\n return s;\n }\n\n\nUse the checkbox below to ignore clarifying casts, for example casts in collection calls where `Object` is expected:\n\n\n static void removeFromList(List l, Object o) {\n l.remove((String)o);\n } \n\nInspection ID: RedundantCast" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantCast", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnonymousInnerClass", + "shortDescription": { + "text": "Anonymous class can be replaced with inner class" + }, + "fullDescription": { + "text": "Reports anonymous classes. Occasionally replacing anonymous classes with inner classes can lead to more readable and maintainable code. Some code standards discourage anonymous classes. Example: 'class Example {\n public static void main(String[] args) {\n new Thread() {\n public void run() {\n work()\n }\n\n private void work() {}\n }.start();\n }\n }' After the quick-fix is applied: 'class Example {\n public static void main(String[] args) {\n new MyThread().start();\n }\n\n private static class MyThread extends Thread {\n public void run() {\n work();\n }\n\n private void work() {}\n }\n }' Inspection ID: AnonymousInnerClass", + "markdown": "Reports anonymous classes.\n\nOccasionally replacing anonymous classes with inner classes can lead to more readable and maintainable code.\nSome code standards discourage anonymous classes.\n\n**Example:**\n\n\n class Example {\n public static void main(String[] args) {\n new Thread() {\n public void run() {\n work()\n }\n\n private void work() {}\n }.start();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n public static void main(String[] args) {\n new MyThread().start();\n }\n\n private static class MyThread extends Thread {\n public void run() {\n work();\n }\n\n private void work() {}\n }\n }\n\nInspection ID: AnonymousInnerClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "AnonymousInnerClass", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifyCollector", + "shortDescription": { + "text": "Simplifiable collector" + }, + "fullDescription": { + "text": "Reports collectors that can be simplified. In particular, some cascaded 'groupingBy()' collectors can be expressed by using a simpler 'toMap()' collector, which is also likely to be more performant. Example: 'Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));' After the quick-fix is applied: 'Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: SimplifyCollector New in 2017.1", + "markdown": "Reports collectors that can be simplified.\n\nIn particular, some cascaded `groupingBy()` collectors can be expressed by using a\nsimpler `toMap()` collector, which is also likely to be more performant.\n\nExample:\n\n\n Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));\n\nAfter the quick-fix is applied:\n\n\n Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: SimplifyCollector\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SimplifyCollector", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Annotation", + "shortDescription": { + "text": "Annotation" + }, + "fullDescription": { + "text": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM. Inspection ID: Annotation", + "markdown": "Reports annotations. Annotations are not supported in Java 1.4 and earlier JVM.\n\n\nInspection ID: Annotation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Annotation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level issues", + "index": 62, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MultipleTopLevelClassesInFile", + "shortDescription": { + "text": "Multiple top level classes in single file" + }, + "fullDescription": { + "text": "Reports multiple top-level classes in a single Java file. Putting multiple top-level classes in one file may be confusing and degrade the usefulness of various software tools. Inspection ID: MultipleTopLevelClassesInFile", + "markdown": "Reports multiple top-level classes in a single Java file.\n\nPutting multiple\ntop-level classes in one file may be confusing and degrade the usefulness of various\nsoftware tools.\n\nInspection ID: MultipleTopLevelClassesInFile" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MultipleTopLevelClassesInFile", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringTokenizer", + "shortDescription": { + "text": "Use of 'StringTokenizer'" + }, + "fullDescription": { + "text": "Reports usages of the 'StringTokenizer' class. Excessive use of 'StringTokenizer' is incorrect in an internationalized environment. Inspection ID: StringTokenizer", + "markdown": "Reports usages of the `StringTokenizer` class. Excessive use of `StringTokenizer` is incorrect in an internationalized environment.\n\nInspection ID: StringTokenizer" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfStringTokenizer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryUnicodeEscape", + "shortDescription": { + "text": "Unnecessary Unicode escape sequence" + }, + "fullDescription": { + "text": "Reports unnecessary Unicode escape sequences. A Unicode escape sequence is unnecessary when the file encoding can handle the character without escaping it. This inspection does not report Unicode control characters, except for line feed and horizonal tab. Example: 'String s = \"\\u0078\";' After the quick-fix is applied: 'String s = \"x\";' Inspection ID: UnnecessaryUnicodeEscape", + "markdown": "Reports unnecessary Unicode escape sequences. A Unicode escape sequence is unnecessary when the file encoding can handle the character without escaping it. This inspection does not report Unicode control characters, except for line feed and horizonal tab.\n\n**Example:**\n\n\n String s = \"\\u0078\";\n\nAfter the quick-fix is applied:\n\n\n String s = \"x\";\n\nInspection ID: UnnecessaryUnicodeEscape" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryUnicodeEscape", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PrimitiveArrayArgumentToVariableArgMethod", + "shortDescription": { + "text": "Confusing primitive array argument to varargs method" + }, + "fullDescription": { + "text": "Reports any calls to a variable arity method where the call has one primitive-type array in the variable arity parameter position. Such a primitive-array argument may be confusing, as it will be wrapped in a single-element array argument, rather than each element being a separate argument, as may be expected. Example: 'String.format(\"%s\", new int[]{1, 2, 3});' After the quick-fix is applied: 'String.format(\"%s\", (Object) new int[]{1, 2, 3});' This inspection depends on the Java feature 'Variable arity methods', which is available since Java 5. Inspection ID: PrimitiveArrayArgumentToVariableArgMethod", + "markdown": "Reports any calls to a variable arity method where the call has one primitive-type array in the variable arity parameter position. Such a primitive-array argument may be confusing, as it will be wrapped in a single-element array argument, rather than each element being a separate argument, as may be expected.\n\n**Example:**\n\n\n String.format(\"%s\", new int[]{1, 2, 3});\n\nAfter the quick-fix is applied:\n\n\n String.format(\"%s\", (Object) new int[]{1, 2, 3});\n\nThis inspection depends on the Java feature 'Variable arity methods', which is available since Java 5.\n\nInspection ID: PrimitiveArrayArgumentToVariableArgMethod" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "PrimitiveArrayArgumentToVarargsMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IteratorNextDoesNotThrowNoSuchElementException", + "shortDescription": { + "text": "'Iterator.next()' which can't throw 'NoSuchElementException'" + }, + "fullDescription": { + "text": "Reports implementations of 'Iterator.next()' that cannot throw 'java.util.NoSuchElementException'. Such implementations violate the contract of 'java.util.Iterator', and may result in subtle bugs if the iterator is used in a non-standard way. Example: 'class Numbers implements Iterator {\n @Override\n public Integer next() { //warning\n if (hasNext()) {\n return generateNext();\n } else {\n return null; //throw NoSuchElementException instead\n }\n }\n\n ...\n }' Inspection ID: IteratorNextDoesNotThrowNoSuchElementException", + "markdown": "Reports implementations of `Iterator.next()` that cannot throw `java.util.NoSuchElementException`.\n\n\nSuch implementations violate the contract of `java.util.Iterator`,\nand may result in subtle bugs if the iterator is used in a non-standard way.\n\n**Example:**\n\n\n class Numbers implements Iterator {\n @Override\n public Integer next() { //warning\n if (hasNext()) {\n return generateNext();\n } else {\n return null; //throw NoSuchElementException instead\n }\n }\n\n ...\n }\n\nInspection ID: IteratorNextDoesNotThrowNoSuchElementException" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IteratorNextCanNotThrowNoSuchElementException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SafeVarargsHasNoEffect", + "shortDescription": { + "text": "@SafeVarargs do not suppress potentially unsafe operations" + }, + "fullDescription": { + "text": "Reports write operations inside '@SafeVarargs' methods where vararg parameter is reassigned to something else. In this case, newly assigned array is not related to the variable arity arguments at the call site and might not be safe anymore. Example: '@SafeVarargs\n public final void test(T[] tt, T... t) {\n t = tt;\n System.out.println(t[0]);\n }' This inspection depends on the Java feature 'Annotations', which is available since Java 5. Inspection ID: SafeVarargsHasNoEffect", + "markdown": "Reports write operations inside `@SafeVarargs` methods where vararg parameter is reassigned to something else. In this case, newly assigned array is not related to the variable arity arguments at the call site and might not be safe anymore.\n\n**Example:**\n\n\n @SafeVarargs\n public final void test(T[] tt, T... t) {\n t = tt;\n System.out.println(t[0]);\n }\n\nThis inspection depends on the Java feature 'Annotations', which is available since Java 5.\n\nInspection ID: SafeVarargsHasNoEffect" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SafeVarargsHasNoEffect", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncorrectMessageFormat", + "shortDescription": { + "text": "Incorrect 'MessageFormat' pattern" + }, + "fullDescription": { + "text": "Reports incorrect message format patterns or incorrect indexes of placeholders The following errors are reported: Unparsed or negative index Unclosed brace Unpaired quote. In this case, a part of a pattern may not be used Probably incorrect number of quotes Incorrect lower bound of nested choice patterns Incorrect indexes of placeholders. In this case, a placeholder may not be substituted or an argument may not be used Examples: 'MessageFormat.format(\"{wrong}\", 1); // incorrect index\n MessageFormat.format(\"{0\", 1); // Unmatched brace\n MessageFormat.format(\"'{0}\", 1); // Unpaired quote\n MessageFormat.format(\"It''''s {0}\", 1); // \"It''s\" will be printed, instead of \"It's\"\n MessageFormat.format(\"{0}\", 1, 2); // The argument with index '1' is not used in the pattern' Use the Custom MessageFormat methods table to specify method calls that should have their arguments checked as MessageFormat patterns. The table contains pairs of fully qualified class name and method name regular expression to match the containing class and name of the method calls. Class names also match subclasses. New in 2023.2 Inspection ID: IncorrectMessageFormat", + "markdown": "Reports incorrect message format patterns or incorrect indexes of placeholders\n\nThe following errors are reported:\n\n* Unparsed or negative index\n* Unclosed brace\n* Unpaired quote. In this case, a part of a pattern may not be used\n* Probably incorrect number of quotes\n* Incorrect lower bound of nested choice patterns\n* Incorrect indexes of placeholders. In this case, a placeholder may not be substituted or an argument may not be used\n\nExamples:\n\n\n MessageFormat.format(\"{wrong}\", 1); // incorrect index\n MessageFormat.format(\"{0\", 1); // Unmatched brace\n MessageFormat.format(\"'{0}\", 1); // Unpaired quote\n MessageFormat.format(\"It''''s {0}\", 1); // \"It''s\" will be printed, instead of \"It's\"\n MessageFormat.format(\"{0}\", 1, 2); // The argument with index '1' is not used in the pattern\n\n\nUse the **Custom MessageFormat methods** table\nto specify method calls that should have their arguments checked as MessageFormat patterns.\nThe table contains pairs of fully qualified class name and method name regular expression\nto match the containing class and name of the method calls.\nClass names also match subclasses.\n\nNew in 2023.2\n\nInspection ID: IncorrectMessageFormat" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IncorrectMessageFormat", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousTernaryOperatorInVarargsCall", + "shortDescription": { + "text": "Suspicious ternary operator in varargs method call" + }, + "fullDescription": { + "text": "Reports vararg method calls that use a ternary operator with mixed array and non-array branches. When compiled, both branches are wrapped in arrays. As a result, the array branch is turned into a two-dimensional array, which may indicate a problem. The quick-fix wraps the non-array branch in an array to prevent the compiler from doing the conversion. Example: 'static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : b);\n }\n static void foo(Object... obj) {\n }' After the quick-fix: 'static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : new Object[]{b});\n }\n static void foo(Object... obj) {\n }' This inspection depends on the Java feature 'Variable arity methods', which is available since Java 5. Inspection ID: SuspiciousTernaryOperatorInVarargsCall New in 2020.3", + "markdown": "Reports vararg method calls that use a ternary operator with mixed array and non-array branches.\n\n\nWhen compiled, both branches are wrapped in arrays. As a result, the array branch is turned into\na two-dimensional array, which may indicate a problem.\n\n\nThe quick-fix wraps the non-array branch in an array to prevent the compiler from doing the conversion.\n\n**Example:**\n\n\n static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : b);\n }\n static void foo(Object... obj) {\n }\n\nAfter the quick-fix:\n\n\n static void bar(boolean flag) {\n Object[] a = {1, 2};\n Object b = \"hello\";\n foo(flag ? a : new Object[]{b});\n }\n static void foo(Object... obj) {\n }\n\nThis inspection depends on the Java feature 'Variable arity methods', which is available since Java 5.\n\nInspection ID: SuspiciousTernaryOperatorInVarargsCall\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousTernaryOperatorInVarargsCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseBulkOperation", + "shortDescription": { + "text": "Bulk operation can be used instead of iteration" + }, + "fullDescription": { + "text": "Reports single operations inside loops that could be replaced with a bulk method. Not only are bulk methods shorter, but in some cases they may be more performant as well. Example: 'void test(Collection numbers) {\n List result = new ArrayList<>();\n for (Integer i : numbers) {\n result.add(i);\n }\n }' After the fix is applied: 'void test(Collection numbers) {\n List result = new ArrayList<>();\n result.addAll(numbers);\n }' The Use Arrays.asList() to wrap arrays option allows to report arrays, even if the bulk method requires a collection. In this case the quick-fix will automatically wrap the array in 'Arrays.asList()' call. Inspection ID: UseBulkOperation New in 2017.1", + "markdown": "Reports single operations inside loops that could be replaced with a bulk method.\n\n\nNot only are bulk methods shorter, but in some cases they may be more performant as well.\n\n**Example:**\n\n void test(Collection numbers) {\n List result = new ArrayList<>();\n for (Integer i : numbers) {\n result.add(i);\n }\n }\n\nAfter the fix is applied:\n\n\n void test(Collection numbers) {\n List result = new ArrayList<>();\n result.addAll(numbers);\n }\n\n\nThe **Use Arrays.asList() to wrap arrays** option allows to report arrays, even if the bulk method requires a collection.\nIn this case the quick-fix will automatically wrap the array in `Arrays.asList()` call.\n\nInspection ID: UseBulkOperation\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UseBulkOperation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AccessToNonThreadSafeStaticFieldFromInstance", + "shortDescription": { + "text": "Non-thread-safe 'static' field access" + }, + "fullDescription": { + "text": "Reports access to 'static' fields that are of a non-thread-safe type. When a 'static' field is accessed from an instance method or a non-synchronized block, multiple threads can access that field. This can lead to unspecified side effects, like exceptions and incorrect results. Example: 'class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }' You can specify which types should be considered not thread-safe. Only fields with these exact types or initialized with these exact types are reported, because there may exist thread-safe subclasses of these types. Inspection ID: AccessToNonThreadSafeStaticFieldFromInstance", + "markdown": "Reports access to `static` fields that are of a non-thread-safe type.\n\n\nWhen a `static` field is accessed from an instance method or a non-synchronized block,\nmultiple threads can access that field.\nThis can lead to unspecified side effects, like exceptions and incorrect results.\n\n**Example:**\n\n\n class Sample {\n private static final SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");\n String method() {\n return df.format(\"\");\n }\n }\n\n\nYou can specify which types should be considered not thread-safe.\nOnly fields with these exact types or initialized with these exact types are reported,\nbecause there may exist thread-safe subclasses of these types.\n\nInspection ID: AccessToNonThreadSafeStaticFieldFromInstance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AccessToNonThreadSafeStaticField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BigDecimalEquals", + "shortDescription": { + "text": "'equals()' called on 'BigDecimal'" + }, + "fullDescription": { + "text": "Reports 'equals()' calls that compare two 'java.math.BigDecimal' numbers. This is normally a mistake, as two 'java.math.BigDecimal' numbers are only equal if they are equal in both value and scale. Example: 'if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false' After the quick-fix is applied: 'if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true' Inspection ID: BigDecimalEquals", + "markdown": "Reports `equals()` calls that compare two `java.math.BigDecimal` numbers. This is normally a mistake, as two `java.math.BigDecimal` numbers are only equal if they are equal in both value and scale.\n\n**Example:**\n\n\n if (new BigDecimal(\"2.0\").equals(\n new BigDecimal(\"2.00\"))) {} // false\n\nAfter the quick-fix is applied:\n\n\n if (new BigDecimal(\"2.0\").compareTo(\n new BigDecimal(\"2.00\")) == 0) {} // true\n\nInspection ID: BigDecimalEquals" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BigDecimalEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToCatchBlockParameter", + "shortDescription": { + "text": "Assignment to 'catch' block parameter" + }, + "fullDescription": { + "text": "Reports assignments to, 'catch' block parameters. Changing a 'catch' block parameter is very confusing and should be discouraged. The quick-fix adds a declaration of a new variable. Example: 'void processFile(String fileName) throws Exception {\n try {\n doProcessFile(fileName);\n } catch(Exception ex) {\n if (ex instanceof UncheckedIOException) {\n // Warning: catch block parameter reassigned\n ex = ((UncheckedIOException) ex).getCause();\n }\n throw ex;\n }\n }' After the quick-fix is applied: 'void processFile(String fileName) throws Exception {\n try {\n doProcessFile(fileName);\n } catch(Exception ex) {\n Exception unwrapped = ex;\n if (unwrapped instanceof UncheckedIOException) {\n unwrapped = ((UncheckedIOException)\n unwrapped).getCause();\n }\n throw unwrapped;\n }\n }' Inspection ID: AssignmentToCatchBlockParameter", + "markdown": "Reports assignments to, `catch` block parameters.\n\nChanging a `catch` block parameter is very confusing and should be discouraged.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n void processFile(String fileName) throws Exception {\n try {\n doProcessFile(fileName);\n } catch(Exception ex) {\n if (ex instanceof UncheckedIOException) {\n // Warning: catch block parameter reassigned\n ex = ((UncheckedIOException) ex).getCause();\n }\n throw ex;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void processFile(String fileName) throws Exception {\n try {\n doProcessFile(fileName);\n } catch(Exception ex) {\n Exception unwrapped = ex;\n if (unwrapped instanceof UncheckedIOException) {\n unwrapped = ((UncheckedIOException)\n unwrapped).getCause();\n }\n throw unwrapped;\n }\n }\n\nInspection ID: AssignmentToCatchBlockParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToCatchBlockParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AbstractMethodOverridesAbstractMethod", + "shortDescription": { + "text": "Abstract method overrides abstract method" + }, + "fullDescription": { + "text": "Reports 'abstract' methods that override 'abstract' methods. Such methods don't make sense because any concrete child class will have to implement the abstract method anyway. Methods whose return types, exception declarations, annotations, or modifiers differ from the overridden method are not reported by this inspection. Configure the inspection: Use the Ignore methods with different Javadoc than their super methods option to ignore any abstract methods whose JavaDoc comment differs from their super method. Inspection ID: AbstractMethodOverridesAbstractMethod", + "markdown": "Reports `abstract` methods that override `abstract` methods.\n\nSuch methods don't make sense because any concrete child class will have to implement the abstract method anyway.\n\n\nMethods whose return types, exception declarations, annotations, or modifiers differ from the overridden method are not reported by this inspection.\n\n\nConfigure the inspection:\n\n* Use the **Ignore methods with different Javadoc than their super methods** option to ignore any abstract methods whose JavaDoc comment differs from their super method.\n\nInspection ID: AbstractMethodOverridesAbstractMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AbstractMethodOverridesAbstractMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerializableInnerClassHasSerialVersionUIDField", + "shortDescription": { + "text": "Serializable non-static inner class without 'serialVersionUID'" + }, + "fullDescription": { + "text": "Reports non-static inner classes that implement 'java.io.Serializable', but do not define a 'serialVersionUID' field. Without a 'serialVersionUID' field, any change to the class will make previously serialized versions unreadable. It is strongly recommended that 'Serializable' non-static inner classes have a 'serialVersionUID' field, otherwise the default serialization algorithm may result in serialized versions being incompatible between compilers due to differences in synthetic accessor methods. A quick-fix is suggested to add the missing 'serialVersionUID' field. Example: 'class Outer {\n class Inner implements Serializable {}\n }' After the quick-fix is applied: 'class Outer {\n class Inner implements Serializable {\n private static final long serialVersionUID = -7004458730436243902L;\n }\n }' Use the following options to configure the inspection: List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit 'Serializable' from a superclass but are not intended for serialization. Whether to ignore 'Serializable' anonymous classes. Inspection ID: SerializableInnerClassHasSerialVersionUIDField", + "markdown": "Reports non-static inner classes that implement `java.io.Serializable`, but do not define a `serialVersionUID` field.\n\n\nWithout a `serialVersionUID` field, any change to the class will make previously\nserialized versions unreadable. It is strongly recommended that `Serializable`\nnon-static inner classes have a `serialVersionUID` field, otherwise the default\nserialization algorithm may result in serialized versions being incompatible between\ncompilers due to differences in synthetic accessor methods.\n\n\nA quick-fix is suggested to add the missing `serialVersionUID` field.\n\n**Example:**\n\n\n class Outer {\n class Inner implements Serializable {}\n }\n\nAfter the quick-fix is applied:\n\n\n class Outer {\n class Inner implements Serializable {\n private static final long serialVersionUID = -7004458730436243902L;\n }\n }\n\nUse the following options to configure the inspection:\n\n* List classes whose inheritors should not be reported by this inspection. This is meant for classes that inherit `Serializable` from a superclass but are not intended for serialization.\n* Whether to ignore `Serializable` anonymous classes.\n\nInspection ID: SerializableInnerClassHasSerialVersionUIDField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SerializableNonStaticInnerClassWithoutSerialVersionUID", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoopStatementsThatDontLoop", + "shortDescription": { + "text": "Loop statement that does not loop" + }, + "fullDescription": { + "text": "Reports any instance of 'for', 'while', and 'do' statements whose bodies will be executed once at most. Normally, this is an indication of a bug. Use the Ignore enhanced for loops option to ignore the foreach loops. They are sometimes used to perform an action only on the first item of an iterable in a compact way. Example: 'for (String s : stringIterable) {\n doSomethingOnFirstString(s);\n break;\n }' Inspection ID: LoopStatementsThatDontLoop", + "markdown": "Reports any instance of `for`, `while`, and `do` statements whose bodies will be executed once at most. Normally, this is an indication of a bug.\n\n\nUse the **Ignore enhanced for loops** option to ignore the foreach loops.\nThey are sometimes used to perform an action only on the first item of an iterable in a compact way.\n\nExample:\n\n\n for (String s : stringIterable) {\n doSomethingOnFirstString(s);\n break;\n }\n\nInspection ID: LoopStatementsThatDontLoop" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "LoopStatementThatDoesntLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrayCreationWithoutNewKeyword", + "shortDescription": { + "text": "Array creation without 'new' expression" + }, + "fullDescription": { + "text": "Reports array initializers without 'new' array expressions and suggests adding them. Example: 'int[] a = {42}' After the quick-fix is applied: 'int[] a = new int[]{42}' Inspection ID: ArrayCreationWithoutNewKeyword", + "markdown": "Reports array initializers without `new` array expressions and suggests adding them.\n\nExample:\n\n\n int[] a = {42}\n\nAfter the quick-fix is applied:\n\n\n int[] a = new int[]{42}\n\nInspection ID: ArrayCreationWithoutNewKeyword" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ArrayCreationWithoutNewKeyword", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConfusingOctalEscape", + "shortDescription": { + "text": "Confusing octal escape sequence" + }, + "fullDescription": { + "text": "Reports string literals containing an octal escape sequence immediately followed by a digit. Such strings may be confusing, and are often the result of errors in escape code creation. Example: 'System.out.println(\"\\1234\"); // Octal escape sequence '\\123' immediately followed by a digit' Inspection ID: ConfusingOctalEscape", + "markdown": "Reports string literals containing an octal escape sequence immediately followed by a digit.\n\nSuch strings may be confusing, and are often the result of errors in escape code creation.\n\n**Example:**\n\n\n System.out.println(\"\\1234\"); // Octal escape sequence '\\123' immediately followed by a digit\n\nInspection ID: ConfusingOctalEscape" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConfusingOctalEscapeSequence", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParameterNameDiffersFromOverriddenParameter", + "shortDescription": { + "text": "Parameter name differs from parameter in overridden or overloaded method" + }, + "fullDescription": { + "text": "Reports parameters whose names differ from the corresponding parameters of the methods they override or overload. While legal in Java, such inconsistent names may be confusing and decrease the documentation benefits of good naming practices. Example: 'class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String name) { super(name); }\n }' After the quick-fix is applied: 'class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String fullName) { super(fullName); }\n }' Use the options to indicate whether to ignore overridden parameter names that are only a single character long or come from a library method. Both can be useful if you do not wish to be bound by dubious naming conventions used in libraries. Inspection ID: ParameterNameDiffersFromOverriddenParameter", + "markdown": "Reports parameters whose names differ from the corresponding parameters of the methods they override or overload. While legal in Java, such inconsistent names may be confusing and decrease the documentation benefits of good naming practices.\n\n**Example:**\n\n\n class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String name) { super(name); }\n }\n\nAfter the quick-fix is applied:\n\n\n class Person {\n Person(String fullName) {}\n }\n class Child extends Person {\n Child(String fullName) { super(fullName); }\n }\n\n\nUse the options to indicate whether to ignore overridden parameter names that are only\na single character long or come from a library method. Both can be useful if\nyou do not wish to be bound by dubious naming conventions used in libraries.\n\nInspection ID: ParameterNameDiffersFromOverriddenParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ParameterNameDiffersFromOverriddenParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OctalLiteral", + "shortDescription": { + "text": "Octal integer" + }, + "fullDescription": { + "text": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals. Example: 'int i = 015;\n int j = 0_777;' This inspection has two different quick-fixes. After the Convert octal literal to decimal literal quick-fix is applied, the code changes to: 'int i = 13;\n int j = 511;' After the Remove leading zero to make decimal quick-fix is applied, the code changes to: 'int i = 15;\n int j = 777;' Inspection ID: OctalLiteral", + "markdown": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals.\n\nExample:\n\n\n int i = 015;\n int j = 0_777;\n\nThis inspection has two different quick-fixes.\nAfter the **Convert octal literal to decimal literal** quick-fix is applied, the code changes to:\n\n\n int i = 13;\n int j = 511;\n\nAfter the **Remove leading zero to make decimal** quick-fix is applied, the code changes to:\n\n\n int i = 15;\n int j = 777;\n\nInspection ID: OctalLiteral" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "OctalInteger", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LambdaParameterHidingMemberVariable", + "shortDescription": { + "text": "Lambda parameter hides field" + }, + "fullDescription": { + "text": "Reports lambda parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the lambda parameter when using the identically named field is intended. A quick-fix is suggested to rename the lambda parameter. Example: 'public class MyClass {\n public Object foo;\n\n void sort(List list) {\n list.sort((foo, bar) -> foo - bar);\n }\n }' Use the option to choose whether to ignore fields that are not visible from the lambda expression. For example, private fields of a superclass. This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: LambdaParameterHidingMemberVariable", + "markdown": "Reports lambda parameters named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the lambda parameter when using the identically named field is intended.\n\nA quick-fix is suggested to rename the lambda parameter.\n\n**Example:**\n\n\n public class MyClass {\n public Object foo;\n\n void sort(List list) {\n list.sort((foo, bar) -> foo - bar);\n }\n }\n\n\nUse the option to choose whether to ignore fields that are not visible from the lambda expression.\nFor example, private fields of a superclass.\n\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: LambdaParameterHidingMemberVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LambdaParameterHidesMemberVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReadWriteStringCanBeUsed", + "shortDescription": { + "text": "'Files.readString()' or 'Files.writeString()' can be used" + }, + "fullDescription": { + "text": "Reports method calls that read or write a 'String' as bytes using 'java.nio.file.Files'. Such calls can be replaced with a call to a 'Files.readString()' or 'Files.writeString()' method introduced in Java 11. Example: 'String s = \"example\";\n Files.write(Paths.get(\"out.txt\"), s.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE);\n s = new String(Files.readAllBytes(Paths.get(\"in.txt\")), StandardCharsets.ISO_8859_1);' After the quick fix is applied: 'String s = \"example\";\n Files.writeString(Paths.get(\"out.txt\"), s, StandardOpenOption.WRITE);\n s = Files.readString(Paths.get(\"in.txt\"), StandardCharsets.ISO_8859_1);' Note that the 'readString()' behavior differs from the 'new String(bytes, charset)' behavior when it comes to handling of invalid (unmappable) characters. The 'readString()' method throws an exception in such cases, while the 'new String(bytes, charset)' method silently replaces invalid characters with the replacement character. If silent replacement is desired, it would be better to suppress the inspection warning. Inspection ID: ReadWriteStringCanBeUsed New in 2018.3", + "markdown": "Reports method calls that read or write a `String` as bytes using `java.nio.file.Files`. Such calls can be replaced with a call to a `Files.readString()` or `Files.writeString()` method introduced in Java 11.\n\n**Example:**\n\n\n String s = \"example\";\n Files.write(Paths.get(\"out.txt\"), s.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE);\n s = new String(Files.readAllBytes(Paths.get(\"in.txt\")), StandardCharsets.ISO_8859_1);\n\nAfter the quick fix is applied:\n\n\n String s = \"example\";\n Files.writeString(Paths.get(\"out.txt\"), s, StandardOpenOption.WRITE);\n s = Files.readString(Paths.get(\"in.txt\"), StandardCharsets.ISO_8859_1);\n\n\nNote that the `readString()` behavior differs from the `new String(bytes, charset)` behavior when it comes to\nhandling of invalid (unmappable) characters. The `readString()` method throws an exception in such cases, while the\n`new String(bytes, charset)` method silently replaces invalid characters with the replacement character.\nIf silent replacement is desired, it would be better to suppress the inspection warning.\n\nInspection ID: ReadWriteStringCanBeUsed\n\nNew in 2018.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReadWriteStringCanBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 11", + "index": 125, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantMathCall", + "shortDescription": { + "text": "Constant call to 'Math'" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.Math' or 'java.lang.StrictMath' methods that can be replaced with simple compile-time constants. Example: 'double v = Math.sin(0.0);' After the quick-fix is applied: 'double v = 0.0;' Inspection ID: ConstantMathCall", + "markdown": "Reports calls to `java.lang.Math` or `java.lang.StrictMath` methods that can be replaced with simple compile-time constants.\n\n**Example:**\n\n double v = Math.sin(0.0);\n\nAfter the quick-fix is applied:\n\n double v = 0.0;\n\nInspection ID: ConstantMathCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantMathCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissortedModifiers", + "shortDescription": { + "text": "Missorted modifiers" + }, + "fullDescription": { + "text": "Reports declaration modifiers that are not in the canonical preferred order (as stated in the Java Language Specification). Example: 'class Foo {\n native public final void foo();\n }' After the quick-fix is applied: 'class Foo {\n public final native void foo();\n }' Inspection ID: MissortedModifiers", + "markdown": "Reports declaration modifiers that are not in the canonical preferred order (as stated in the Java Language Specification).\n\n**Example:**\n\n\n class Foo {\n native public final void foo();\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n public final native void foo();\n }\n\nInspection ID: MissortedModifiers" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MissortedModifiers", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TransientFieldInNonSerializableClass", + "shortDescription": { + "text": "Transient field in non-serializable class" + }, + "fullDescription": { + "text": "Reports 'transient' fields in classes that do not implement 'java.io.Serializable'. Example: 'public class NonSerializableClass {\n private transient String password;\n }' After the quick-fix is applied: 'public class NonSerializableClass {\n private String password;\n }' Inspection ID: TransientFieldInNonSerializableClass", + "markdown": "Reports `transient` fields in classes that do not implement `java.io.Serializable`.\n\n**Example:**\n\n\n public class NonSerializableClass {\n private transient String password;\n }\n\nAfter the quick-fix is applied:\n\n\n public class NonSerializableClass {\n private String password;\n }\n\nInspection ID: TransientFieldInNonSerializableClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TransientFieldInNonSerializableClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CyclomaticComplexity", + "shortDescription": { + "text": "Overly complex method" + }, + "fullDescription": { + "text": "Reports methods that have too many branch points. A branch point is one of the following: loop statement 'if' statement ternary expression 'catch' section expression with one or more '&&' or '||' operators inside 'switch' block with non-default branches Methods with too high cyclomatic complexity may be confusing and hard to test. Use the Method complexity limit field to specify the maximum allowed cyclomatic complexity for a method. Inspection ID: CyclomaticComplexity", + "markdown": "Reports methods that have too many branch points.\n\nA branch point is one of the following:\n\n* loop statement\n* `if` statement\n* ternary expression\n* `catch` section\n* expression with one or more `&&` or `||` operators inside\n* `switch` block with non-default branches\n\nMethods with too high cyclomatic complexity may be confusing and hard to test.\n\nUse the **Method complexity limit** field to specify the maximum allowed cyclomatic complexity for a method.\n\n\nInspection ID: CyclomaticComplexity" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyComplexMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SlowListContainsAll", + "shortDescription": { + "text": "Call to 'list.containsAll(collection)' may have poor performance" + }, + "fullDescription": { + "text": "Reports calls to 'containsAll()' on 'java.util.List'. The time complexity of this method call is O(n·m), where n is the number of elements in the list on which the method is called, and m is the number of elements in the collection passed to the method as a parameter. When the list is large, this can be an expensive operation. The quick-fix wraps the list in 'new java.util.HashSet<>()' since the time required to create 'java.util.HashSet' from 'java.util.List' and execute 'containsAll()' on 'java.util.HashSet' is O(n+m). Example: 'public boolean check(List list, Collection collection) {\n // O(n·m) complexity\n return list.containsAll(collection);\n }' After the quick-fix is applied: 'public boolean check(List list, Collection collection) {\n // O(n+m) complexity\n return new HashSet<>(list).containsAll(collection);\n }' Inspection ID: SlowListContainsAll New in 2022.1", + "markdown": "Reports calls to `containsAll()` on `java.util.List`.\n\n\nThe time complexity of this method call is O(n·m), where n is the number of elements in the list on which\nthe method is called, and m is the number of elements in the collection passed to the method as a parameter.\nWhen the list is large, this can be an expensive operation.\n\n\nThe quick-fix wraps the list in `new java.util.HashSet<>()` since the time required to create\n`java.util.HashSet` from `java.util.List` and execute `containsAll()` on\n`java.util.HashSet` is O(n+m).\n\n**Example:**\n\n public boolean check(List list, Collection collection) {\n // O(n·m) complexity\n return list.containsAll(collection);\n }\n\nAfter the quick-fix is applied:\n\n public boolean check(List list, Collection collection) {\n // O(n+m) complexity\n return new HashSet<>(list).containsAll(collection);\n }\n\nInspection ID: SlowListContainsAll\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SlowListContainsAll", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AwaitNotInLoop", + "shortDescription": { + "text": "'await()' not called in loop" + }, + "fullDescription": { + "text": "Reports 'java.util.concurrent.locks.Condition.await()' not being called inside a loop. 'await()' and related methods are normally used to suspend a thread until some condition becomes true. As the thread could have been woken up for a different reason, the condition should be checked after the 'await()' call returns. A loop is a simple way to achieve this. Example: 'void acquire(Condition released) throws InterruptedException {\n released.await();\n }' Good code should look like this: 'void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }' Inspection ID: AwaitNotInLoop", + "markdown": "Reports `java.util.concurrent.locks.Condition.await()` not being called inside a loop.\n\n\n`await()` and related methods are normally used to suspend a thread until some condition becomes true.\nAs the thread could have been woken up for a different reason,\nthe condition should be checked after the `await()` call returns.\nA loop is a simple way to achieve this.\n\n**Example:**\n\n\n void acquire(Condition released) throws InterruptedException {\n released.await();\n }\n\nGood code should look like this:\n\n\n void acquire(Condition released) throws InterruptedException {\n while (acquired) {\n released.await();\n }\n }\n\nInspection ID: AwaitNotInLoop" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AwaitNotInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticVariableUninitializedUse", + "shortDescription": { + "text": "Static field used before initialization" + }, + "fullDescription": { + "text": "Reports 'static' variables that are read before initialization. The inspection ignores equality checks with 'null'. Example: 'class Foo {\n public static int bar;\n\n public static void main(String[] args) {\n System.out.println(bar);\n }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report 'static' variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore primitive fields option to ignore uninitialized primitive fields. Inspection ID: StaticVariableUninitializedUse", + "markdown": "Reports `static` variables that are read before initialization.\n\nThe inspection ignores equality checks with `null`.\n\n**Example:**\n\n\n class Foo {\n public static int bar;\n\n public static void main(String[] args) {\n System.out.println(bar);\n }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report `static` variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields.\n\nInspection ID: StaticVariableUninitializedUse" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticVariableUsedBeforeInitialization", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CyclicClassDependency", + "shortDescription": { + "text": "Cyclic class dependency" + }, + "fullDescription": { + "text": "Reports classes that are mutually or cyclically dependent on other classes. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: CyclicClassDependency", + "markdown": "Reports classes that are mutually or cyclically dependent on other classes.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: CyclicClassDependency" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CyclicClassDependency", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Dependency issues", + "index": 93, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExceptionPackage", + "shortDescription": { + "text": "Exception package" + }, + "fullDescription": { + "text": "Reports packages that only contain classes that extend 'java.lang.Throwable', either directly or indirectly. Although exceptions usually don't depend on other classes for their implementation, they are normally not used separately. It is often a better design to locate exceptions in the same package as the classes that use them. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ExceptionPackage", + "markdown": "Reports packages that only contain classes that extend `java.lang.Throwable`, either directly or indirectly.\n\nAlthough exceptions usually don't depend on other classes for their implementation, they are normally not used separately.\nIt is often a better design to locate exceptions in the same package as the classes that use them.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ExceptionPackage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExceptionPackage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Packaging issues", + "index": 38, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringBufferReplaceableByStringBuilder", + "shortDescription": { + "text": "'StringBuffer' may be 'StringBuilder'" + }, + "fullDescription": { + "text": "Reports variables declared as 'StringBuffer' and suggests replacing them with 'StringBuilder'. 'StringBuilder' is a non-thread-safe replacement for 'StringBuffer'. This inspection only reports if the language level of the project or module is 5 or higher. Inspection ID: StringBufferReplaceableByStringBuilder", + "markdown": "Reports variables declared as `StringBuffer` and suggests replacing them with `StringBuilder`. `StringBuilder` is a non-thread-safe replacement for `StringBuffer`.\n\nThis inspection only reports if the language level of the project or module is 5 or higher.\n\nInspection ID: StringBufferReplaceableByStringBuilder" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringBufferMayBeStringBuilder", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeParameterExtendsObject", + "shortDescription": { + "text": "Type parameter explicitly extends 'Object'" + }, + "fullDescription": { + "text": "Reports type parameters and wildcard type arguments that are explicitly declared to extend 'java.lang.Object'. Such 'extends' clauses are redundant as 'java.lang.Object' is a supertype for all classes. Example: 'class ClassA {}' If you need to preserve the 'extends Object' clause because of annotations, disable the Ignore when java.lang.Object is annotated option. This might be useful, for example, when you use a nullness analyzer, and the 'extends Object' clause holds a '@Nullable'/'@NotNull' annotation. Example: 'class MyClass {}' Inspection ID: TypeParameterExtendsObject", + "markdown": "Reports type parameters and wildcard type arguments that are explicitly declared to extend `java.lang.Object`.\n\nSuch 'extends' clauses are redundant as `java.lang.Object` is a supertype for all classes.\n\n**Example:**\n\n class ClassA {}\n\n\nIf you need to preserve the 'extends Object' clause because of annotations, disable the\n**Ignore when java.lang.Object is annotated** option.\nThis might be useful, for example, when you use a nullness analyzer, and the 'extends Object' clause\nholds a `@Nullable`/`@NotNull` annotation.\n\n**Example:**\n\n class MyClass {}\n\nInspection ID: TypeParameterExtendsObject" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TypeParameterExplicitlyExtendsObject", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SynchronizedMethod", + "shortDescription": { + "text": "'synchronized' method" + }, + "fullDescription": { + "text": "Reports the 'synchronized' modifier on methods. There are several reasons a 'synchronized' modifier on a method may be a bad idea: As little work as possible should be performed under a lock. Therefore it is often better to use a 'synchronized' block and keep there only the code that works with shared state. Synchronization becomes a part of a method's interface. This makes a transition to a different locking mechanism difficult. Keeping track of what is locking a particular object gets harder. The DoS (denial-of-service) attack becomes feasible either on purpose or unknowingly when inheriting the method's class. As an alternative, consider synchronizing on a 'private final' lock object, access to which can be completely controlled. A quick-fix is provided to wrap the method body with 'synchronized(this)'. Example: 'class Main {\n public synchronized void fooBar() {\n }\n }' After the quick-fix is applied: 'class Main {\n public void fooBar() {\n synchronized (this) {\n }\n }\n }' You can configure the following options for this inspection: Include native methods - include native methods into the inspection's scope. Ignore methods overriding a synchronized method - do not report methods that override a 'synchronized' method. Inspection ID: SynchronizedMethod", + "markdown": "Reports the `synchronized` modifier on methods.\n\n\nThere are several reasons a `synchronized` modifier on a method may be a bad idea:\n\n1. As little work as possible should be performed under a lock. Therefore it is often better to use a `synchronized` block and keep there only the code that works with shared state.\n2. Synchronization becomes a part of a method's interface. This makes a transition to a different locking mechanism difficult.\n3. Keeping track of what is locking a particular object gets harder.\n4. The DoS (denial-of-service) attack becomes feasible either on purpose or unknowingly when inheriting the method's class.\n\n\nAs an alternative, consider synchronizing on a `private final` lock object, access to which can be completely controlled.\n\nA quick-fix is provided to wrap the method body with `synchronized(this)`.\n\n**Example:**\n\n\n class Main {\n public synchronized void fooBar() {\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n public void fooBar() {\n synchronized (this) {\n }\n }\n }\n\nYou can configure the following options for this inspection:\n\n1. **Include native methods** - include native methods into the inspection's scope.\n2. **Ignore methods overriding a synchronized method** - do not report methods that override a `synchronized` method.\n\nInspection ID: SynchronizedMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SynchronizedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringConcatenationInsideStringBufferAppend", + "shortDescription": { + "text": "String concatenation as argument to 'StringBuilder.append()' call" + }, + "fullDescription": { + "text": "Reports 'String' concatenation used as the argument to 'StringBuffer.append()', 'StringBuilder.append()' or 'Appendable.append()'. Such calls may profitably be turned into chained append calls on the existing 'StringBuffer/Builder/Appendable' saving the cost of an extra 'StringBuffer/Builder' allocation. This inspection ignores compile-time evaluated 'String' concatenations, in which case the conversion would only worsen performance. Example: 'void bar(StringBuilder builder, String name) {\n builder.append(\"Hello,\" + name); //warning\n builder.append(\"Hello,\" + \"world\"); //no warning\n }' Inspection ID: StringConcatenationInsideStringBufferAppend", + "markdown": "Reports `String` concatenation used as the argument to `StringBuffer.append()`, `StringBuilder.append()` or `Appendable.append()`.\n\n\nSuch calls may profitably be turned into chained append calls on the existing `StringBuffer/Builder/Appendable`\nsaving the cost of an extra `StringBuffer/Builder` allocation.\nThis inspection ignores compile-time evaluated `String` concatenations, in which case the conversion would only\nworsen performance.\n\n**Example:**\n\n\n void bar(StringBuilder builder, String name) {\n builder.append(\"Hello,\" + name); //warning\n builder.append(\"Hello,\" + \"world\"); //no warning\n }\n\n\nInspection ID: StringConcatenationInsideStringBufferAppend" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringConcatenationInsideStringBufferAppend", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AbstractMethodWithMissingImplementations", + "shortDescription": { + "text": "Abstract method with missing implementations" + }, + "fullDescription": { + "text": "Reports 'abstract' methods that are not implemented in every concrete subclass. This results in a compile-time error on the subclasses; the inspection reports the problem at the point of the abstract method, allowing faster detection of the problem. Inspection ID: AbstractMethodWithMissingImplementations", + "markdown": "Reports `abstract` methods that are not implemented in every concrete subclass.\n\n\nThis results in a compile-time error on the subclasses;\nthe inspection reports the problem at the point of the abstract method, allowing faster detection of the problem.\n\nInspection ID: AbstractMethodWithMissingImplementations" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AbstractMethodWithMissingImplementations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FeatureEnvy", + "shortDescription": { + "text": "Feature envy" + }, + "fullDescription": { + "text": "Reports the Feature Envy code smell. The warning is thrown when a method calls methods on another class three or more times. Calls to library classes, parent classes, contained or containing classes are not counted by this inspection. Feature envy is often an indication of the fact that this functionality is located in a wrong class. Example: 'class JobManager {\n // Warning: this method calls three methods\n // of the Job class\n // It would be better to move this chain of\n // calls to the Job class itself.\n void performJob(Job job) {\n job.beforeStart();\n job.process();\n job.afterProcessing();\n }\n }' Inspection ID: FeatureEnvy", + "markdown": "Reports the *Feature Envy* code smell. The warning is thrown when a method calls methods on another class three or more times. Calls to library classes, parent classes, contained or containing classes are not counted by this inspection. Feature envy is often an indication of the fact that this functionality is located in a wrong class.\n\nExample:\n\n\n class JobManager {\n // Warning: this method calls three methods\n // of the Job class\n // It would be better to move this chain of\n // calls to the Job class itself.\n void performJob(Job job) {\n job.beforeStart();\n job.process();\n job.afterProcessing();\n }\n }\n\nInspection ID: FeatureEnvy" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FeatureEnvy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BoxingBoxedValue", + "shortDescription": { + "text": "Boxing of already boxed value" + }, + "fullDescription": { + "text": "Reports boxing of already boxed values. This is a redundant operation since any boxed value will first be auto-unboxed before boxing the value again. If done inside an inner loop, such code may cause performance problems. Example: 'Integer value = 1;\n method(Integer.valueOf(value));' After the quick fix is applied: 'Integer value = 1;\n method(value);' Inspection ID: BoxingBoxedValue", + "markdown": "Reports boxing of already boxed values.\n\n\nThis is a redundant\noperation since any boxed value will first be auto-unboxed before boxing the\nvalue again. If done inside an inner loop, such code may cause performance\nproblems.\n\n**Example:**\n\n\n Integer value = 1;\n method(Integer.valueOf(value));\n\nAfter the quick fix is applied:\n\n\n Integer value = 1;\n method(value);\n\n\nInspection ID: BoxingBoxedValue" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "BoxingBoxedValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Convert2MethodRef", + "shortDescription": { + "text": "Lambda can be replaced with method reference" + }, + "fullDescription": { + "text": "Reports lambdas that can be replaced with method references. While often it could be a matter of taste, method references are more clear and readable compared to lambdas. Example: 'Runnable r = () -> System.out.println();' After the quick-fix is applied: 'Runnable r = System.out::println;' The inspection may suggest method references even if a lambda doesn't call any method, like replacing 'obj -> obj != null' with 'Objects::nonNull'. Use the Settings | Editor | Code Style | Java | Code Generation settings to configure special method references. This inspection depends on the following Java features: Lambda expressions Method references These features are available since Java 8. Inspection ID: Convert2MethodRef", + "markdown": "Reports lambdas that can be replaced with method references. While often it could be a matter of taste, method references are more clear and readable compared to lambdas.\n\nExample:\n\n\n Runnable r = () -> System.out.println();\n\nAfter the quick-fix is applied:\n\n\n Runnable r = System.out::println;\n\n\nThe inspection may suggest method references even if a lambda doesn't call any method, like replacing `obj -> obj != null`\nwith `Objects::nonNull`.\nUse the [Settings \\| Editor \\| Code Style \\| Java \\| Code Generation](settings://preferences.sourceCode.Java?Lambda%20Body)\nsettings to configure special method references.\n\nThis inspection depends on the following Java features:\n\n* Lambda expressions\n* Method references\n\nThese features are available since Java 8.\n\nInspection ID: Convert2MethodRef" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Convert2MethodRef", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantCollectionOperation", + "shortDescription": { + "text": "Redundant 'Collection' operation" + }, + "fullDescription": { + "text": "Reports unnecessarily complex collection operations which have simpler alternatives. Example: 'void f(String[] array, Collection collection) {\n String[] strings = Arrays.asList(array).subList(0, 10).toArray(new String[0]);\n boolean contains = collection.containsAll(Collections.singletonList(\"x\"));\n }' After the quick-fix is applied: 'void f(String[] array, Collection collection) {\n String[] strings = Arrays.copyOf(array, 10);\n boolean contains = collection.contains(\"x\");\n }' Inspection ID: RedundantCollectionOperation New in 2018.1", + "markdown": "Reports unnecessarily complex collection operations which have simpler alternatives.\n\nExample:\n\n\n void f(String[] array, Collection collection) {\n String[] strings = Arrays.asList(array).subList(0, 10).toArray(new String[0]);\n boolean contains = collection.containsAll(Collections.singletonList(\"x\"));\n }\n\nAfter the quick-fix is applied:\n\n\n void f(String[] array, Collection collection) {\n String[] strings = Arrays.copyOf(array, 10);\n boolean contains = collection.contains(\"x\");\n }\n\nInspection ID: RedundantCollectionOperation\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantCollectionOperation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryToStringCall", + "shortDescription": { + "text": "Unnecessary call to 'toString()'" + }, + "fullDescription": { + "text": "Reports calls to 'toString()' that are used in the following cases: In string concatenations In the 'java.lang.StringBuilder#append()' or 'java.lang.StringBuffer#append()' methods In the methods of 'java.io.PrintWriter' or 'java.io.PrintStream' in the methods 'org.slf4j.Logger' In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to 'toString()' is not needed. Removing redundant 'toString()' calls can occasionally even improve performance and reduce object allocations. Example: 'System.out.println(this.toString())' After the quick-fix is applied: 'System.out.println(this)' Note that without the 'toString()' call, the code semantics might be different: if the expression is null, then the 'null' string will be used instead of throwing a 'NullPointerException'. Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null. Removing the explicit 'toString()' in these cases will change the runtime semantics from throwing a 'NullPointException' to silently accepting the value when it is 'null'. Inspection ID: UnnecessaryToStringCall", + "markdown": "Reports calls to `toString()` that are used in the following cases:\n\n* In string concatenations\n* In the `java.lang.StringBuilder#append()` or `java.lang.StringBuffer#append()` methods\n* In the methods of `java.io.PrintWriter` or `java.io.PrintStream`\n* in the methods `org.slf4j.Logger`\n\nIn these cases, conversion to string will be handled by the underlying library methods,\nand the explicit call to `toString()` is not needed.\nRemoving redundant `toString()` calls can occasionally even improve performance and reduce object allocations.\n\nExample:\n\n\n System.out.println(this.toString())\n\nAfter the quick-fix is applied:\n\n\n System.out.println(this)\n\n\nNote that without the `toString()` call, the code semantics might be different: if the expression is null,\nthen the `null` string will be used instead of throwing a `NullPointerException`.\n\nUse the **Report only when qualifier is known to be not-null** option to avoid warnings for the values that could potentially be null.\nRemoving the explicit `toString()` in these cases will change the runtime semantics\nfrom throwing a `NullPointException` to silently accepting the value when it is `null`.\n\nInspection ID: UnnecessaryToStringCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryToStringCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuppressionAnnotation", + "shortDescription": { + "text": "Inspection suppression annotation" + }, + "fullDescription": { + "text": "Reports comments or annotations suppressing inspections. This inspection can be useful when leaving suppressions intentionally for further review. Example: '@SuppressWarnings(\"unused\")\nstatic Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n}' Inspection ID: SuppressionAnnotation", + "markdown": "Reports comments or annotations suppressing inspections.\n\nThis inspection can be useful when leaving suppressions intentionally for further review.\n\n**Example:**\n\n\n @SuppressWarnings(\"unused\")\n static Stream stringProvider() {\n return Stream.of(\"foo\", \"bar\");\n }\n\nInspection ID: SuppressionAnnotation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SuppressionAnnotation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassOnlyUsedInOnePackage", + "shortDescription": { + "text": "Class only used from one other package" + }, + "fullDescription": { + "text": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassOnlyUsedInOnePackage", + "markdown": "Reports classes that don't depend on any other class in their package, depend on classes from another package, and are themselves a dependency only for classes from this other package. Consider moving such classes to the package on which they depend.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassOnlyUsedInOnePackage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassOnlyUsedInOnePackage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Packaging issues", + "index": 38, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverriddenMethodCallDuringObjectConstruction", + "shortDescription": { + "text": "Overridden method called during object construction" + }, + "fullDescription": { + "text": "Reports any calls to overridden methods of the current class during object construction. This happens if an object construction is inside: A constructor A non-static instance initializer A non-static field initializer 'clone()' 'readObject()' 'readObjectNoData()' Such calls may result in subtle bugs, as the object is not guaranteed to be initialized before the method call occurs. Example: 'abstract class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n\n @Override\n void someMethod() { }\n }' This inspection shares its functionality with: The Abstract method called during object construction inspection The Overridable method called during object construction inspection Only one inspection should be enabled at the same time to prevent duplicate warnings. Inspection ID: OverriddenMethodCallDuringObjectConstruction", + "markdown": "Reports any calls to overridden methods of the current class during object construction. This happens if an object construction is inside:\n\n* A constructor\n* A non-static instance initializer\n* A non-static field initializer\n* `clone()`\n* `readObject()`\n* `readObjectNoData()`\n\nSuch calls may result in subtle bugs, as the object is not guaranteed to be initialized before the method call occurs.\n\nExample:\n\n\n abstract class Parent {\n void someMethod() { }\n }\n\n class Child extends Parent {\n Child() {\n someMethod();\n }\n\n @Override\n void someMethod() { }\n }\n\nThis inspection shares its functionality with:\n\n* The **Abstract method called during object construction** inspection\n* The **Overridable method called during object construction** inspection\n\nOnly one inspection should be enabled at the same time to prevent duplicate warnings.\n\nInspection ID: OverriddenMethodCallDuringObjectConstruction" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverriddenMethodCallDuringObjectConstruction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AbstractClassWithoutAbstractMethods", + "shortDescription": { + "text": "Abstract class without 'abstract' methods" + }, + "fullDescription": { + "text": "Reports 'abstract' classes that have no 'abstract' methods. In most cases it does not make sense to have an 'abstract' class without any 'abstract' methods, and the 'abstract' modifier can be removed from the class. If the class was declared 'abstract' to prevent instantiation, it is often a better option to use a 'private' constructor to prevent instantiation instead. Example: 'abstract class Example {\n public String getName() {\n return \"IntelliJ IDEA\";\n }\n }' Use the option to ignore utility classes. Inspection ID: AbstractClassWithoutAbstractMethods", + "markdown": "Reports `abstract` classes that have no `abstract` methods. In most cases it does not make sense to have an `abstract` class without any `abstract` methods, and the `abstract` modifier can be removed from the class. If the class was declared `abstract` to prevent instantiation, it is often a better option to use a `private` constructor to prevent instantiation instead.\n\n**Example:**\n\n\n abstract class Example {\n public String getName() {\n return \"IntelliJ IDEA\";\n }\n }\n\nUse the option to ignore utility classes.\n\nInspection ID: AbstractClassWithoutAbstractMethods" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AbstractClassWithoutAbstractMethods", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CastThatLosesPrecision", + "shortDescription": { + "text": "Numeric cast that loses precision" + }, + "fullDescription": { + "text": "Reports cast operations between primitive numeric types that may result in precision loss. Such casts are not necessarily a problem but may result in difficult to trace bugs if the loss of precision is unexpected. Example: 'int a = 420;\n byte b = (byte) a;' Use the Ignore casts from int to char option to ignore casts from 'int' to 'char'. This type of cast is often used when implementing I/O operations because the 'read()' method of the 'java.io.Reader' class returns an 'int'. Use the Ignore casts from int 128-255 to byte option to ignore casts of constant values (128-255) from 'int' to 'byte'. Such values will overflow to negative numbers that still fit inside a byte. Inspection ID: CastThatLosesPrecision", + "markdown": "Reports cast operations between primitive numeric types that may result in precision loss.\n\nSuch casts are not necessarily a problem but may result in difficult to\ntrace bugs if the loss of precision is unexpected.\n\n**Example:**\n\n\n int a = 420;\n byte b = (byte) a;\n\nUse the **Ignore casts from int to char** option to ignore casts from `int` to `char`.\nThis type of cast is often used when implementing I/O operations because the `read()` method of the\n`java.io.Reader` class returns an `int`.\n\nUse the **Ignore casts from int 128-255 to byte** option to ignore casts of constant values (128-255) from `int` to\n`byte`.\nSuch values will overflow to negative numbers that still fit inside a byte.\n\nInspection ID: CastThatLosesPrecision" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NumericCastThatLosesPrecision", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues/Cast", + "index": 108, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReturnSeparatedFromComputation", + "shortDescription": { + "text": "'return' separated from the result computation" + }, + "fullDescription": { + "text": "Reports 'return' statements that return a local variable where the value of the variable is computed somewhere else within the same method. The quick-fix inlines the returned variable by moving the return statement to the location in which the value of the variable is computed. When the returned value can't be inlined into the 'return' statement, the quick-fix attempts to move the return statement as close to the computation of the returned value as possible. Example: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;' After the quick-fix is applied: 'int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;' Inspection ID: ReturnSeparatedFromComputation", + "markdown": "Reports `return` statements that return a local variable where the value of the variable is computed somewhere else within the same method.\n\nThe quick-fix inlines the returned variable by moving the return statement to the location in which the value\nof the variable is computed.\nWhen the returned value can't be inlined into the `return` statement,\nthe quick-fix attempts to move the return statement as close to the computation of the returned value as possible.\n\nExample:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n n = i;\n break;\n }\n }\n return n;\n\nAfter the quick-fix is applied:\n\n\n int n = -1;\n for (int i = 0; i < a.length; i++) {\n if (a[i] == b) {\n return i;\n }\n }\n return n;\n\nInspection ID: ReturnSeparatedFromComputation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReturnSeparatedFromComputation", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SynchronizeOnNonFinalField", + "shortDescription": { + "text": "Synchronization on a non-final field" + }, + "fullDescription": { + "text": "Reports 'synchronized' statement lock expressions that consist of a non-'final' field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object. Example: 'private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }' Inspection ID: SynchronizeOnNonFinalField", + "markdown": "Reports `synchronized` statement lock expressions that consist of a non-`final` field reference. Such statements are unlikely to have useful semantics, as different threads may acquire different locks even when operating on the same object.\n\n**Example:**\n\n\n private Object o;\n public void foo() {\n synchronized (o) // synchronization on a non-final field\n { }\n }\n\nInspection ID: SynchronizeOnNonFinalField" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SynchronizeOnNonFinalField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SameReturnValue", + "shortDescription": { + "text": "Method always returns the same value" + }, + "fullDescription": { + "text": "Reports methods and method hierarchies that always return the same constant. The inspection works differently in batch-mode (from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name) and on-the-fly in the editor: In batch-mode, the inspection reports methods and method hierarchies that always return the same constant. In the editor, the inspection only reports methods that have more than one 'return' statement, do not have super methods, and cannot be overridden. If a method overrides or implements a method, a contract may require it to return a specific constant, but at the same time, we may want to have several exit points. If a method can be overridden, it is possible that a different value will be returned in subclasses. Example: 'class X {\n // Warn only in batch-mode:\n int xxx() { // Method 'xxx()' and all its overriding methods always return '0'\n return 0;\n }\n }\n\n class Y extends X {\n @Override\n int xxx() {\n return 0;\n }\n\n // Warn only in batch-mode:\n int yyy() { // Method 'yyy()' always returns '0'\n return 0;\n }\n\n // Warn both in batch-mode and on-the-fly:\n final int zzz(boolean flag) { // Method 'zzz()' always returns '0'\n if (Math.random() > 0.5) {\n return 0;\n }\n return 0;\n }\n }' Inspection ID: SameReturnValue", + "markdown": "Reports methods and method hierarchies that always return the same constant.\n\n\nThe inspection works differently in batch-mode\n(from **Code \\| Inspect Code** or **Code \\| Analyze Code \\| Run Inspection by Name**)\nand on-the-fly in the editor:\n\n* In batch-mode, the inspection reports methods and method hierarchies that always return the same constant.\n* In the editor, the inspection only reports methods that have more than one `return` statement, do not have super methods, and cannot be overridden. If a method overrides or implements a method, a contract may require it to return a specific constant, but at the same time, we may want to have several exit points. If a method can be overridden, it is possible that a different value will be returned in subclasses.\n\n**Example:**\n\n\n class X {\n // Warn only in batch-mode:\n int xxx() { // Method 'xxx()' and all its overriding methods always return '0'\n return 0;\n }\n }\n\n class Y extends X {\n @Override\n int xxx() {\n return 0;\n }\n\n // Warn only in batch-mode:\n int yyy() { // Method 'yyy()' always returns '0'\n return 0;\n }\n\n // Warn both in batch-mode and on-the-fly:\n final int zzz(boolean flag) { // Method 'zzz()' always returns '0'\n if (Math.random() > 0.5) {\n return 0;\n }\n return 0;\n }\n }\n\nInspection ID: SameReturnValue" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SameReturnValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThrowablePrintStackTrace", + "shortDescription": { + "text": "Call to 'printStackTrace()'" + }, + "fullDescription": { + "text": "Reports calls to 'Throwable.printStackTrace()' without arguments. Such statements are often used for temporary debugging and should be either removed from the production code or replaced with a more robust logging facility. Inspection ID: ThrowablePrintStackTrace", + "markdown": "Reports calls to `Throwable.printStackTrace()` without arguments.\n\nSuch statements are often used for temporary debugging and should be either removed from the production code\nor replaced with a more robust logging facility.\n\nInspection ID: ThrowablePrintStackTrace" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToPrintStackTrace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringBufferMustHaveInitialCapacity", + "shortDescription": { + "text": "'StringBuilder' without initial capacity" + }, + "fullDescription": { + "text": "Reports attempts to instantiate a new 'StringBuffer' or 'StringBuilder' object without specifying its initial capacity. If no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing to specify the initial capacity for 'StringBuffer' may result in performance issues if space needs to be reallocated and memory copied when the initial capacity is exceeded. Example: '// Capacity is not specified\n var sb = new StringBuilder();' Inspection ID: StringBufferMustHaveInitialCapacity", + "markdown": "Reports attempts to instantiate a new `StringBuffer` or `StringBuilder` object without specifying its initial capacity.\n\n\nIf no initial capacity is specified, a default capacity is used, which will rarely be optimal.\nFailing to specify the initial capacity for `StringBuffer` may result\nin performance issues if space needs to be reallocated and memory copied\nwhen the initial capacity is exceeded.\n\nExample:\n\n\n // Capacity is not specified\n var sb = new StringBuilder();\n\nInspection ID: StringBufferMustHaveInitialCapacity" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringBufferWithoutInitialCapacity", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrayObjectsEquals", + "shortDescription": { + "text": "Use of shallow or 'Objects' methods with arrays" + }, + "fullDescription": { + "text": "Reports expressions that seem to use an inappropriate method for determining array equality or calculating their hashcode. The following method calls are reported: 'Object.equals()' for any arrays 'Arrays.equals()' for multidimensional arrays 'Arrays.hashCode()' for multidimensional arrays Inspection ID: ArrayObjectsEquals", + "markdown": "Reports expressions that seem to use an inappropriate method for determining array equality or calculating their hashcode.\n\nThe following method calls are reported:\n\n* `Object.equals()` for any arrays\n* `Arrays.equals()` for multidimensional arrays\n* `Arrays.hashCode()` for multidimensional arrays\n\n\nInspection ID: ArrayObjectsEquals" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ArrayObjectsEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreeNegationsPerMethod", + "shortDescription": { + "text": "Method with more than three negations" + }, + "fullDescription": { + "text": "Reports methods with three or more negations. Such methods may be confusing. Example: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }' Without negations, the method becomes easier to understand: 'void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }' Configure the inspection: Use the Ignore negations in 'equals()' methods option to disable the inspection within 'equals()' methods. Use the Ignore negations in 'assert' statements to disable the inspection within 'assert' statements. Inspection ID: ThreeNegationsPerMethod", + "markdown": "Reports methods with three or more negations. Such methods may be confusing.\n\n**Example:**\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (!flag && !flag2) {\n if (a != b) {\n doOther();\n }\n }\n }\n\nWithout negations, the method becomes easier to understand:\n\n\n void doSmth(int a, int b, boolean flag1, boolean flag2) {\n if (flag1 || flag2 || a == b) return;\n doOther();\n }\n\nConfigure the inspection:\n\n* Use the **Ignore negations in 'equals()' methods** option to disable the inspection within `equals()` methods.\n* Use the **Ignore negations in 'assert' statements** to disable the inspection within `assert` statements.\n\nInspection ID: ThreeNegationsPerMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodWithMoreThanThreeNegations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadWithDefaultRunMethod", + "shortDescription": { + "text": "Instantiating a 'Thread' with default 'run()' method" + }, + "fullDescription": { + "text": "Reports instantiations of 'Thread' or an inheritor without specifying a 'Runnable' parameter or overriding the 'run()' method. Such threads do nothing useful. Example: 'new Thread().start();' Inspection ID: ThreadWithDefaultRunMethod", + "markdown": "Reports instantiations of `Thread` or an inheritor without specifying a `Runnable` parameter or overriding the `run()` method. Such threads do nothing useful.\n\n**Example:**\n\n\n new Thread().start();\n\nInspection ID: ThreadWithDefaultRunMethod" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InstantiatingAThreadWithDefaultRunMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TestOnlyProblems", + "shortDescription": { + "text": "Test-only usage in production code" + }, + "fullDescription": { + "text": "Reports '@TestOnly'- and '@VisibleForTesting'-annotated methods and classes that are used in production code. Also reports usage of applying '@TestOnly' '@VisibleForTesting' to the same element. The problems are not reported if such method or class is referenced from: Code under the Test Sources folder A test class (JUnit/TestNG) Another '@TestOnly'-annotated method Example (in production code): '@TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }' Inspection ID: TestOnlyProblems", + "markdown": "Reports `@TestOnly`- and `@VisibleForTesting`-annotated methods and classes that are used in production code. Also reports usage of applying `@TestOnly` `@VisibleForTesting` to the same element.\n\nThe problems are not reported if such method or class is referenced from:\n\n* Code under the **Test Sources** folder\n* A test class (JUnit/TestNG)\n* Another `@TestOnly`-annotated method\n\n**Example (in production code):**\n\n\n @TestOnly\n fun foo() { ... }\n\n fun main () {\n foo()\n }\n\nInspection ID: TestOnlyProblems" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TestOnlyProblems", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Test frameworks", + "index": 100, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java8MapApi", + "shortDescription": { + "text": "Simplifiable 'Map' operations" + }, + "fullDescription": { + "text": "Reports common usage patterns of 'java.util.Map' and suggests replacing them with: 'getOrDefault()', 'computeIfAbsent()', 'putIfAbsent()', 'merge()', or 'replaceAll()'. Example: 'map.containsKey(key) ? map.get(key) : \"default\";' After the quick-fix is applied: 'map.getOrDefault(key, \"default\");' Example: 'List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }' After the quick-fix is applied: 'map.computeIfAbsent(key, localKey -> new ArrayList<>());' Example: 'Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);' After the quick-fix is applied: 'map.merge(key, 1, (localKey, localValue) -> localValue + 1);' Example: 'for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }' After the quick-fix is applied: 'map.replaceAll((localKey, localValue) -> transform(localValue));' Note that the replacement with 'computeIfAbsent()' or 'merge()' might work incorrectly for some 'Map' implementations if the code extracted to the lambda expression modifies the same 'Map'. By default, the warning doesn't appear if this code might have side effects. If necessary, enable the Suggest replacement even if lambda may have side effects option to always show the warning. Also, due to different handling of the 'null' value in old methods like 'put()' and newer methods like 'computeIfAbsent()' or 'merge()', semantics might change if storing the 'null' value into given 'Map' is important. The inspection won't suggest the replacement when the value is statically known to be nullable, but for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning and adding an explanatory comment. This inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8. Inspection ID: Java8MapApi", + "markdown": "Reports common usage patterns of `java.util.Map` and suggests replacing them with: `getOrDefault()`, `computeIfAbsent()`, `putIfAbsent()`, `merge()`, or `replaceAll()`.\n\nExample:\n\n\n map.containsKey(key) ? map.get(key) : \"default\";\n\nAfter the quick-fix is applied:\n\n\n map.getOrDefault(key, \"default\");\n\nExample:\n\n\n List list = map.get(key);\n if (list == null) {\n list = new ArrayList<>();\n map.put(key, list);\n }\n\nAfter the quick-fix is applied:\n\n\n map.computeIfAbsent(key, localKey -> new ArrayList<>());\n\nExample:\n\n\n Integer val = map.get(key);\n if (val == null) map.put(key, 1);\n else map.put(key, val + 1);\n\nAfter the quick-fix is applied:\n\n\n map.merge(key, 1, (localKey, localValue) -> localValue + 1);\n\nExample:\n\n\n for (Map.Entry entry : map.entrySet()) {\n map.put(entry.getKey(), transform(entry.getValue()));\n }\n\nAfter the quick-fix is applied:\n\n\n map.replaceAll((localKey, localValue) -> transform(localValue));\n\nNote that the replacement with `computeIfAbsent()` or `merge()` might work incorrectly for some `Map`\nimplementations if the code extracted to the lambda expression modifies the same `Map`. By default,\nthe warning doesn't appear if this code might have side effects. If necessary, enable the\n**Suggest replacement even if lambda may have side effects** option to always show the warning.\n\nAlso, due to different handling of the `null` value in old methods like `put()` and newer methods like\n`computeIfAbsent()` or `merge()`, semantics might change if storing the `null` value into given\n`Map` is important. The inspection won't suggest the replacement when the value is statically known to be nullable,\nbut for values with unknown nullability the replacement is still suggested. In these cases, we recommended suppressing the warning\nand adding an explanatory comment.\n\nThis inspection depends on the Java feature 'Lambda methods in collections', which is available since Java 8.\n\nInspection ID: Java8MapApi" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Java8MapApi", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MeaninglessRecordAnnotationInspection", + "shortDescription": { + "text": "Meaningless record annotation" + }, + "fullDescription": { + "text": "Reports annotations used on record components that have no effect. This can happen in two cases: The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined. The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined. Example: '@Target(ElementType.METHOD)\n@interface A { }\n \n// The annotation will not appear in bytecode at all,\n// as it should be propagated to the accessor but accessor is explicitly defined \nrecord R(@A int x) {\n public int x() { return x; }\n}' This inspection depends on the Java feature 'Records', which is available since Java 16. Inspection ID: MeaninglessRecordAnnotationInspection New in 2021.1", + "markdown": "Reports annotations used on record components that have no effect.\n\nThis can happen in two cases:\n\n* The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined.\n* The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined.\n\nExample:\n\n\n @Target(ElementType.METHOD)\n @interface A { }\n \n // The annotation will not appear in bytecode at all,\n // as it should be propagated to the accessor but accessor is explicitly defined \n record R(@A int x) {\n public int x() { return x; }\n }\n\nThis inspection depends on the Java feature 'Records', which is available since Java 16.\n\nInspection ID: MeaninglessRecordAnnotationInspection\n\nNew in 2021.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MeaninglessRecordAnnotationInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EqualsWhichDoesntCheckParameterClass", + "shortDescription": { + "text": "'equals()' method that does not check the class of its parameter" + }, + "fullDescription": { + "text": "Reports 'equals()' methods that do not check the type of their parameter. Failure to check the type of the parameter in the 'equals()' method may result in latent errors if the object is used in an untyped collection. Example: 'class MyClass {\n int x;\n\n @Override\n public boolean equals(Object obj) {\n // equals method should return false if obj is not MyClass\n return ((MyClass)obj).x == x;\n }\n }' Inspection ID: EqualsWhichDoesntCheckParameterClass", + "markdown": "Reports `equals()` methods that do not check the type of their parameter.\n\nFailure to check the type of the parameter\nin the `equals()` method may result in latent errors if the object is used in an untyped collection.\n\n**Example:**\n\n\n class MyClass {\n int x;\n\n @Override\n public boolean equals(Object obj) {\n // equals method should return false if obj is not MyClass\n return ((MyClass)obj).x == x;\n }\n }\n\nInspection ID: EqualsWhichDoesntCheckParameterClass" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EqualsDoesntCheckParameterClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseHashCodeMethodInspection", + "shortDescription": { + "text": "Standard 'hashCode()' method can be used" + }, + "fullDescription": { + "text": "Reports bitwise operations that can be replaced with a call to the 'Long.hashCode()' or 'Double.hashCode()' methods. It detects the construct '(int)(x ^ (x >>> 32))' where 'x' is a variable of type 'long' or the result of a previous 'Double.doubleToLongBits()' call. The replacement shortens the code, improving its readability. Example: 'int result = (int)(var ^ (var >>> 32));' After applying the quick-fix: 'int result = Long.hashCode(var);' This inspection only reports if the language level of the project or module is 8 or higher. Inspection ID: UseHashCodeMethodInspection New in 2024.1", + "markdown": "Reports bitwise operations that can be replaced with a call to the `Long.hashCode()` or `Double.hashCode()` methods. It detects the construct `(int)(x ^ (x >>> 32))` where `x` is a variable of type `long` or the result of a previous `Double.doubleToLongBits()` call. The replacement shortens the code, improving its readability.\n\n**Example:**\n\n\n int result = (int)(var ^ (var >>> 32));\n\nAfter applying the quick-fix:\n\n\n int result = Long.hashCode(var);\n\nThis inspection only reports if the language level of the project or module is 8 or higher.\n\nInspection ID: UseHashCodeMethodInspection\n\nNew in 2024.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseHashCodeMethodInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 8", + "index": 61, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousIndentAfterControlStatement", + "shortDescription": { + "text": "Suspicious indentation after control statement without braces" + }, + "fullDescription": { + "text": "Reports suspicious indentation of statements after a control statement without braces. Such indentation can make it look like the statement is inside the control statement, when in fact it will be executed unconditionally after the control statement. Example: 'class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }' Inspection ID: SuspiciousIndentAfterControlStatement", + "markdown": "Reports suspicious indentation of statements after a control statement without braces.\n\n\nSuch indentation can make it look like the statement is inside the control statement,\nwhen in fact it will be executed unconditionally after the control statement.\n\n**Example:**\n\n\n class Bar {\n void foo(int i) {\n if (i == 0)\n System.out.println(\"foo\");\n System.out.println(\"bar\"); // warning\n if (i == 1);\n System.out.println(\"great\"); // warning\n if (i == 42)\n System.out.println(\"answer\");\n System.out.println(\"question\"); // warning\n }\n }\n\nInspection ID: SuspiciousIndentAfterControlStatement" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousIndentAfterControlStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NumericOverflow", + "shortDescription": { + "text": "Numeric overflow" + }, + "fullDescription": { + "text": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction . Examples: 'float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;' Inspection ID: NumericOverflow", + "markdown": "Reports expressions that overflow during computation. Usually, this happens by accident and indicates a bug. For example, a wrong type is used or a shift should be done in an opposite direction .\n\n**Examples:**\n\n\n float a = 1.0f/0.0f;\n long b = 30 * 24 * 60 * 60 * 1000;\n long c = 1000L << 62;\n\nInspection ID: NumericOverflow" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NumericOverflow", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToSuperclassField", + "shortDescription": { + "text": "Constructor assigns value to field defined in superclass" + }, + "fullDescription": { + "text": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor. It is considered preferable to initialize the fields of a superclass in its own constructor and delegate to that constructor in a subclass. This will also allow declaring a field 'final' if it isn't changed after the construction. Example: 'class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }' To avoid the problem, declare a superclass constructor: 'class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }' Inspection ID: AssignmentToSuperclassField", + "markdown": "Reports assignment to, or modification of fields that are declared in a superclass from within a subclass constructor.\n\nIt is considered preferable to initialize the fields of a superclass in its own constructor and\ndelegate to that constructor in a subclass. This will also allow declaring a field `final`\nif it isn't changed after the construction.\n\n**Example:**\n\n\n class Super {\n int x;\n }\n class Sub extends Super {\n Sub(int _x) {\n // Warning: x is declared in a superclass\n x = _x;\n }\n }\n\nTo avoid the problem, declare a superclass constructor:\n\n\n class Super {\n final int x;\n\n Super(int _x) {\n x = _x;\n }\n }\n class Sub extends Super {\n Sub(int _x) {\n super(_x);\n }\n }\n\nInspection ID: AssignmentToSuperclassField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToSuperclassField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FillPermitsList", + "shortDescription": { + "text": "Same file subclasses are missing from permits clause of a sealed class" + }, + "fullDescription": { + "text": "Reports 'sealed' classes without an explicit 'permits' list. Sealed classes that only have subclasses in the same file are not required to have an explicit 'permits' list. By default, this inspection does not highlight in the editor, but only provides a fix. Example: 'sealed class A {}\n final class B extends A {}' After the quick-fix is applied: 'sealed class A permits B {}\n final class B extends A {}' This inspection depends on the Java feature 'Sealed classes', which is available since Java 17. Inspection ID: FillPermitsList New in 2020.3", + "markdown": "Reports `sealed` classes without an explicit `permits` list. Sealed classes that only have subclasses in the same file are not required to have an explicit `permits` list. By default, this inspection does not highlight in the editor, but only provides a fix.\n\nExample:\n\n\n sealed class A {}\n final class B extends A {}\n\nAfter the quick-fix is applied:\n\n\n sealed class A permits B {}\n final class B extends A {}\n\nThis inspection depends on the Java feature 'Sealed classes', which is available since Java 17.\n\nInspection ID: FillPermitsList\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "FillPermitsList", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassNewInstance", + "shortDescription": { + "text": "Unsafe call to 'Class.newInstance()'" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.Class.newInstance()'. This method propagates exceptions thrown by the no-arguments constructor, including checked exceptions. Usages of this method effectively bypass the compile-time exception checking that would otherwise be performed by the compiler. A quick-fix is suggested to replace the call with a call to the 'java.lang.reflect.Constructor.newInstance()' method, which avoids this problem by wrapping any exception thrown by the constructor in a (checked) 'java.lang.reflect.InvocationTargetException'. Example: 'clazz.newInstance()' After the quick-fix is applied: 'clazz.getConstructor().newInstance();' Inspection ID: ClassNewInstance", + "markdown": "Reports calls to `java.lang.Class.newInstance()`.\n\n\nThis method propagates exceptions thrown by\nthe no-arguments constructor, including checked exceptions. Usages of this method\neffectively bypass the compile-time exception checking that would\notherwise be performed by the compiler.\n\n\nA quick-fix is suggested to replace the call with a call to the\n`java.lang.reflect.Constructor.newInstance()` method, which\navoids this problem by wrapping any exception thrown by the constructor in a\n(checked) `java.lang.reflect.InvocationTargetException`.\n\n**Example:**\n\n\n clazz.newInstance()\n\nAfter the quick-fix is applied:\n\n\n clazz.getConstructor().newInstance();\n\nInspection ID: ClassNewInstance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassNewInstance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousDateFormat", + "shortDescription": { + "text": "Suspicious date format pattern" + }, + "fullDescription": { + "text": "Reports date format patterns that are likely used by mistake. The following patterns are reported: Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December. Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended. Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended. Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended. Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended. Examples: 'new SimpleDateFormat(\"YYYY-MM-dd\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"yyyy-MM-DD\")': likely '\"yyyy-MM-dd\"' was intended. 'new SimpleDateFormat(\"HH:MM\")': likely '\"HH:mm\"' was intended. Inspection ID: SuspiciousDateFormat New in 2020.1", + "markdown": "Reports date format patterns that are likely used by mistake.\n\nThe following patterns are reported:\n\n* Uppercase \"Y\", unless \"w\" appears nearby. It stands for \"Week year\" that is almost always the same as normal \"Year\" (lowercase \"y\" pattern), but may point to the next year at the end of December.\n* Uppercase \"M\" (month) close to \"H\", \"K\", \"h\", or \"k\" (hour). It's likely that a lowercase \"m\" (minute) was intended.\n* Lowercase \"m\" (minute) close to \"y\" (year) or \"d\" (day in month). It's likely that an uppercase \"M\" (month) was intended.\n* Uppercase \"D\" (day in year) close to \"M\", or \"L\" (month). It's likely that a lowercase \"d\" (day in month) was intended.\n* Uppercase \"S\" (milliseconds) close to \"m\" (minutes). It's likely that a lowercase \"s\" (seconds) was intended.\n\n\nExamples: \n\n`new SimpleDateFormat(\"YYYY-MM-dd\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"yyyy-MM-DD\")`: likely `\"yyyy-MM-dd\"` was intended. \n\n`new SimpleDateFormat(\"HH:MM\")`: likely `\"HH:mm\"` was intended.\n\nInspection ID: SuspiciousDateFormat\n\nNew in 2020.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousDateFormat", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MagicConstant", + "shortDescription": { + "text": "Magic constant" + }, + "fullDescription": { + "text": "Reports expressions that can be replaced with \"magic\" constants. Example 1: '// Bare literal \"2\" is used, warning:\n Font font = new Font(\"Arial\", 2)' Example 2: '// Predefined constant is used, good:\n Font font = new Font(\"Arial\", Font.ITALIC)' When possible, the quick-fix inserts an appropriate predefined constant. The behavior of this inspection is controlled by 'org.intellij.lang.annotations.MagicConstant' annotation. Some standard Java library methods are pre-annotated, but you can use this annotation in your code as well. Inspection ID: MagicConstant", + "markdown": "Reports expressions that can be replaced with \"magic\" constants.\n\nExample 1:\n\n\n // Bare literal \"2\" is used, warning:\n Font font = new Font(\"Arial\", 2)\n\nExample 2:\n\n\n // Predefined constant is used, good:\n Font font = new Font(\"Arial\", Font.ITALIC)\n\n\nWhen possible, the quick-fix inserts an appropriate predefined constant.\n\n\nThe behavior of this inspection is controlled by `org.intellij.lang.annotations.MagicConstant` annotation.\nSome standard Java library methods are pre-annotated, but you can use this annotation in your code as well.\n\nInspection ID: MagicConstant" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MagicConstant", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LimitedScopeInnerClass", + "shortDescription": { + "text": "Local class" + }, + "fullDescription": { + "text": "Reports local classes. A local class is a named nested class declared inside a code block. Local classes are uncommon and may therefore be confusing. In addition, some code standards discourage the use of local classes. Example: 'class Example {\n void test() {\n class Local { // here\n }\n new Local();\n }\n }' After the quick-fix is applied: 'class Example {\n void test() {\n new Local();\n }\n\n private static class Local { // here\n }\n }' Inspection ID: LimitedScopeInnerClass", + "markdown": "Reports local classes.\n\nA local class is a named nested class declared inside a code block.\nLocal classes are uncommon and may therefore be confusing.\nIn addition, some code standards discourage the use of local classes.\n\n**Example:**\n\n\n class Example {\n void test() {\n class Local { // here\n }\n new Local();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n void test() {\n new Local();\n }\n\n private static class Local { // here\n }\n }\n\nInspection ID: LimitedScopeInnerClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LimitedScopeInnerClass", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MultiplyOrDivideByPowerOfTwo", + "shortDescription": { + "text": "Multiplication or division by power of two" + }, + "fullDescription": { + "text": "Reports multiplication of an integer value by a constant integer that can be represented as a power of two. Such expressions can be replaced with right or left shift operations for a possible performance improvement. Note that this inspection is not relevant for modern JVMs (e. g., HotSpot or OpenJ9) because their JIT compilers will perform this optimization. It might only be useful in some embedded systems where no JIT compilation is performed. Example: 'int y = x * 4;' A quick-fix is suggested to replace the multiplication or division operation with the shift operation: 'int y = x << 2;' Use the option to make the inspection also report division by a power of two. Note that replacing a power of two division with a shift does not work for negative numbers. Inspection ID: MultiplyOrDivideByPowerOfTwo", + "markdown": "Reports multiplication of an integer value by a constant integer that can be represented as a power of two. Such expressions can be replaced with right or left shift operations for a possible performance improvement.\n\n\nNote that this inspection is not relevant for modern JVMs (e. g.,\nHotSpot or OpenJ9) because their JIT compilers will perform this optimization.\nIt might only be useful in some embedded systems where no JIT compilation is performed.\n\n**Example:**\n\n\n int y = x * 4;\n\nA quick-fix is suggested to replace the multiplication or division operation with the shift operation:\n\n\n int y = x << 2;\n\n\nUse the option to make the inspection also report division by a power of two.\nNote that replacing a power of two division with a shift does not work for negative numbers.\n\nInspection ID: MultiplyOrDivideByPowerOfTwo" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MultiplyOrDivideByPowerOfTwo", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodCallInLoopCondition", + "shortDescription": { + "text": "Method call in loop condition" + }, + "fullDescription": { + "text": "Reports method calls in the condition part of a loop statement. In highly resource constrained environments, such calls may have adverse performance implications. Applying the results of this inspection without consideration might have negative effects on code clarity and design. This inspection is intended for Java ME and other highly resource constrained environments. Example: 'String s = \"example\";\n for (int i = 0; i < s.length(); i++) {\n System.out.println(s.charAt(i));\n }' After the quick-fix is applied: 'String s = \"example\";\n int length = s.length();\n for (int i = 0; i < length; i++) {\n System.out.println(s.charAt(i));\n }' Use the option to ignore calls to common Java iteration methods like 'Iterator.hasNext()' and known methods with side-effects like 'Atomic*.compareAndSet'. Inspection ID: MethodCallInLoopCondition", + "markdown": "Reports method calls in the condition part of a loop statement. In highly resource constrained environments, such calls may have adverse performance implications.\n\n\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\nThis inspection is intended for Java ME and other highly resource constrained environments.\n\n**Example:**\n\n\n String s = \"example\";\n for (int i = 0; i < s.length(); i++) {\n System.out.println(s.charAt(i));\n }\n\nAfter the quick-fix is applied:\n\n\n String s = \"example\";\n int length = s.length();\n for (int i = 0; i < length; i++) {\n System.out.println(s.charAt(i));\n }\n\n\nUse the option to ignore calls to common Java iteration methods like `Iterator.hasNext()`\nand known methods with side-effects like `Atomic*.compareAndSet`.\n\nInspection ID: MethodCallInLoopCondition" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodCallInLoopCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NumericToString", + "shortDescription": { + "text": "Call to 'Number.toString()'" + }, + "fullDescription": { + "text": "Reports 'toString()' calls on objects of a class extending 'Number'. Such calls are usually incorrect in an internationalized environment and some locale specific formatting should be used instead. Example: 'void print(Double d) {\n System.out.println(d.toString());\n }' A possible way to fix this problem could be: 'void print(Double d) {\n System.out.printf(\"%f%n\", d);\n }' This formats the number using the default locale which is set during the startup of the JVM and is based on the host environment. Inspection ID: NumericToString", + "markdown": "Reports `toString()` calls on objects of a class extending `Number`. Such calls are usually incorrect in an internationalized environment and some locale specific formatting should be used instead.\n\n**Example:**\n\n\n void print(Double d) {\n System.out.println(d.toString());\n }\n\nA possible way to fix this problem could be:\n\n\n void print(Double d) {\n System.out.printf(\"%f%n\", d);\n }\n\nThis formats the number using the default locale which is set during the startup of the JVM and is based on the host environment.\n\nInspection ID: NumericToString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToNumericToString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForLoopReplaceableByWhile", + "shortDescription": { + "text": "'for' loop may be replaced by 'while' loop" + }, + "fullDescription": { + "text": "Reports 'for' loops that contain neither initialization nor update components, and suggests converting them to 'while' loops. This makes the code easier to read. Example: 'for(; exitCondition(); ) {\n process();\n }' After the quick-fix is applied: 'while(exitCondition()) {\n process();\n }' The quick-fix is also available for other 'for' loops, so you can replace any 'for' loop with a 'while' loop. Use the Ignore 'infinite' for loops without conditions option if you want to ignore 'for' loops with trivial or non-existent conditions. Inspection ID: ForLoopReplaceableByWhile", + "markdown": "Reports `for` loops that contain neither initialization nor update components, and suggests converting them to `while` loops. This makes the code easier to read.\n\nExample:\n\n\n for(; exitCondition(); ) {\n process();\n }\n\nAfter the quick-fix is applied:\n\n\n while(exitCondition()) {\n process();\n }\n\nThe quick-fix is also available for other `for` loops, so you can replace any `for` loop with a\n`while` loop.\n\nUse the **Ignore 'infinite' for loops without conditions** option if you want to ignore `for`\nloops with trivial or non-existent conditions.\n\n\nInspection ID: ForLoopReplaceableByWhile" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ForLoopReplaceableByWhile", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodCount", + "shortDescription": { + "text": "Class with too many methods" + }, + "fullDescription": { + "text": "Reports classes whose number of methods exceeds the specified maximum. Classes with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes. Configure the inspection: Use the Method count limit field to specify the maximum allowed number of methods in a class. Use the Ignore simple getter and setter methods option to ignore simple getters and setters in method count. Use the Ignore methods overriding/implementing a super method to ignore methods that override or implement a method from a superclass. Inspection ID: MethodCount", + "markdown": "Reports classes whose number of methods exceeds the specified maximum.\n\nClasses with too many methods are often trying to 'do too much'. Consider splitting such a class into multiple smaller classes.\n\nConfigure the inspection:\n\n* Use the **Method count limit** field to specify the maximum allowed number of methods in a class.\n* Use the **Ignore simple getter and setter methods** option to ignore simple getters and setters in method count.\n* Use the **Ignore methods overriding/implementing a super method** to ignore methods that override or implement a method from a superclass.\n\nInspection ID: MethodCount" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithTooManyMethods", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class metrics", + "index": 90, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryDefault", + "shortDescription": { + "text": "Unnecessary 'default' for enum 'switch' statement" + }, + "fullDescription": { + "text": "Reports enum 'switch' statements or expression with 'default' branches which can never be taken, because all possible values are covered by a 'case' branch. Such elements are redundant, especially for 'switch' expressions, because they don't compile when all enum constants are not covered by a 'case' branch. The language level needs to be configured to 14 to report 'switch' expressions. The provided quick-fix removes 'default' branches. Example: 'enum E { A, B }\n int foo(E e) {\n return switch (e) {\n case A -> 1;\n case B -> 2;\n default -> 3;\n };\n }' After the quick-fix is applied: 'enum E { A, B }\n int foo(E e) {\n return switch (e) {\n case A -> 1;\n case B -> 2;\n };\n }' Use the Only report switch expressions option to report only redundant 'default' branches in switch expressions. Inspection ID: UnnecessaryDefault", + "markdown": "Reports enum `switch` statements or expression with `default` branches which can never be taken, because all possible values are covered by a `case` branch.\n\nSuch elements are redundant, especially for `switch` expressions, because they don't compile when all\nenum constants are not covered by a `case` branch.\n\n\nThe language level needs to be configured to 14 to report `switch` expressions.\n\nThe provided quick-fix removes `default` branches.\n\nExample:\n\n\n enum E { A, B }\n int foo(E e) {\n return switch (e) {\n case A -> 1;\n case B -> 2;\n default -> 3;\n };\n }\n\nAfter the quick-fix is applied:\n\n\n enum E { A, B }\n int foo(E e) {\n return switch (e) {\n case A -> 1;\n case B -> 2;\n };\n }\n\nUse the **Only report switch expressions** option to report only redundant `default` branches in switch expressions.\n\nInspection ID: UnnecessaryDefault" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryDefault", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticFieldReferenceOnSubclass", + "shortDescription": { + "text": "Static field referenced via subclass" + }, + "fullDescription": { + "text": "Reports accesses to static fields where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Child.foo);\n }' After the quick-fix is applied, the result looks like this: 'class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Parent.foo);\n }' Inspection ID: StaticFieldReferenceOnSubclass", + "markdown": "Reports accesses to static fields where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Child.foo);\n }\n\nAfter the quick-fix is applied, the result looks like this:\n\n\n class Parent {\n static int foo = 0;\n }\n\n class Child extends Parent { }\n\n void bar() {\n System.out.println(Parent.foo);\n }\n\nInspection ID: StaticFieldReferenceOnSubclass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticFieldReferencedViaSubclass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VolatileArrayField", + "shortDescription": { + "text": "Volatile array field" + }, + "fullDescription": { + "text": "Reports array fields that are declared 'volatile'. Such declarations may be confusing because accessing the array itself follows the rules for 'volatile' fields, but accessing the array's contents does not. Example: 'class Data {\n private volatile int[] idx = new int[0];\n }' If such volatile access is needed for array contents, consider using 'java.util.concurrent.atomic' classes instead: 'class Data {\n private final AtomicIntegerArray idx = new AtomicIntegerArray(new int[0]);\n }' Inspection ID: VolatileArrayField", + "markdown": "Reports array fields that are declared `volatile`. Such declarations may be confusing because accessing the array itself follows the rules for `volatile` fields, but accessing the array's contents does not.\n\n**Example:**\n\n\n class Data {\n private volatile int[] idx = new int[0];\n }\n\n\nIf such volatile access is needed for array contents, consider using\n`java.util.concurrent.atomic` classes instead:\n\n\n class Data {\n private final AtomicIntegerArray idx = new AtomicIntegerArray(new int[0]);\n }\n\nInspection ID: VolatileArrayField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "VolatileArrayField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryInheritDoc", + "shortDescription": { + "text": "Unnecessary '{@inheritDoc}' Javadoc comment" + }, + "fullDescription": { + "text": "Reports Javadoc comments that contain only an '{@inheritDoc}' tag. Since Javadoc copies the super class' comment if no comment is present, a comment containing only '{@inheritDoc}' adds nothing. Also, it reports the '{@inheritDoc}' usages in invalid locations, for example, in fields. Suggests removing the unnecessary Javadoc comment. Example: 'class Example implements Comparable {\n /**\n * {@inheritDoc}\n */\n @Override\n public int compareTo(Example o) {\n return 0;\n }\n }' After the quick-fix is applied: 'class Example implements Comparable {\n @Override\n public int compareTo(Example o) {\n return 0;\n }\n }' Inspection ID: UnnecessaryInheritDoc", + "markdown": "Reports Javadoc comments that contain only an `{@inheritDoc}` tag. Since Javadoc copies the super class' comment if no comment is present, a comment containing only `{@inheritDoc}` adds nothing.\n\nAlso, it reports the `{@inheritDoc}` usages in invalid locations, for example, in fields.\n\nSuggests removing the unnecessary Javadoc comment.\n\n**Example:**\n\n\n class Example implements Comparable {\n /**\n * {@inheritDoc}\n */\n @Override\n public int compareTo(Example o) {\n return 0;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example implements Comparable {\n @Override\n public int compareTo(Example o) {\n return 0;\n }\n }\n\n\nInspection ID: UnnecessaryInheritDoc" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryInheritDoc", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IgnoreResultOfCall", + "shortDescription": { + "text": "Result of method call ignored" + }, + "fullDescription": { + "text": "Reports method calls whose result is ignored. For many methods, ignoring the result is perfectly legitimate, but for some it is almost certainly an error. Examples of methods where ignoring the result is likely an error include 'java.io.inputStream.read()', which returns the number of bytes actually read, and any method on 'java.lang.String' or 'java.math.BigInteger'. These methods do not produce side-effects and thus pointless if their result is ignored. The calls to the following methods are inspected: Simple getters (which do nothing except return a field) Methods specified in the settings of this inspection Methods annotated with 'org.jetbrains.annotations.Contract(pure=true)' Methods annotated with .*.'CheckReturnValue' Methods in a class or package annotated with 'javax.annotation.CheckReturnValue' Optionally, all non-library methods Calls to methods annotated with Error Prone's or AssertJ's '@CanIgnoreReturnValue' annotation are not reported. Use the inspection settings to specify the classes to check. Methods are matched by name or name pattern using Java regular expression syntax. For classes, use fully-qualified names. Each entry applies to both the class and all its inheritors. Inspection ID: IgnoreResultOfCall", + "markdown": "Reports method calls whose result is ignored.\n\nFor many methods, ignoring the result is perfectly\nlegitimate, but for some it is almost certainly an error. Examples of methods where ignoring\nthe result is likely an error include `java.io.inputStream.read()`,\nwhich returns the number of bytes actually read, and any method on\n`java.lang.String` or `java.math.BigInteger`. These methods do not produce side-effects and thus pointless\nif their result is ignored.\n\nThe calls to the following methods are inspected:\n\n* Simple getters (which do nothing except return a field)\n* Methods specified in the settings of this inspection\n* Methods annotated with `org.jetbrains.annotations.Contract(pure=true)`\n* Methods annotated with .\\*.`CheckReturnValue`\n* Methods in a class or package annotated with `javax.annotation.CheckReturnValue`\n* Optionally, all non-library methods\n\nCalls to methods annotated with Error Prone's or AssertJ's `@CanIgnoreReturnValue` annotation are not reported.\n\n\nUse the inspection settings to specify the classes to check.\nMethods are matched by name or name pattern using Java regular expression syntax.\nFor classes, use fully-qualified names. Each entry applies to both the class and all its inheritors.\n\n\nInspection ID: IgnoreResultOfCall" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ResultOfMethodCallIgnored", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BlockingMethodInNonBlockingContext", + "shortDescription": { + "text": "Possibly blocking call in non-blocking context" + }, + "fullDescription": { + "text": "Reports thread-blocking method calls in code fragments where threads should not be blocked. Example (Project Reactor): 'Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n);' Consider running blocking code with a proper scheduler, for example 'Schedulers.boundedElastic()', or try to find an alternative non-blocking API. Example (Kotlin Coroutines): 'suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n}' Consider running blocking code with a special dispatcher, for example 'Dispatchers.IO', or try to find an alternative non-blocking API. Configure the inspection: In the Blocking Annotations list, specify annotations that mark thread-blocking methods. In the Non-Blocking Annotations list, specify annotations that mark non-blocking methods. Specified annotations can be used as External Annotations Inspection ID: BlockingMethodInNonBlockingContext", + "markdown": "Reports thread-blocking method calls in code fragments where threads should not be blocked.\n\n**Example (Project Reactor):**\n\n\n Flux.just(\"1\").flatMap(f -> {\n Flux just = loadUsersFromDatabase();\n just.toIterable(); // Error: blocking operator call in non-blocking scope\n return just;\n }\n );\n\nConsider running blocking code [with a proper\nscheduler](https://projectreactor.io/docs/core/release/reference/#faq.wrap-blocking), for example `Schedulers.boundedElastic()`, or try to find an alternative non-blocking API.\n\n**Example (Kotlin Coroutines):**\n\n\n suspend fun exampleFun() {\n Thread.sleep(100); // Error: blocking method call inside suspend function\n }\n\nConsider running blocking code [with a special dispatcher](https://kotlinlang.org/docs/coroutine-context-and-dispatchers.html),\nfor example `Dispatchers.IO`, or try to find an alternative non-blocking API.\n\nConfigure the inspection:\n\n* In the **Blocking Annotations** list, specify annotations that mark thread-blocking methods.\n* In the **Non-Blocking Annotations** list, specify annotations that mark non-blocking methods.\n\nSpecified annotations can be used as [External Annotations](https://www.jetbrains.com/help/idea/external-annotations.html)\n\nInspection ID: BlockingMethodInNonBlockingContext" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "BlockingMethodInNonBlockingContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParametersPerConstructor", + "shortDescription": { + "text": "Constructor with too many parameters" + }, + "fullDescription": { + "text": "Reports constructors whose number of parameters exceeds the specified maximum. Such objects are hard to instantiate, especially if some parameters are optional. Constructors with too many parameters may indicate that refactoring is necessary. Consider applying the builder pattern, for example. Example: 'public BankAccount(long accountNumber,\n String owner,\n double balance,\n double interestRate) {\n // fields initialization\n }' Configure the inspection: Use the Parameter limit field to specify the maximum allowed number of parameters in a constructor. Use the Ignore constructors with visibility list to specify whether the inspection should ignore constructors with specific visibility. Inspection ID: ParametersPerConstructor", + "markdown": "Reports constructors whose number of parameters exceeds the specified maximum. Such objects are hard to instantiate, especially if some parameters are optional. Constructors with too many parameters may indicate that refactoring is necessary. Consider applying the builder pattern, for example.\n\n**Example:**\n\n\n public BankAccount(long accountNumber,\n String owner,\n double balance,\n double interestRate) {\n // fields initialization\n }\n\nConfigure the inspection:\n\n* Use the **Parameter limit** field to specify the maximum allowed number of parameters in a constructor.\n* Use the **Ignore constructors with visibility** list to specify whether the inspection should ignore constructors with specific visibility.\n\nInspection ID: ParametersPerConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstructorWithTooManyParameters", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonReproducibleMathCall", + "shortDescription": { + "text": "Non-reproducible call to 'Math'" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.Math' methods, which results are not guaranteed to be reproduced precisely. In environments where reproducibility of results is required, 'java.lang.StrictMath' should be used instead. Inspection ID: NonReproducibleMathCall", + "markdown": "Reports calls to `java.lang.Math` methods, which results are not guaranteed to be reproduced precisely.\n\nIn environments where reproducibility of results is required, `java.lang.StrictMath`\nshould be used instead.\n\nInspection ID: NonReproducibleMathCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonReproducibleMathCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssertBetweenInconvertibleTypes", + "shortDescription": { + "text": "'assertEquals()' between objects of inconvertible types" + }, + "fullDescription": { + "text": "Reports calls to assertion methods where the \"expected\" and \"actual\" arguments are of incompatible types. Such calls often indicate that there is a bug in the test. This inspection checks the relevant JUnit, TestNG, and AssertJ methods. Examples: 'assertEquals(\"1\", 1);\n assertNotSame(new int[0], 0);\n\n // weak warning, may just test the equals() contract\n assertThat(foo).as(\"user type\").isNotEqualTo(bar);' Inspection ID: AssertBetweenInconvertibleTypes", + "markdown": "Reports calls to assertion methods where the \"expected\" and \"actual\" arguments are of incompatible types.\n\nSuch calls often indicate that there is a bug in the test.\nThis inspection checks the relevant JUnit, TestNG, and AssertJ methods.\n\n**Examples:**\n\n\n assertEquals(\"1\", 1);\n assertNotSame(new int[0], 0);\n\n // weak warning, may just test the equals() contract\n assertThat(foo).as(\"user type\").isNotEqualTo(bar);\n\nInspection ID: AssertBetweenInconvertibleTypes" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "AssertBetweenInconvertibleTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Test frameworks", + "index": 100, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MappingBeforeCount", + "shortDescription": { + "text": "Mapping call before count()" + }, + "fullDescription": { + "text": "Reports redundant 'Stream' API calls like 'map()', or 'boxed()' right before the 'count()' call. Such calls don't change the final count, so could be removed. It's possible that the code relies on a side effect from the lambda inside such a mapping call. However, relying on side effects inside the stream chain is extremely bad practice. There are no guarantees that the call will not be optimized out in future Java versions. Example: '// map() call is redundant\n long count = list.stream().filter(s -> !s.isEmpty()).map(s -> s.trim()).count();' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: MappingBeforeCount New in 2024.1", + "markdown": "Reports redundant `Stream` API calls like `map()`, or `boxed()` right before the `count()` call.\n\n\nSuch calls don't change the final count, so could be removed. It's possible that the code relies on\na side effect from the lambda inside such a mapping call. However, relying on side effects inside\nthe stream chain is extremely bad practice. There are no guarantees that the call will not be\noptimized out in future Java versions.\n\n**Example:**\n\n\n // map() call is redundant\n long count = list.stream().filter(s -> !s.isEmpty()).map(s -> s.trim()).count();\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: MappingBeforeCount\n\nNew in 2024.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MappingBeforeCount", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonExtendableApiUsage", + "shortDescription": { + "text": "Class, interface, or method should not be extended" + }, + "fullDescription": { + "text": "Reports classes, interfaces, and methods that extend, implement, or override API elements marked with '@ApiStatus.NonExtendable'. The '@ApiStatus.NonExtendable' annotation indicates that the class, interface, or method must not be extended, implemented, or overridden. Since casting such interfaces and classes to the internal library implementation is rather common, if a client provides a different implementation, you will get 'ClassCastException'. Adding new abstract methods to such classes and interfaces will break the compatibility with the client's implementations. Example: '// In upstream library code\n @ApiStatus.NonExtendable\n public interface MyService {\n public void perform();\n }\n\n // In downstream client code\n public class MyServiceImpl implements MyService {\n @Override\n public void perform() {\n // ...\n }\n }' This inspection also detects the following problems related to applying the annotation incorrectly: Annotating classes/methods that cannot be extended/overridden Redundantly annotating methods from a class already annotated with '@ApiStatus.NonExtendable' Inspection ID: NonExtendableApiUsage", + "markdown": "Reports classes, interfaces, and methods that extend, implement, or override API elements marked with `@ApiStatus.NonExtendable`.\n\n\nThe `@ApiStatus.NonExtendable` annotation indicates that the class, interface, or method **must not be extended,\nimplemented, or overridden** .\nSince casting such interfaces and classes to the internal library implementation is rather common,\nif a client provides a different implementation, you will get `ClassCastException`.\nAdding new abstract methods to such classes and interfaces will break the compatibility with the client's implementations.\n\n**Example:**\n\n\n // In upstream library code\n @ApiStatus.NonExtendable\n public interface MyService {\n public void perform();\n }\n\n // In downstream client code\n public class MyServiceImpl implements MyService {\n @Override\n public void perform() {\n // ...\n }\n }\n\nThis inspection also detects the following problems related to applying the annotation incorrectly:\n\n* Annotating classes/methods that cannot be extended/overridden\n* Redundantly annotating methods from a class already annotated with `@ApiStatus.NonExtendable`\n\nInspection ID: NonExtendableApiUsage" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NonExtendableApiUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwitchExpressionCanBePushedDown", + "shortDescription": { + "text": "Common subexpression can be extracted from 'switch'" + }, + "fullDescription": { + "text": "Reports switch expressions and statements where every branch has a common subexpression, and the 'switch' can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method. Example: 'switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }' After the quick-fix is applied: 'System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });' This inspection is applicable only for enhanced switches with arrow syntax. This inspection depends on the Java feature ''switch' expressions', which is available since Java 14. Inspection ID: SwitchExpressionCanBePushedDown New in 2022.3", + "markdown": "Reports switch expressions and statements where every branch has a common subexpression, and the `switch` can be moved inside. This action shortens the code. In many cases, it's reasonable to extract the resulting switch expression to a separate variable or method.\n\nExample:\n\n\n switch (value) {\n case 0 -> System.out.println(\"zero\");\n case 1 -> System.out.println(\"one\");\n case 2, 3, 4 -> System.out.println(\"few\");\n default -> System.out.println(\"many\");\n }\n\nAfter the quick-fix is applied:\n\n\n System.out.println(switch (value) {\n case 0 -> \"zero\";\n case 1 -> \"one\";\n case 2, 3, 4 -> \"few\";\n default -> \"many\";\n });\n\n\nThis inspection is applicable only for enhanced switches with arrow syntax.\n\nThis inspection depends on the Java feature ''switch' expressions', which is available since Java 14.\n\nInspection ID: SwitchExpressionCanBePushedDown\n\nNew in 2022.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SwitchExpressionCanBePushedDown", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnqualifiedFieldAccess", + "shortDescription": { + "text": "Instance field access not qualified with 'this'" + }, + "fullDescription": { + "text": "Reports field access operations that are not qualified with 'this' or some other qualifier. Some coding styles mandate that all field access operations are qualified to prevent confusion with local variable or parameter access. Example: 'class Foo {\n int foo;\n\n void bar() {\n foo += 1;\n }\n }' After the quick-fix is applied: 'class Foo {\n int foo;\n\n void bar() {\n this.foo += 1;\n }\n }' Inspection ID: UnqualifiedFieldAccess", + "markdown": "Reports field access operations that are not qualified with `this` or some other qualifier.\n\n\nSome coding styles mandate that all field access operations are qualified to prevent confusion with local\nvariable or parameter access.\n\n**Example:**\n\n\n class Foo {\n int foo;\n\n void bar() {\n foo += 1;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int foo;\n\n void bar() {\n this.foo += 1;\n }\n }\n\nInspection ID: UnqualifiedFieldAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnqualifiedFieldAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MismatchedCollectionQueryUpdate", + "shortDescription": { + "text": "Mismatched query and update of collection" + }, + "fullDescription": { + "text": "Reports collections whose contents are either queried and not updated, or updated and not queried. Such inconsistent queries and updates are pointless and may indicate either dead code or a typo. Use the inspection settings to specify name patterns that correspond to update/query methods. Query methods that return an element are automatically detected, and only those that write data to an output parameter (for example, an 'OutputStream') need to be specified. Example: Suppose you have your custom 'FixedStack' class with method 'store()': 'public class FixedStack extends Collection {\n public T store(T t) {\n // implementation\n }\n }' You can add 'store' to the update methods table in order to report mismatched queries like: 'void test(int i) {\n FixedStack stack = new FixedStack<>();\n stack.store(i);\n }' Inspection ID: MismatchedCollectionQueryUpdate", + "markdown": "Reports collections whose contents are either queried and not updated, or updated and not queried.\n\n\nSuch inconsistent queries and updates are pointless and may indicate\neither dead code or a typo.\n\n\nUse the inspection settings to specify name patterns that correspond to update/query methods.\nQuery methods that return an element are automatically detected, and only\nthose that write data to an output parameter (for example, an `OutputStream`) need to be specified.\n\n\n**Example:**\n\nSuppose you have your custom `FixedStack` class with method `store()`:\n\n\n public class FixedStack extends Collection {\n public T store(T t) {\n // implementation\n }\n }\n\nYou can add `store` to the update methods table in order to report mismatched queries like:\n\n\n void test(int i) {\n FixedStack stack = new FixedStack<>();\n stack.store(i);\n }\n\nInspection ID: MismatchedCollectionQueryUpdate" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MismatchedQueryAndUpdateOfCollection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CharacterComparison", + "shortDescription": { + "text": "Character comparison" + }, + "fullDescription": { + "text": "Reports ordinal comparisons of 'char' values. In an internationalized environment, such comparisons are rarely correct. Inspection ID: CharacterComparison", + "markdown": "Reports ordinal comparisons of `char` values. In an internationalized environment, such comparisons are rarely correct.\n\nInspection ID: CharacterComparison" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CharacterComparison", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InnerClassReferencedViaSubclass", + "shortDescription": { + "text": "Inner class referenced via subclass" + }, + "fullDescription": { + "text": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself. Java allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding. Example: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }' After the quick-fix is applied: 'class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }' Inspection ID: InnerClassReferencedViaSubclass", + "markdown": "Reports accesses of inner and nested classes where the call is qualified by a subclass of the declaring class, rather than the declaring class itself.\n\n\nJava allows such qualification, but such accesses may indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Sub.Inner s = new Sub.Inner(); // 'Inner' class is declared in 'Super' class, but referenced via 'Sub' class\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Super {\n static class Inner {}\n }\n\n class Sub extends Super {\n void test() {\n Super.Inner s = new Super.Inner();\n }\n }\n\nInspection ID: InnerClassReferencedViaSubclass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InnerClassReferencedViaSubclass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConfusingElse", + "shortDescription": { + "text": "Redundant 'else'" + }, + "fullDescription": { + "text": "Reports redundant 'else' keywords in 'if'—'else' statements and statement chains. The 'else' keyword is redundant when all previous branches end with a 'return', 'throw', 'break', or 'continue' statement. In this case, the statements from the 'else' branch can be placed after the 'if' statement, and the 'else' keyword can be removed. Example: 'if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }' After the quick-fix is applied: 'if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);' Disable the Report when there are no more statements after the 'if' statement option to ignore cases where the 'if'—'else' statement is the last statement in a code block. Inspection ID: ConfusingElse", + "markdown": "Reports redundant `else` keywords in `if`---`else` statements and statement chains.\n\n\nThe `else` keyword is redundant when all previous branches end with a\n`return`, `throw`, `break`, or `continue` statement. In this case,\nthe statements from the `else` branch can be placed after the `if` statement, and the\n`else` keyword can be removed.\n\n**Example:**\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n } else {\n System.out.println(name);\n }\n\nAfter the quick-fix is applied:\n\n\n if (name == null) {\n throw new IllegalArgumentException();\n }\n System.out.println(name);\n\nDisable the **Report when there are no more statements after the 'if' statement** option to ignore cases where the `if`---`else` statement is the last statement in a code block.\n\nInspection ID: ConfusingElse" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConfusingElseBranch", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SafeVarargsOnNonReifiableType", + "shortDescription": { + "text": "@SafeVarargs is not applicable to reifiable types" + }, + "fullDescription": { + "text": "Reports reifiable type of variable arity method annotated with '@SafeVarargs'. In this case, the annotation is redundant. Example: '@SafeVarargs\n public final void processStrings(String... strings) {\n }' This inspection depends on the Java feature 'Annotations', which is available since Java 5. Inspection ID: SafeVarargsOnNonReifiableType", + "markdown": "Reports reifiable type of variable arity method annotated with `@SafeVarargs`. In this case, the annotation is redundant.\n\n**Example:**\n\n\n @SafeVarargs\n public final void processStrings(String... strings) {\n }\n\nThis inspection depends on the Java feature 'Annotations', which is available since Java 5.\n\nInspection ID: SafeVarargsOnNonReifiableType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SafeVarargsOnNonReifiableType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ChannelResource", + "shortDescription": { + "text": "'Channel' opened but not safely closed" + }, + "fullDescription": { + "text": "Reports 'Channel' resources that are not safely closed, including any instances created by calling 'getChannel()' on a file or socket resource. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }' Use the following options to configure the inspection: Whether a 'Channel' resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a 'Channel' in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: ChannelResource", + "markdown": "Reports `Channel` resources that are not safely closed, including any instances created by calling `getChannel()` on a file or socket resource.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n void send(Socket socket) throws IOException {\n SocketChannel channel = socket.getChannel(); //warning\n channel.write(ByteBuffer.wrap(\"message\".getBytes()));\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a `Channel` resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a `Channel` in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: ChannelResource" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ChannelOpenedButNotSafelyClosed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Resource management", + "index": 47, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ScheduledThreadPoolExecutorWithZeroCoreThreads", + "shortDescription": { + "text": "'ScheduledThreadPoolExecutor' with zero core threads" + }, + "fullDescription": { + "text": "Reports any 'java.util.concurrent.ScheduledThreadPoolExecutor' instances in which 'corePoolSize' is set to zero via the 'setCorePoolSize' method or the object constructor. A 'ScheduledThreadPoolExecutor' with zero core threads will run nothing. Example: 'void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }' Inspection ID: ScheduledThreadPoolExecutorWithZeroCoreThreads", + "markdown": "Reports any `java.util.concurrent.ScheduledThreadPoolExecutor` instances in which `corePoolSize` is set to zero via the `setCorePoolSize` method or the object constructor.\n\n\nA `ScheduledThreadPoolExecutor` with zero core threads will run nothing.\n\n**Example:**\n\n\n void foo(int corePoolSize) {\n if (corePoolSize != 0) return;\n ThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(corePoolSize); // warning\n executor.setCorePoolSize(corePoolSize); // warning\n }\n\nInspection ID: ScheduledThreadPoolExecutorWithZeroCoreThreads" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ScheduledThreadPoolExecutorWithZeroCoreThreads", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SynchronizeOnThis", + "shortDescription": { + "text": "Synchronization on 'this'" + }, + "fullDescription": { + "text": "Reports synchronization on 'this' or 'class' expressions. The reported constructs include 'synchronized' blocks and calls to 'wait()', 'notify()' or 'notifyAll()'. There are several reasons synchronization on 'this' or 'class' expressions may be a bad idea: it makes synchronization a part of the external interface of the class, which makes a future change to a different locking mechanism difficult, it becomes hard to track just who is locking on a given object, it makes a denial-of-service attack possible, either on purpose or it can happen easily by accident when subclassing. As an alternative, consider synchronizing on a 'private final' lock object, access to which can be completely controlled. Example: 'public void print() {\n synchronized(this) { // warning: Lock operations on 'this' may have unforeseen side-effects\n System.out.println(\"synchronized\");\n }\n }' Inspection ID: SynchronizeOnThis", + "markdown": "Reports synchronization on `this` or `class` expressions. The reported constructs include `synchronized` blocks and calls to `wait()`, `notify()` or `notifyAll()`.\n\nThere are several reasons synchronization on `this` or `class` expressions may be a bad idea:\n\n1. it makes synchronization a part of the external interface of the class, which makes a future change to a different locking mechanism difficult,\n2. it becomes hard to track just who is locking on a given object,\n3. it makes a denial-of-service attack possible, either on purpose or it can happen easily by accident when subclassing.\n\nAs an alternative, consider synchronizing on a `private final` lock object, access to which can be completely controlled.\n\n**Example:**\n\n\n public void print() {\n synchronized(this) { // warning: Lock operations on 'this' may have unforeseen side-effects\n System.out.println(\"synchronized\");\n }\n }\n \nInspection ID: SynchronizeOnThis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SynchronizeOnThis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaEmptyModuleInfoFile", + "shortDescription": { + "text": "Empty 'module-info.java' file" + }, + "fullDescription": { + "text": "Reports an empty 'module-info.java' file, indicating unresolved module dependencies. Automatically adds necessary 'requires' statements by inspecting imports. To suppress this warning, you may write any comment inside the module statement body, like this: 'module module.name {\n // no dependencies\n}' Quick Fix: Fill in module dependencies fills in missing 'requires' based on source code imports. New in 2024.1 Inspection ID: JavaEmptyModuleInfoFile", + "markdown": "Reports an empty `module-info.java` file, indicating unresolved module dependencies. Automatically adds necessary `requires` statements by inspecting imports. To suppress this warning, you may write any comment inside the module statement body, like this:\n\n\n module module.name {\n // no dependencies\n }\n\n**Quick Fix:** *Fill in module dependencies* fills in missing `requires` based on source code imports. New in 2024.1\n\nInspection ID: JavaEmptyModuleInfoFile" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "JavaEmptyModuleInfoFile", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedAssignment", + "shortDescription": { + "text": "Unused assignment" + }, + "fullDescription": { + "text": "Reports assignment values that are not used after assignment. If the assignment value is unused, it's better to remove the assignment to shorten the code and avoid redundant allocations. The following cases are reported: variables that are never read after assignment variables that are always overwritten with a new value before being read variable initializers that are redundant (for one of the two reasons above) Configure the inspection: Use the Report redundant initializers option to report redundant initializers: 'int getI() {\n int i = 0; // redundant initialization\n i = 2;\n return i;\n }' Use the Report prefix expressions that can be replaced with binary expressions option to report cases where an '++i' expression may be replaced with 'i + 1': 'int preInc(int value) {\n int res = value;\n return ++res;\n }' Use the Report postfix expressions where the changed value is not used option to report 'i++' cases where the value of 'i' is not used later: 'int postInc(int value) {\n int res = value;\n return res++;\n }' Use the Report pattern variables whose values are never used option to report cases where the value of a pattern variable is overwritten before it is read: 'if (object instanceof String s) {\n s = \"hello\";\n System.out.println(s);\n }' Use the Report iteration parameters whose values are never used option to report cases where the value of an iteration parameter of an enhanced 'for' statements is overwritten before it is read: 'for (String arg : args) {\n arg = \"test\";\n System.out.println(arg);\n }' Inspection ID: UnusedAssignment", + "markdown": "Reports assignment values that are not used after assignment. If the assignment value is unused, it's better to remove the assignment to shorten the code and avoid redundant allocations.\n\nThe following cases are reported:\n\n* variables that are never read after assignment\n* variables that are always overwritten with a new value before being read\n* variable initializers that are redundant (for one of the two reasons above)\n\nConfigure the inspection:\n\n\nUse the **Report redundant initializers** option to report redundant initializers:\n\n\n int getI() {\n int i = 0; // redundant initialization\n i = 2;\n return i;\n }\n\n\nUse the **Report prefix expressions that can be replaced with binary expressions** option to report cases\nwhere an `++i` expression may be replaced with `i + 1`:\n\n\n int preInc(int value) {\n int res = value;\n return ++res;\n }\n\n\nUse the **Report postfix expressions where the changed value is not used** option to report `i++` cases\nwhere the value of `i` is not used later:\n\n\n int postInc(int value) {\n int res = value;\n return res++;\n }\n\n\nUse the **Report pattern variables whose values are never used** option to report cases where the value of a pattern variable\nis overwritten before it is read:\n\n\n if (object instanceof String s) {\n s = \"hello\";\n System.out.println(s);\n }\n\n\nUse the **Report iteration parameters whose values are never used** option to report cases where the value of an iteration parameter\nof an enhanced `for` statements is overwritten before it is read:\n\n\n for (String arg : args) {\n arg = \"test\";\n System.out.println(arg);\n }\n\nInspection ID: UnusedAssignment" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HashCodeUsesNonFinalVariable", + "shortDescription": { + "text": "Non-final field referenced in 'hashCode()'" + }, + "fullDescription": { + "text": "Reports implementations of 'hashCode()' that access non-'final' variables. Such access may result in 'hashCode()' returning different values at different points in the object's lifecycle, which may in turn cause problems when using the standard collections classes. Example: 'class Drink {\n String name;\n Drink(String name) { this.name = name; }\n @Override public int hashCode() {\n return Objects.hash(name); //warning\n }\n }\n ...\n Drink coffee = new Drink(\"Coffee\");\n priceMap.put(coffee, 10.0);\n coffee.name = \"Tea\";\n double coffeePrice = priceMap.get(coffee); //not found' A quick-fix is suggested to make the field final: 'class Drink {\n final String name;\n ...\n }' Inspection ID: HashCodeUsesNonFinalVariable", + "markdown": "Reports implementations of `hashCode()` that access non-`final` variables.\n\n\nSuch access may result in `hashCode()`\nreturning different values at different points in the object's lifecycle, which may in turn cause problems when\nusing the standard collections classes.\n\n**Example:**\n\n\n class Drink {\n String name;\n Drink(String name) { this.name = name; }\n @Override public int hashCode() {\n return Objects.hash(name); //warning\n }\n }\n ...\n Drink coffee = new Drink(\"Coffee\");\n priceMap.put(coffee, 10.0);\n coffee.name = \"Tea\";\n double coffeePrice = priceMap.get(coffee); //not found\n\nA quick-fix is suggested to make the field final:\n\n\n class Drink {\n final String name;\n ...\n }\n\nInspection ID: HashCodeUsesNonFinalVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonFinalFieldReferencedInHashCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaModuleDefinition", + "shortDescription": { + "text": "Java module definition problems" + }, + "fullDescription": { + "text": "Reports miscellaneous problems with the module-info.java file. For example, it reports a service which is provided but not exported or used. Example: 'module myModule {\n // Service is provided but its containing package is not exported\n provides com.example.MyService with com.example.MyServiceImpl;\n}' Inspection ID: JavaModuleDefinition", + "markdown": "Reports miscellaneous problems with the module-info.java file. For example, it reports a service which is provided but not exported or used.\n\n**Example:**\n\n\n module myModule {\n // Service is provided but its containing package is not exported\n provides com.example.MyService with com.example.MyServiceImpl;\n }\n\nInspection ID: JavaModuleDefinition" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JavaModuleDefinition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ProtectedField", + "shortDescription": { + "text": "Protected field" + }, + "fullDescription": { + "text": "Reports 'protected' fields. Constants (that is, variables marked 'static' or 'final') are not reported. Example: 'public class A {\n protected Object object; // warning\n protected final static int MODE = 0; // constant, no warning\n }' Inspection ID: ProtectedField", + "markdown": "Reports `protected` fields.\n\nConstants (that is, variables marked `static` or `final`) are not reported.\n\n**Example:**\n\n\n public class A {\n protected Object object; // warning\n protected final static int MODE = 0; // constant, no warning\n }\n\nInspection ID: ProtectedField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ProtectedField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Encapsulation", + "index": 59, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentUsedAsCondition", + "shortDescription": { + "text": "Assignment used as condition" + }, + "fullDescription": { + "text": "Reports assignments that are used as a condition of an 'if', 'while', 'for', or 'do' statement, or a conditional expression. Although occasionally intended, this usage is confusing and may indicate a typo, for example, '=' instead of '=='. The quick-fix replaces '=' with '=='. Example: 'void update(String str, boolean empty) {\n // Warning: 'empty' is reassigned,\n // not compared to str.isEmpty()\n if (empty = str.isEmpty()) {\n ...\n }\n }' After the quick-fix is applied: 'void update(String str, boolean empty) {\n if (empty == str.isEmpty()) {\n ...\n }\n }' Inspection ID: AssignmentUsedAsCondition", + "markdown": "Reports assignments that are used as a condition of an `if`, `while`, `for`, or `do` statement, or a conditional expression.\n\nAlthough occasionally intended, this usage is confusing and may indicate a typo, for example, `=` instead of `==`.\n\nThe quick-fix replaces `=` with `==`.\n\n**Example:**\n\n\n void update(String str, boolean empty) {\n // Warning: 'empty' is reassigned,\n // not compared to str.isEmpty()\n if (empty = str.isEmpty()) {\n ...\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void update(String str, boolean empty) {\n if (empty == str.isEmpty()) {\n ...\n }\n }\n\nInspection ID: AssignmentUsedAsCondition" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentUsedAsCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InstanceofThis", + "shortDescription": { + "text": "'instanceof' check for 'this'" + }, + "fullDescription": { + "text": "Reports usages of 'instanceof' or 'getClass() == SomeClass.class' in which a 'this' expression is checked. Such expressions indicate a failure of the object-oriented design, and should be replaced by polymorphic constructions. Example: 'class Super {\n void process() {\n if (this instanceof Sub) { // warning\n doSomething();\n } else {\n doSomethingElse();\n }\n }\n}\n \nclass Sub extends Super {}' To fix the problem, use an overriding method: 'class Super {\n void process() {\n doSomethingElse();\n }\n}\n \nclass Sub extends Super {\n @Override\n void process() {\n doSomething();\n }\n}' Inspection ID: InstanceofThis", + "markdown": "Reports usages of `instanceof` or `getClass() == SomeClass.class` in which a `this` expression is checked.\n\nSuch expressions indicate a failure of the object-oriented design, and should be replaced by\npolymorphic constructions.\n\nExample:\n\n\n class Super {\n void process() {\n if (this instanceof Sub) { // warning\n doSomething();\n } else {\n doSomethingElse();\n }\n }\n }\n \n class Sub extends Super {}\n\nTo fix the problem, use an overriding method:\n\n\n class Super {\n void process() {\n doSomethingElse();\n }\n }\n \n class Sub extends Super {\n @Override\n void process() {\n doSomething();\n }\n } \n\nInspection ID: InstanceofThis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InstanceofThis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassMayBeInterface", + "shortDescription": { + "text": "Abstract 'class' may be 'interface'" + }, + "fullDescription": { + "text": "Reports 'abstract' classes that can be converted to interfaces. Using interfaces instead of classes is preferable as Java doesn't support multiple class inheritance, while a class can implement multiple interfaces. A class may be converted to an interface if it has no superclasses (other than Object), has only 'public static final' fields, 'public abstract' methods, and 'public' inner classes. Example: 'abstract class Example {\n public static final int MY_CONST = 42;\n public abstract void foo();\n}\n\nclass Inheritor extends Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n}' After the quick-fix is applied: 'interface Example {\n int MY_CONST = 42;\n void foo();\n}\n\nclass Inheritor implements Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n}' Configure the inspection: Use the Report classes containing non-abstract methods when using Java 8 option to report only the classes with 'static' methods and non-abstract methods that can be converted to 'default' methods (only applicable to language level of 8 or higher). Inspection ID: ClassMayBeInterface", + "markdown": "Reports `abstract` classes that can be converted to interfaces.\n\nUsing interfaces instead of classes is preferable as Java doesn't support multiple class inheritance,\nwhile a class can implement multiple interfaces.\n\nA class may be converted to an interface if it has no superclasses (other\nthan Object), has only `public static final` fields,\n`public abstract` methods, and `public` inner classes.\n\n\nExample:\n\n\n abstract class Example {\n public static final int MY_CONST = 42;\n public abstract void foo();\n }\n\n class Inheritor extends Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n interface Example {\n int MY_CONST = 42;\n void foo();\n }\n\n class Inheritor implements Example {\n @Override\n public void foo() {\n System.out.println(MY_CONST);\n }\n }\n\nConfigure the inspection:\n\n\nUse the **Report classes containing non-abstract methods when using Java 8** option to report only the classes with `static` methods and non-abstract methods that can be converted to\n`default` methods (only applicable to language level of 8 or higher).\n\n\nInspection ID: ClassMayBeInterface" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ClassMayBeInterface", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageInMultipleModules", + "shortDescription": { + "text": "Package with classes in multiple modules" + }, + "fullDescription": { + "text": "Reports non-empty packages that are present in several modules. When packages are contained in several modules, it is very easy to create a class with the same name in two modules. A module which depends on these modules will see a conflict if it tries to use such a class. The Java Platform Module System disallows packages contained in more than one module (also called split packages) Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: PackageInMultipleModules", + "markdown": "Reports non-empty packages that are present in several modules. When packages are contained in several modules, it is very easy to create a class with the same name in two modules. A module which depends on these modules will see a conflict if it tries to use such a class. The Java Platform Module System disallows packages contained in more than one module (also called *split packages* )\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: PackageInMultipleModules" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PackageInMultipleModules", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Packaging issues", + "index": 38, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryCallToStringValueOf", + "shortDescription": { + "text": "Unnecessary conversion to 'String'" + }, + "fullDescription": { + "text": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. 'String.valueOf()' or 'Integer.toString()'. Such calls are unnecessary when used in string concatenations. Example: 'System.out.println(\"Number: \" + Integer.toString(count));' After the quick-fix is applied: 'System.out.println(\"Number: \" + count);' Additionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are: Classes 'java.io.PrintWriter', 'java.io.PrintStream' 'print()', 'println()' Classes 'java.lang.StringBuilder', 'java.lang.StringBuffer' 'append()' Class 'org.slf4j.Logger' 'trace()', 'debug()', 'info()', 'warn()', 'error()' Use the Report calls that can be replaced with a concatenation with the empty string option to also report cases where concatenations with the empty string can be used instead of a call to 'String.valueOf()'. Inspection ID: UnnecessaryCallToStringValueOf", + "markdown": "Reports unnecessary calls to static methods that convert their parameters to a string, e.g. `String.valueOf()` or `Integer.toString()`. Such calls are unnecessary when used in string concatenations.\n\nExample:\n\n\n System.out.println(\"Number: \" + Integer.toString(count));\n\nAfter the quick-fix is applied:\n\n\n System.out.println(\"Number: \" + count);\n\nAdditionally such calls are unnecessary when used as arguments to library methods that do their own string conversion. Some examples of library methods that do their own string conversion are:\n\n* Classes `java.io.PrintWriter`, `java.io.PrintStream`\n * `print()`, `println()`\n* Classes `java.lang.StringBuilder`, `java.lang.StringBuffer`\n * `append()`\n* Class `org.slf4j.Logger`\n * `trace()`, `debug()`, `info()`, `warn()`, `error()`\n\n\nUse the **Report calls that can be replaced with a concatenation with the empty string**\noption to also report cases where concatenations with the empty string can be used instead of a call to `String.valueOf()`.\n\nInspection ID: UnnecessaryCallToStringValueOf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryCallToStringValueOf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FloatingPointEquality", + "shortDescription": { + "text": "Floating-point equality comparison" + }, + "fullDescription": { + "text": "Reports floating-point values that are being compared using the '==' or '!=' operator. Floating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics. This inspection ignores comparisons with zero and infinity literals. Example: 'void m(double d1, double d2) {\n if (d1 == d2) {}\n }' Inspection ID: FloatingPointEquality", + "markdown": "Reports floating-point values that are being compared using the `==` or `!=` operator.\n\nFloating-point values are inherently inaccurate, and comparing them for exact equality is seldom the desired semantics.\n\nThis inspection ignores comparisons with zero and infinity literals.\n\n**Example:**\n\n\n void m(double d1, double d2) {\n if (d1 == d2) {}\n }\n\nInspection ID: FloatingPointEquality" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FloatingPointEquality", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringReplaceableByStringBuffer", + "shortDescription": { + "text": "Non-constant 'String' can be replaced with 'StringBuilder'" + }, + "fullDescription": { + "text": "Reports variables declared as 'java.lang.String' that are repeatedly appended to. Such variables could be declared more efficiently as 'java.lang.StringBuffer' or 'java.lang.StringBuilder'. Example: 'String s = \"\";\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s = s + name;\n }' Such a loop can be replaced with: 'StringBuilder s = new StringBuilder();\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s.append(name);\n }' Or even with: 'String s = String.join(\" \", names);' Use the option to make this inspection only report when the variable is appended to in a loop. Inspection ID: StringReplaceableByStringBuffer", + "markdown": "Reports variables declared as `java.lang.String` that are repeatedly appended to. Such variables could be declared more efficiently as `java.lang.StringBuffer` or `java.lang.StringBuilder`.\n\n**Example:**\n\n\n String s = \"\";\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s = s + name;\n }\n\nSuch a loop can be replaced with:\n\n\n StringBuilder s = new StringBuilder();\n for (int i = 0; i < names.length; i++) {\n String name = names[i] + (i == names.length - 1 ? \"\" : \" \");\n s.append(name);\n }\n\nOr even with:\n\n\n String s = String.join(\" \", names);\n\n\nUse the option to make this inspection only report when the variable is appended to in a loop.\n\nInspection ID: StringReplaceableByStringBuffer" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonConstantStringShouldBeStringBuffer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SequencedCollectionMethodCanBeUsed", + "shortDescription": { + "text": "SequencedCollection method can be used" + }, + "fullDescription": { + "text": "Reports collection API method calls that can be simplified using 'SequencedCollection' methods. The following conversions are supported: 'list.add(0, element)' → 'list.addFirst(element);' 'list.get(0)' → 'list.getFirst();' 'list.get(list.size() - 1)' → 'list.getLast();' 'list.remove(0)' → 'list.removeFirst();' 'list.remove(list.size() - 1)' → 'list.removeLast();' 'collection.iterator().next()' → 'collection.getFirst();' This inspection depends on the Java feature 'Sequenced Collections', which is available since Java 21. Inspection ID: SequencedCollectionMethodCanBeUsed New in 2023.3", + "markdown": "Reports collection API method calls that can be simplified using `SequencedCollection` methods.\n\nThe following conversions are supported:\n\n* `list.add(0, element)` → `list.addFirst(element);`\n* `list.get(0)` → `list.getFirst();`\n* `list.get(list.size() - 1)` → `list.getLast();`\n* `list.remove(0)` → `list.removeFirst();`\n* `list.remove(list.size() - 1)` → `list.removeLast();`\n* `collection.iterator().next()` → `collection.getFirst();`\n\nThis inspection depends on the Java feature 'Sequenced Collections', which is available since Java 21.\n\nInspection ID: SequencedCollectionMethodCanBeUsed\n\nNew in 2023.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SequencedCollectionMethodCanBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 21", + "index": 77, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicField", + "shortDescription": { + "text": "'public' field" + }, + "fullDescription": { + "text": "Reports 'public' fields. Constants (fields marked with 'static' and 'final') are not reported. Example: 'class Main {\n public String name;\n }' After the quick-fix is applied: 'class Main {\n private String name;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n }' Configure the inspection: Use the Ignore If Annotated By list to specify annotations to ignore. The inspection will ignore fields with any of these annotations. Use the Ignore 'public final' fields of an enum option to ignore 'public final' fields of the 'enum' type. Inspection ID: PublicField", + "markdown": "Reports `public` fields. Constants (fields marked with `static` and `final`) are not reported.\n\n**Example:**\n\n\n class Main {\n public String name;\n }\n\nAfter the quick-fix is applied:\n\n\n class Main {\n private String name;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n }\n\nConfigure the inspection:\n\n* Use the **Ignore If Annotated By** list to specify annotations to ignore. The inspection will ignore fields with any of these annotations.\n* Use the **Ignore 'public final' fields of an enum** option to ignore `public final` fields of the `enum` type.\n\nInspection ID: PublicField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "PublicField", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Encapsulation", + "index": 59, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FinallyBlockCannotCompleteNormally", + "shortDescription": { + "text": "'finally' block which can not complete normally" + }, + "fullDescription": { + "text": "Reports 'return', 'throw', 'break', 'continue', and 'yield' statements that are used inside 'finally' blocks. These cause the 'finally' block to not complete normally but to complete abruptly. Any exceptions thrown from the 'try' and 'catch' blocks of the same 'try'-'catch' statement will be suppressed. Example: 'void x() {\n try {\n throw new RuntimeException();\n } finally {\n // if bar() returns true, the RuntimeException will be suppressed\n if (bar()) return;\n }\n }' Inspection ID: FinallyBlockCannotCompleteNormally", + "markdown": "Reports `return`, `throw`, `break`, `continue`, and `yield` statements that are used inside `finally` blocks. These cause the `finally` block to not complete normally but to complete abruptly. Any exceptions thrown from the `try` and `catch` blocks of the same `try`-`catch` statement will be suppressed.\n\n**Example:**\n\n\n void x() {\n try {\n throw new RuntimeException();\n } finally {\n // if bar() returns true, the RuntimeException will be suppressed\n if (bar()) return;\n }\n }\n\nInspection ID: FinallyBlockCannotCompleteNormally" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "finally", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantOnWrongSideOfComparison", + "shortDescription": { + "text": "Constant on wrong side of comparison" + }, + "fullDescription": { + "text": "Reports comparison operations where the constant value is on the wrong side. Some coding conventions specify that constants should be on a specific side of a comparison, either left or right. Example: 'boolean compare(int x) {\n return 1 > x; // Constant '1' on the left side of the comparison\n }' After the quick-fix is applied: 'boolean compare(int x) {\n return x < 1;\n }' Use the inspection settings to choose the side of constants in comparisons and whether to warn if 'null' literals are on the wrong side. Inspection ID: ConstantOnWrongSideOfComparison New in 2019.2", + "markdown": "Reports comparison operations where the constant value is on the wrong side.\n\nSome coding conventions specify that constants should be on a specific side of a comparison, either left or right.\n\n**Example:**\n\n\n boolean compare(int x) {\n return 1 > x; // Constant '1' on the left side of the comparison\n }\n\nAfter the quick-fix is applied:\n\n\n boolean compare(int x) {\n return x < 1;\n }\n\n\nUse the inspection settings to choose the side of constants in comparisons\nand whether to warn if `null` literals are on the wrong side.\n\nInspection ID: ConstantOnWrongSideOfComparison\n\nNew in 2019.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantOnWrongSideOfComparison", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerialAnnotationUsedOnWrongMember", + "shortDescription": { + "text": "'@Serial' annotation used on wrong member" + }, + "fullDescription": { + "text": "Reports methods and fields in the 'Serializable' and 'Externalizable' classes that are not suitable to be annotated with the 'java.io.Serial' annotation. Examples: 'class Test implements Serializable {\n @Serial // The annotated field is not a part of serialization mechanism because it's not final\n private static long serialVersionUID = 7874493593505141603L;\n\n @Serial // The annotated method is not a part of the serialization mechanism because it's not private\n void writeObject(ObjectOutputStream out) throws IOException {\n }\n}' 'class Test implements Externalizable {\n @Serial // The annotated method is not a part of the serialization mechanism as it's inside Externalizable class\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n}' For information about all valid cases, refer to the Javadoc of the 'java.io.Serial' class. This inspection depends on the Java feature '@Serial annotation', which is available since Java 14. Inspection ID: SerialAnnotationUsedOnWrongMember New in 2020.3", + "markdown": "Reports methods and fields in the `Serializable` and `Externalizable` classes that are not suitable to be annotated with the `java.io.Serial` annotation.\n\n**Examples:**\n\n\n class Test implements Serializable {\n @Serial // The annotated field is not a part of serialization mechanism because it's not final\n private static long serialVersionUID = 7874493593505141603L;\n\n @Serial // The annotated method is not a part of the serialization mechanism because it's not private\n void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\n\n class Test implements Externalizable {\n @Serial // The annotated method is not a part of the serialization mechanism as it's inside Externalizable class\n private void writeObject(ObjectOutputStream out) throws IOException {\n }\n }\n\nFor information about all valid cases, refer to the Javadoc of the `java.io.Serial` class.\n\nThis inspection depends on the Java feature '@Serial annotation', which is available since Java 14.\n\nInspection ID: SerialAnnotationUsedOnWrongMember\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "serial", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessarilyQualifiedStaticallyImportedElement", + "shortDescription": { + "text": "Unnecessarily qualified statically imported element" + }, + "fullDescription": { + "text": "Reports usage of statically imported members qualified with their containing class name. Such qualification is unnecessary and can be removed because statically imported members can be accessed directly by member name. Example: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }' After the quick-fix is applied: 'import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }' Inspection ID: UnnecessarilyQualifiedStaticallyImportedElement", + "markdown": "Reports usage of statically imported members qualified with their containing class name.\n\nSuch qualification is unnecessary and can be removed\nbecause statically imported members can be accessed directly by member name.\n\n**Example:**\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(Test.WIDTH);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import static foo.Test.WIDTH;\n\n class Bar {\n void bar() {\n System.out.println(WIDTH);\n }\n }\n\nInspection ID: UnnecessarilyQualifiedStaticallyImportedElement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessarilyQualifiedStaticallyImportedElement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObjectToString", + "shortDescription": { + "text": "Call to default 'toString()'" + }, + "fullDescription": { + "text": "Reports calls to 'toString()' that use the default implementation from 'java.lang.Object'. The default implementation is rarely intended but may be used by accident. Calls to 'toString()' on objects with 'java.lang.Object', interface or abstract class type are ignored by this inspection. Example: 'class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }' Inspection ID: ObjectToString", + "markdown": "Reports calls to `toString()` that use the default implementation from `java.lang.Object`.\n\nThe default implementation is rarely intended but may be used by accident.\n\n\nCalls to `toString()` on objects with `java.lang.Object`,\ninterface or abstract class type are ignored by this inspection.\n\n**Example:**\n\n\n class Bar {\n void foo1(Bar bar) {\n String s = bar.toString(); // warning\n /* ... */\n }\n\n void foo2(Object obj) {\n String s = obj.toString(); // no warning here\n /* ... */\n }\n }\n\nInspection ID: ObjectToString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ObjectToString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfJDBCDriverClass", + "shortDescription": { + "text": "Use of concrete JDBC driver class" + }, + "fullDescription": { + "text": "Reports uses of specific JDBC driver classes. Use of such classes will bind your project to a specific database and driver, defeating the purpose of JDBC and resulting in loss of portability. Example: 'import java.sql.Driver;\n\n abstract class Sample implements Driver {\n public void foo() {\n Sample sample;\n }\n }' Inspection ID: UseOfJDBCDriverClass", + "markdown": "Reports uses of specific JDBC driver classes. Use of such classes will bind your project to a specific database and driver, defeating the purpose of JDBC and resulting in loss of portability.\n\n**Example:**\n\n\n import java.sql.Driver;\n\n abstract class Sample implements Driver {\n public void foo() {\n Sample sample;\n }\n }\n\nInspection ID: UseOfJDBCDriverClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfJDBCDriverClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThrowsRuntimeException", + "shortDescription": { + "text": "Unchecked exception declared in 'throws' clause" + }, + "fullDescription": { + "text": "Reports declaration of an unchecked exception ('java.lang.RuntimeException' or one of its subclasses) in the 'throws' clause of a method. Declarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc '@throws' tag. Example: 'public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }' Inspection ID: ThrowsRuntimeException", + "markdown": "Reports declaration of an unchecked exception (`java.lang.RuntimeException` or one of its subclasses) in the `throws` clause of a method.\n\nDeclarations of unchecked exceptions are not required and may be deleted or moved to a Javadoc `@throws` tag.\n\n**Example:**\n\n\n public class InvalidDataException extends RuntimeException {}\n\n class TextEditor {\n void readSettings() throws InvalidDataException {} // warning: Unchecked exception 'InvalidDataException' declared in 'throws' clause\n }\n\nInspection ID: ThrowsRuntimeException" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ThrowsRuntimeException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JDBCResource", + "shortDescription": { + "text": "JDBC resource opened but not safely closed" + }, + "fullDescription": { + "text": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include 'java.sql.Connection', 'java.sql.Statement', 'java.sql.PreparedStatement', 'java.sql.CallableStatement', and 'java.sql.ResultSet'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }' Use the following options to configure the inspection: Whether a JDBC resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: JDBCResource", + "markdown": "Reports JDBC resources that are not safely closed. JDBC resources reported by this inspection include `java.sql.Connection`, `java.sql.Statement`, `java.sql.PreparedStatement`, `java.sql.CallableStatement`, and `java.sql.ResultSet`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n ResultSet findAllElements(Connection connection) throws SQLException {\n PreparedStatement statement = connection.prepareStatement(\"SELECT * FROM TABLE\");//statement is not closed\n statement.execute();\n return statement.getResultSet();\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a JDBC resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: JDBCResource" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JDBCResourceOpenedButNotSafelyClosed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Resource management", + "index": 47, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JNDIResource", + "shortDescription": { + "text": "JNDI resource opened but not safely closed" + }, + "fullDescription": { + "text": "Reports JNDI resources that are not safely closed. JNDI resources reported by this inspection include 'javax.naming.InitialContext', and 'javax.naming.NamingEnumeration'. By default, the inspection assumes that the resources can be closed by any method with 'close' or 'cleanup' in its name. Example: 'Object findObject(Properties properties, String name) throws NamingException {\n Context context = new InitialContext(properties); //context is not closed\n return context.lookup(name);\n }' Use the following options to configure the inspection: Whether a JNDI Resource is allowed to be opened inside a 'try' block. This style is less desirable because it is more verbose than opening a resource in front of a 'try' block. Whether the resource can be closed by any method call with the resource passed as argument. Inspection ID: JNDIResource", + "markdown": "Reports JNDI resources that are not safely closed. JNDI resources reported by this inspection include `javax.naming.InitialContext`, and `javax.naming.NamingEnumeration`.\n\n\nBy default, the inspection assumes that the resources can be closed by any method with\n'close' or 'cleanup' in its name.\n\n**Example:**\n\n\n Object findObject(Properties properties, String name) throws NamingException {\n Context context = new InitialContext(properties); //context is not closed\n return context.lookup(name);\n }\n\n\nUse the following options to configure the inspection:\n\n* Whether a JNDI Resource is allowed to be opened inside a `try` block. This style is less desirable because it is more verbose than opening a resource in front of a `try` block.\n* Whether the resource can be closed by any method call with the resource passed as argument.\n\nInspection ID: JNDIResource" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JNDIResourceOpenedButNotSafelyClosed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Resource management", + "index": 47, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NewObjectEquality", + "shortDescription": { + "text": "New object is compared using '=='" + }, + "fullDescription": { + "text": "Reports code that applies '==' or '!=' to a newly allocated object instead of calling 'equals()'. The references to newly allocated objects cannot point at existing objects, thus the comparison will always evaluate to 'false'. The inspection may also report newly created objects returned from simple methods. Example: 'void test(Object obj) {\n if (new Object() == obj) {...}\n }' After the quick-fix is applied: 'void test(Object obj) {\n if (new Object().equals(obj)) {...}\n }' New in 2018.3 Inspection ID: NewObjectEquality", + "markdown": "Reports code that applies `==` or `!=` to a newly allocated object instead of calling `equals()`.\n\n\nThe references to newly allocated objects cannot point at existing objects,\nthus the comparison will always evaluate to `false`. The inspection may also report newly\ncreated objects returned from simple methods.\n\n**Example:**\n\n\n void test(Object obj) {\n if (new Object() == obj) {...}\n }\n\nAfter the quick-fix is applied:\n\n\n void test(Object obj) {\n if (new Object().equals(obj)) {...}\n }\n\n\nNew in 2018.3\n\nInspection ID: NewObjectEquality" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "NewObjectEquality", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoggingSimilarMessage", + "shortDescription": { + "text": "Non-distinguishable logging calls" + }, + "fullDescription": { + "text": "Reports SLF4J, Log4j2 logging calls in one class, such as 'logger.info(\"message: {}\", key)' with similar log messages. These calls can be non-distinguishable from each other, and this introduces difficulties to understand where a certain log message is coming from. Example (for Java): 'private static void request1(String text) {\n log.info(\"Message: {}\", text); //similar call\n doSomething1();\n }\n\n private static void request2(int i) {\n log.info(\"Message: {}\", i); //similar call\n doSomething2();\n }' Use the Minimum length of a similar sequence option to set the minimum length of similar sequences after which calls will be reported Use the Do not report calls with the 'error' log level option to ignore messages with `error` log level and when there is an exception. It may be useful to hide the warnings, because call sites can still be located using stack traces Inspection ID: LoggingSimilarMessage New in 2024.1", + "markdown": "Reports SLF4J, Log4j2 logging calls in one class, such as `logger.info(\"message: {}\", key)` with similar log messages. These calls can be non-distinguishable from each other, and this introduces difficulties to understand where a certain log message is coming from.\n\n**Example (for Java):**\n\n\n private static void request1(String text) {\n log.info(\"Message: {}\", text); //similar call\n doSomething1();\n }\n\n private static void request2(int i) {\n log.info(\"Message: {}\", i); //similar call\n doSomething2();\n }\n\n* Use the **Minimum length of a similar sequence** option to set the minimum length of similar sequences after which calls will be reported\n* Use the **Do not report calls with the 'error' log level** option to ignore messages with \\`error\\` log level and when there is an exception. It may be useful to hide the warnings, because call sites can still be located using stack traces\n\nInspection ID: LoggingSimilarMessage\n\nNew in 2024.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "LoggingSimilarMessage", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Logging", + "index": 46, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TryWithIdenticalCatches", + "shortDescription": { + "text": "Identical 'catch' branches in 'try' statement" + }, + "fullDescription": { + "text": "Reports identical 'catch' sections in a single 'try' statement. Collapsing such sections into one multi-catch block reduces code duplication and prevents the situations when one 'catch' section is updated, and another one is not. Example: 'try {\n doSmth();\n }\n catch (IOException e) {\n LOG.error(e);\n }\n catch (URISyntaxException e) {\n LOG.error(e);\n }' A quick-fix is available to make the code more compact: 'try {\n doSmth();\n }\n catch (IOException | URISyntaxException e) {\n LOG.error(e);\n }' This inspection depends on the Java feature 'Multi-catches', which is available since Java 7. Inspection ID: TryWithIdenticalCatches", + "markdown": "Reports identical `catch` sections in a single `try` statement.\n\nCollapsing such sections into one *multi-catch* block reduces code duplication and prevents\nthe situations when one `catch` section is updated, and another one is not.\n\n**Example:**\n\n\n try {\n doSmth();\n }\n catch (IOException e) {\n LOG.error(e);\n }\n catch (URISyntaxException e) {\n LOG.error(e);\n }\n\nA quick-fix is available to make the code more compact:\n\n\n try {\n doSmth();\n }\n catch (IOException | URISyntaxException e) {\n LOG.error(e);\n }\n\nThis inspection depends on the Java feature 'Multi-catches', which is available since Java 7.\n\nInspection ID: TryWithIdenticalCatches" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TryWithIdenticalCatches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 7", + "index": 118, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LambdaCanBeReplacedWithAnonymous", + "shortDescription": { + "text": "Lambda can be replaced with anonymous class" + }, + "fullDescription": { + "text": "Reports lambda expressions that can be replaced with anonymous classes. Expanding lambda expressions to anonymous classes may be useful if you need to implement other methods inside an anonymous class. Example: 's -> System.out.println(s)' After the quick-fix is applied: 'new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n}' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: LambdaCanBeReplacedWithAnonymous", + "markdown": "Reports lambda expressions that can be replaced with anonymous classes.\n\n\nExpanding lambda expressions to anonymous classes may be useful if you need to implement other\nmethods inside an anonymous class.\n\nExample:\n\n\n s -> System.out.println(s)\n\nAfter the quick-fix is applied:\n\n new Consumer() {\n @Override\n public void accept(String s) {\n System.out.println(s);\n }\n }\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: LambdaCanBeReplacedWithAnonymous" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LambdaCanBeReplacedWithAnonymous", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantCompareCall", + "shortDescription": { + "text": "Redundant 'compare()' method call" + }, + "fullDescription": { + "text": "Reports comparisons in which the 'compare' method is superfluous. Example: 'boolean result = Integer.compare(a, b) == 0;' After the quick-fix is applied: 'boolean result = a == b;' Inspection ID: RedundantCompareCall New in 2018.2", + "markdown": "Reports comparisons in which the `compare` method is superfluous.\n\nExample:\n\n\n boolean result = Integer.compare(a, b) == 0;\n\nAfter the quick-fix is applied:\n\n\n boolean result = a == b;\n\nInspection ID: RedundantCompareCall\n\nNew in 2018.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantCompareCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IfCanBeAssertion", + "shortDescription": { + "text": "Statement can be replaced with 'assert' or 'Objects.requireNonNull'" + }, + "fullDescription": { + "text": "Reports 'if' statements that throw only 'java.lang.Throwable' from a 'then' branch and do not have an 'else' branch. Such statements can be converted to more compact 'assert' statements. The inspection also reports Guava's 'Preconditions.checkNotNull()'. They can be replaced with a 'Objects.requireNonNull()' call for which a library may not be needed. Example: 'if (x == 2) throw new RuntimeException(\"fail\");\n if (y == null) throw new AssertionError();\n Preconditions.checkNotNull(z, \"z\");' After the quick-fix is applied: 'assert x != 2 : \"fail\";\n Objects.requireNonNull(y);\n Objects.requireNonNull(z, \"z\");' By default, this inspection provides a quick-fix in the editor without code highlighting. This inspection depends on the Java feature 'Assertions', which is available since Java 1.4. Inspection ID: IfCanBeAssertion", + "markdown": "Reports `if` statements that throw only `java.lang.Throwable` from a `then` branch and do not have an `else` branch. Such statements can be converted to more compact `assert` statements.\n\n\nThe inspection also reports Guava's `Preconditions.checkNotNull()`.\nThey can be replaced with a `Objects.requireNonNull()` call for which a library may not be needed.\n\nExample:\n\n\n if (x == 2) throw new RuntimeException(\"fail\");\n if (y == null) throw new AssertionError();\n Preconditions.checkNotNull(z, \"z\");\n\nAfter the quick-fix is applied:\n\n\n assert x != 2 : \"fail\";\n Objects.requireNonNull(y);\n Objects.requireNonNull(z, \"z\");\n\nBy default, this inspection provides a quick-fix in the editor without code highlighting.\n\nThis inspection depends on the Java feature 'Assertions', which is available since Java 1.4.\n\nInspection ID: IfCanBeAssertion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "IfCanBeAssertion", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TextBlockBackwardMigration", + "shortDescription": { + "text": "Text block can be replaced with regular string literal" + }, + "fullDescription": { + "text": "Reports text blocks that can be replaced with regular string literals. This may help to downgrade for backward compatibility with earlier Java versions. Example: 'Object obj = engine.eval(\"\"\"\n function hello() {\n print('\"Hello, world\"');\n }\n\n hello();\n \"\"\");' After the quick fix is applied: 'Object obj = engine.eval(\"function hello() {\\n\" +\n \" print('\\\"Hello, world\\\"');\\n\" +\n \"}\\n\" +\n \"\\n\" +\n \"hello();\\n\");' This inspection depends on the Java feature 'Text block literals', which is available since Java 15. Inspection ID: TextBlockBackwardMigration New in 2019.3", + "markdown": "Reports text blocks that can be replaced with regular string literals. This may help to downgrade for backward compatibility with earlier Java versions.\n\n**Example:**\n\n\n Object obj = engine.eval(\"\"\"\n function hello() {\n print('\"Hello, world\"');\n }\n\n hello();\n \"\"\");\n\nAfter the quick fix is applied:\n\n\n Object obj = engine.eval(\"function hello() {\\n\" +\n \" print('\\\"Hello, world\\\"');\\n\" +\n \"}\\n\" +\n \"\\n\" +\n \"hello();\\n\");\n\nThis inspection depends on the Java feature 'Text block literals', which is available since Java 15.\n\nInspection ID: TextBlockBackwardMigration\n\nNew in 2019.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "TextBlockBackwardMigration", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 15", + "index": 105, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyClass", + "shortDescription": { + "text": "Empty class" + }, + "fullDescription": { + "text": "Reports empty classes and empty Java files. A class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes are sometimes left over after significant changes or refactorings. Example: 'class Example {\n List getList() {\n return new ArrayList<>() {\n\n };\n }\n }' After the quick-fix is applied: 'class Example {\n List getList() {\n return new ArrayList<>();\n }\n }' Configure the inspection: Use the Ignore if annotated by option to specify special annotations. The inspection will ignore the classes marked with these annotations. Use the Ignore class if it is a parametrization of a super type option to ignore classes that parameterize a superclass. For example: 'class MyList extends ArrayList {}' Use the Ignore subclasses of java.lang.Throwable to ignore classes that extend 'java.lang.Throwable'. Use the Comments count as content option to ignore classes that contain comments. Inspection ID: EmptyClass", + "markdown": "Reports empty classes and empty Java files.\n\nA class is empty if it doesn't contain any fields, methods, constructors, or initializers. Empty classes are sometimes left over\nafter significant changes or refactorings.\n\n**Example:**\n\n\n class Example {\n List getList() {\n return new ArrayList<>() {\n\n };\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n List getList() {\n return new ArrayList<>();\n }\n }\n\nConfigure the inspection:\n\n* Use the **Ignore if annotated by** option to specify special annotations. The inspection will ignore the classes marked with these annotations.\n*\n Use the **Ignore class if it is a parametrization of a super type** option to ignore classes that parameterize a superclass. For example:\n\n class MyList extends ArrayList {}\n\n* Use the **Ignore subclasses of java.lang.Throwable** to ignore classes that extend `java.lang.Throwable`.\n* Use the **Comments count as content** option to ignore classes that contain comments.\n\nInspection ID: EmptyClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavadocDeclaration", + "shortDescription": { + "text": "Javadoc declaration problems" + }, + "fullDescription": { + "text": "Reports Javadoc comments and tags with the following problems: invalid tag names incomplete tag descriptions duplicated tags missing Javadoc descriptions Example: '/**\n * Invalid tag name\n * @poram param description\n */\n public void sample(int param){\n }' Example: '/**\n * Pointing to itself {@link #sample(int)}\n */\n public void sample(int param){\n }' Quick-fix adds the unknown Javadoc tag to the list of user defined additional tags. Inspection ID: JavadocDeclaration", + "markdown": "Reports Javadoc comments and tags with the following problems:\n\n* invalid tag names\n* incomplete tag descriptions\n* duplicated tags\n* missing Javadoc descriptions\n\nExample:\n\n\n /**\n * Invalid tag name\n * @poram param description\n */\n public void sample(int param){\n }\n\nExample:\n\n\n /**\n * Pointing to itself {@link #sample(int)}\n */\n public void sample(int param){\n }\n\nQuick-fix adds the unknown Javadoc tag to the list of user defined additional tags.\n\nInspection ID: JavadocDeclaration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JavadocDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConditionalCanBeOptional", + "shortDescription": { + "text": "Conditional can be replaced with Optional" + }, + "fullDescription": { + "text": "Reports null-check conditions and suggests replacing them with 'Optional' chains. Example: 'return str == null ? \"\" : str.trim();' After applying the quick-fix: 'return Optional.ofNullable(str).map(String::trim).orElse(\"\");' While the replacement is not always shorter, it could be helpful for further refactoring (for example, for changing the method return value to 'Optional'). Note that when a not-null branch of the condition returns null, the corresponding mapping step will produce an empty 'Optional' possibly changing the semantics. If it cannot be statically proven that semantics will be preserved, the quick-fix action name will contain the \"(may change semantics)\" notice, and the inspection highlighting will be turned off. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: ConditionalCanBeOptional New in 2018.1", + "markdown": "Reports null-check conditions and suggests replacing them with `Optional` chains.\n\nExample:\n\n\n return str == null ? \"\" : str.trim();\n\nAfter applying the quick-fix:\n\n\n return Optional.ofNullable(str).map(String::trim).orElse(\"\");\n\nWhile the replacement is not always shorter, it could be helpful for further refactoring\n(for example, for changing the method return value to `Optional`).\n\nNote that when a not-null branch of the condition returns null, the corresponding mapping step will\nproduce an empty `Optional` possibly changing the semantics. If it cannot be statically\nproven that semantics will be preserved, the quick-fix action name will contain the \"(may change semantics)\"\nnotice, and the inspection highlighting will be turned off.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: ConditionalCanBeOptional\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConditionalCanBeOptional", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToMethodParameter", + "shortDescription": { + "text": "Assignment to method parameter" + }, + "fullDescription": { + "text": "Reports assignment to, or modification of method parameters. Although occasionally intended, this construct may be confusing and is therefore prohibited in some Java projects. The quick-fix adds a declaration of a new variable. Example: 'void printTrimmed(String s) {\n s = s.trim();\n System.out.println(s);\n }' After the quick-fix is applied: 'void printTrimmed(String s) {\n String trimmed = s.trim();\n System.out.println(trimmed);\n }' Use the Ignore if assignment is a transformation of the original parameter option to ignore assignments that modify the parameter value based on its previous value. Inspection ID: AssignmentToMethodParameter", + "markdown": "Reports assignment to, or modification of method parameters.\n\nAlthough occasionally intended, this construct may be confusing\nand is therefore prohibited in some Java projects.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n void printTrimmed(String s) {\n s = s.trim();\n System.out.println(s);\n }\n\nAfter the quick-fix is applied:\n\n\n void printTrimmed(String s) {\n String trimmed = s.trim();\n System.out.println(trimmed);\n }\n\n\nUse the **Ignore if assignment is a transformation of the original parameter** option to ignore assignments that modify\nthe parameter value based on its previous value.\n\nInspection ID: AssignmentToMethodParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToMethodParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LocalVariableHidingMemberVariable", + "shortDescription": { + "text": "Local variable hides field" + }, + "fullDescription": { + "text": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended. A quick-fix is suggested to rename the variable. Example: 'public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }' You can configure the following options for this inspection: Ignore non-accessible fields - ignore local variables named identically to superclass fields that are not visible (for example, because they are private). Ignore local variables in a static context hiding non-static fields - for example when the local variable is inside a static method or inside a method which is inside a static inner class. Inspection ID: LocalVariableHidingMemberVariable", + "markdown": "Reports local variables named identically to a field of a surrounding class. As a result of such naming, you may accidentally use the variable where the identically named field is intended.\n\nA quick-fix is suggested to rename the variable.\n\n**Example:**\n\n\n public class Foo {\n public Object foo;\n\n void bar() {\n Object o = new Object() {\n void baz() {\n Object foo; // Local variable 'foo' hides field in class 'Foo'\n }\n };\n }\n }\n\n\nYou can configure the following options for this inspection:\n\n1. **Ignore non-accessible fields** - ignore local variables named identically to superclass fields that are not visible (for example, because they are private).\n2. **Ignore local variables in a static context hiding non-static fields** - for example when the local variable is inside a static method or inside a method which is inside a static inner class.\n\nInspection ID: LocalVariableHidingMemberVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LocalVariableHidesMemberVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentToLambdaParameter", + "shortDescription": { + "text": "Assignment to lambda parameter" + }, + "fullDescription": { + "text": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable. The quick-fix adds a declaration of a new variable. Example: 'list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });' After the quick-fix is applied: 'list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });' Use the Ignore if assignment is a transformation of the original parameter option to ignore assignments that modify the parameter value based on its previous value. This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: AssignmentToLambdaParameter", + "markdown": "Reports assignment to, or modification of lambda parameters. Although occasionally intended, this construct may be confusing and is often caused by a typo or use of a wrong variable.\n\nThe quick-fix adds a declaration of a new variable.\n\n**Example:**\n\n\n list.forEach(s -> {\n s = s.trim();\n System.out.println(\"String: \" + s);\n });\n\nAfter the quick-fix is applied:\n\n\n list.forEach(s -> {\n String trimmed = s.trim();\n System.out.println(\"String: \" + trimmed);\n });\n\nUse the **Ignore if assignment is a transformation of the original parameter** option to ignore assignments that modify the parameter\nvalue based on its previous value.\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: AssignmentToLambdaParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentToLambdaParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Assignment issues", + "index": 36, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryTemporaryOnConversionToString", + "shortDescription": { + "text": "Unnecessary temporary object in conversion to 'String'" + }, + "fullDescription": { + "text": "Reports unnecessary creation of temporary objects when converting from a primitive type to 'String'. Example: 'String foo = new Integer(3).toString();' After the quick-fix is applied: 'String foo = Integer.toString(3);' Inspection ID: UnnecessaryTemporaryOnConversionToString", + "markdown": "Reports unnecessary creation of temporary objects when converting from a primitive type to `String`.\n\n**Example:**\n\n\n String foo = new Integer(3).toString();\n\nAfter the quick-fix is applied:\n\n\n String foo = Integer.toString(3);\n\nInspection ID: UnnecessaryTemporaryOnConversionToString" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryTemporaryOnConversionToString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SystemGetenv", + "shortDescription": { + "text": "Call to 'System.getenv()'" + }, + "fullDescription": { + "text": "Reports calls to 'System.getenv()'. Calls to 'System.getenv()' are inherently unportable. Inspection ID: SystemGetenv", + "markdown": "Reports calls to `System.getenv()`. Calls to `System.getenv()` are inherently unportable.\n\nInspection ID: SystemGetenv" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToSystemGetenv", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InterfaceMayBeAnnotatedFunctional", + "shortDescription": { + "text": "Interface may be annotated as '@FunctionalInterface'" + }, + "fullDescription": { + "text": "Reports interfaces that can be annotated with '@FunctionalInterface'. Annotating an interface with '@FunctionalInterface' indicates that the interface is functional and no more 'abstract' methods can be added to it. Example: 'interface FileProcessor {\n void execute(File file);\n }' After the quick-fix is applied: '@FunctionalInterface\n interface FileProcessor {\n void execute(File file);\n }' This inspection depends on the Java feature 'Lambda expressions', which is available since Java 8. Inspection ID: InterfaceMayBeAnnotatedFunctional", + "markdown": "Reports interfaces that can be annotated with `@FunctionalInterface`.\n\nAnnotating an interface with `@FunctionalInterface` indicates that the interface\nis functional and no more `abstract` methods can be added to it.\n\n**Example:**\n\n\n interface FileProcessor {\n void execute(File file);\n }\n\nAfter the quick-fix is applied:\n\n\n @FunctionalInterface\n interface FileProcessor {\n void execute(File file);\n }\n\nThis inspection depends on the Java feature 'Lambda expressions', which is available since Java 8.\n\nInspection ID: InterfaceMayBeAnnotatedFunctional" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InterfaceMayBeAnnotatedFunctional", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BreakStatementWithLabel", + "shortDescription": { + "text": "'break' statement with label" + }, + "fullDescription": { + "text": "Reports 'break' statements with labels. Labeled 'break' statements complicate refactoring and can be confusing. Example: 'void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) break outer;\n handleChar(ch);\n }\n }\n }' Inspection ID: BreakStatementWithLabel", + "markdown": "Reports `break` statements with labels.\n\nLabeled `break` statements complicate refactoring and can be confusing.\n\nExample:\n\n\n void handle(List strs) {\n outer:\n for (String s: strs) {\n for (char ch : s.toCharArray()) {\n if ('s' == ch) break outer;\n handleChar(ch);\n }\n }\n }\n\n\nInspection ID: BreakStatementWithLabel" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BreakStatementWithLabel", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringEquality", + "shortDescription": { + "text": "String comparison using '==', instead of 'equals()'" + }, + "fullDescription": { + "text": "Reports code that uses of == or != to compare strings. These operators determine referential equality instead of comparing content. In most cases, strings should be compared using 'equals()', which does a character-by-character comparison when the strings are different objects. Example: 'void foo(String s, String t) {\n final boolean b = t == s;\n }' If 't' is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following: 'void foo(String s, String t) {\n final boolean b = t.equals(s);\n }' Inspection ID: StringEquality", + "markdown": "Reports code that uses of **==** or **!=** to compare strings.\n\n\nThese operators determine referential equality instead of comparing content.\nIn most cases, strings should be compared using `equals()`,\nwhich does a character-by-character comparison when the strings are different objects.\n\n**Example:**\n\n\n void foo(String s, String t) {\n final boolean b = t == s;\n }\n\nIf `t` is known to be non-null, then it's safe to apply the \"unsafe\" quick-fix and get the result similar to the following:\n\n\n void foo(String s, String t) {\n final boolean b = t.equals(s);\n }\n\n\nInspection ID: StringEquality" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StringEquality", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousLiteralUnderscore", + "shortDescription": { + "text": "Suspicious underscore in number literal" + }, + "fullDescription": { + "text": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo. This inspection will not warn on literals containing two consecutive underscores. It is also allowed to omit underscores in the fractional part of 'double' and 'float' literals. Example: 'int oneMillion = 1_000_0000;' Inspection ID: SuspiciousLiteralUnderscore", + "markdown": "Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo.\n\nThis inspection will not warn on literals containing two consecutive underscores.\nIt is also allowed to omit underscores in the fractional part of `double` and `float` literals.\n\n**Example:** `int oneMillion = 1_000_0000;`\n\n\nInspection ID: SuspiciousLiteralUnderscore" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousLiteralUnderscore", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticCallOnSubclass", + "shortDescription": { + "text": "Static method referenced via subclass" + }, + "fullDescription": { + "text": "Reports static method calls where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself. Java allows such qualification for classes, but such calls may indicate a subtle confusion of inheritance and overriding. Example: 'class Parent {\n public static void print(String str) {}\n }\n class Child extends Parent {}\n\n Child.print(\"Hello, world!\");' After the quick-fix is applied: 'Parent.print(\"Hello, world!\");' Inspection ID: StaticCallOnSubclass", + "markdown": "Reports static method calls where the call is qualified by a subclass of the declaring class, rather than by the declaring class itself.\n\n\nJava allows such qualification for classes, but such calls\nmay indicate a subtle confusion of inheritance and overriding.\n\n**Example:**\n\n\n class Parent {\n public static void print(String str) {}\n }\n class Child extends Parent {}\n\n Child.print(\"Hello, world!\");\n\nAfter the quick-fix is applied:\n\n\n Parent.print(\"Hello, world!\");\n\nInspection ID: StaticCallOnSubclass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticMethodReferencedViaSubclass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantExpression", + "shortDescription": { + "text": "Constant expression can be evaluated" + }, + "fullDescription": { + "text": "Reports constant expressions, whose value can be evaluated statically, and suggests replacing them with their actual values. For example, you will be prompted to replace '2 + 2' with '4', or 'Math.sqrt(9.0)' with '3.0'. Inspection ID: ConstantExpression New in 2018.1", + "markdown": "Reports constant expressions, whose value can be evaluated statically, and suggests replacing them with their actual values. For example, you will be prompted to replace `2 + 2` with `4`, or `Math.sqrt(9.0)` with `3.0`.\n\nInspection ID: ConstantExpression\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConstantExpression", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReadResolveAndWriteReplaceProtected", + "shortDescription": { + "text": "'readResolve()' or 'writeReplace()' not declared 'protected'" + }, + "fullDescription": { + "text": "Reports classes that implement 'java.io.Serializable' where the 'readResolve()' or 'writeReplace()' methods are not declared 'protected'. Declaring 'readResolve()' and 'writeReplace()' methods 'private' can force subclasses to silently ignore them, while declaring them 'public' allows them to be invoked by untrusted code. If the containing class is declared 'final', these methods can be declared 'private'. Example: 'class ClassWithSerialization implements Serializable {\n public Object writeReplace() { // warning: 'writeReplace()' not declared protected\n ...\n }\n }'\n Inspection ID: ReadResolveAndWriteReplaceProtected", + "markdown": "Reports classes that implement `java.io.Serializable` where the `readResolve()` or `writeReplace()` methods are not declared `protected`.\n\n\nDeclaring `readResolve()` and `writeReplace()` methods `private`\ncan force subclasses to silently ignore them, while declaring them\n`public` allows them to be invoked by untrusted code.\n\n\nIf the containing class is declared `final`, these methods can be declared `private`.\n\n**Example:**\n\n\n class ClassWithSerialization implements Serializable {\n public Object writeReplace() { // warning: 'writeReplace()' not declared protected\n ...\n }\n }\n \nInspection ID: ReadResolveAndWriteReplaceProtected" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReadResolveAndWriteReplaceProtected", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryLabelOnContinueStatement", + "shortDescription": { + "text": "Unnecessary label on 'continue' statement" + }, + "fullDescription": { + "text": "Reports 'continue' statements with unnecessary labels. Example: 'LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }' Inspection ID: UnnecessaryLabelOnContinueStatement", + "markdown": "Reports `continue` statements with unnecessary labels.\n\nExample:\n\n\n LABEL:\n while (a > b) {\n System.out.println(\"Hello\");\n //the code below is the last statement in a loop,\n //so unnecessary label and continue can be removed\n continue LABEL;\n }\n\nInspection ID: UnnecessaryLabelOnContinueStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryLabelOnContinueStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageDotHtmlMayBePackageInfo", + "shortDescription": { + "text": "'package.html' may be converted to 'package-info.java'" + }, + "fullDescription": { + "text": "Reports any 'package.html' files which are used for documenting packages. Since JDK 1.5, it is recommended that you use 'package-info.java' files instead, as such files can also contain package annotations. This way, package-info.java becomes a sole repository for package level annotations and documentation. Example: 'package.html' '\n \n Documentation example.\n \n' After the quick-fix is applied: 'package-info.java' '/**\n * Documentation example.\n */\npackage com.sample;' Inspection ID: PackageDotHtmlMayBePackageInfo", + "markdown": "Reports any `package.html` files which are used for documenting packages.\n\nSince JDK 1.5, it is recommended that you use `package-info.java` files instead, as such\nfiles can also contain package annotations. This way, package-info.java becomes a\nsole repository for package level annotations and documentation.\n\nExample: `package.html`\n\n\n \n \n Documentation example.\n \n \n\nAfter the quick-fix is applied: `package-info.java`\n\n\n /**\n * Documentation example.\n */\n package com.sample;\n\nInspection ID: PackageDotHtmlMayBePackageInfo" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PackageDotHtmlMayBePackageInfo", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LongLiteralsEndingWithLowercaseL", + "shortDescription": { + "text": "'long' literal ending with 'l' instead of 'L'" + }, + "fullDescription": { + "text": "Reports 'long' literals ending with lowercase 'l'. These literals may be confusing, as the lowercase 'l' looks very similar to a literal '1' (one). Example: 'long nights = 100l;' After the quick-fix is applied: 'long nights = 100L;' Inspection ID: LongLiteralsEndingWithLowercaseL", + "markdown": "Reports `long` literals ending with lowercase 'l'. These literals may be confusing, as the lowercase 'l' looks very similar to a literal '1' (one).\n\n**Example:**\n\n\n long nights = 100l;\n\nAfter the quick-fix is applied:\n\n\n long nights = 100L;\n\nInspection ID: LongLiteralsEndingWithLowercaseL" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "LongLiteralEndingWithLowercaseL", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantArrayCreation", + "shortDescription": { + "text": "Redundant array creation" + }, + "fullDescription": { + "text": "Reports arrays that are created specifically to be passed as a varargs parameter. Example: 'Arrays.asList(new String[]{\"Hello\", \"world\"})' The quick-fix replaces the array initializer with individual arguments: 'Arrays.asList(\"Hello\", \"world\")' Inspection ID: RedundantArrayCreation", + "markdown": "Reports arrays that are created specifically to be passed as a varargs parameter.\n\nExample:\n\n`Arrays.asList(new String[]{\"Hello\", \"world\"})`\n\nThe quick-fix replaces the array initializer with individual arguments:\n\n`Arrays.asList(\"Hello\", \"world\")`\n\nInspection ID: RedundantArrayCreation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantArrayCreation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParameterNamingConvention", + "shortDescription": { + "text": "Method parameter naming convention" + }, + "fullDescription": { + "text": "Reports method parameters whose names are too short, too long, or do not follow the specified regular expression pattern. Example: 'void fooBar(int X)' should be reported if the inspection is enabled with the default settings in which a parameter name should start with a lowercase letter. Configure the inspection: Use the fields in the Options section to specify the minimum length, maximum length, and a regular expression expected for method parameter names. Specify 0 in order not to check the length of names. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: ParameterNamingConvention", + "markdown": "Reports method parameters whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n**Example:** `void fooBar(int X)`\nshould be reported if the inspection is enabled with the default settings in which a parameter name should start with a lowercase letter.\n\nConfigure the inspection:\n\n\nUse the fields in the **Options** section to specify the minimum length, maximum length, and a regular expression expected for\nmethod parameter names. Specify **0** in order not to check the length of names.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: ParameterNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodParameterNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions", + "index": 51, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodCanBeVariableArityMethod", + "shortDescription": { + "text": "Method can have varargs parameter" + }, + "fullDescription": { + "text": "Reports methods that can be converted to variable arity methods. Example: 'void process(String name, Object[] objects);' After the quick-fix is applied: 'void process(String name, Object... objects);' This inspection depends on the Java feature 'Variable arity methods', which is available since Java 5. Inspection ID: MethodCanBeVariableArityMethod", + "markdown": "Reports methods that can be converted to variable arity methods.\n\n**Example:**\n\n\n void process(String name, Object[] objects);\n\nAfter the quick-fix is applied:\n\n\n void process(String name, Object... objects);\n\nThis inspection depends on the Java feature 'Variable arity methods', which is available since Java 5.\n\nInspection ID: MethodCanBeVariableArityMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MethodCanBeVariableArityMethod", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonShortCircuitBoolean", + "shortDescription": { + "text": "Non-short-circuit boolean expression" + }, + "fullDescription": { + "text": "Reports usages of the non-short-circuit forms of boolean 'and' and 'or' ('&', '|', '&=' and '|='). Although the non-short-circuit versions are occasionally useful, in most cases the short-circuit forms ('&&' and '||') are intended and such unintentional usages may lead to subtle bugs. A quick-fix is suggested to use the short-circuit versions. Example: 'void foo(boolean x, boolean y, boolean z) {\n if (x | y) { x |= z; }\n }' After the quick-fix is applied: 'void foo(boolean x, boolean y) {\n if (x || y) { x = x || z; }\n }' Inspection ID: NonShortCircuitBoolean", + "markdown": "Reports usages of the non-short-circuit forms of boolean 'and' and 'or' (`&`, `|`, `&=` and `|=`). Although the non-short-circuit versions are occasionally useful, in most cases the short-circuit forms (`&&` and `||`) are intended and such unintentional usages may lead to subtle bugs.\n\n\nA quick-fix is suggested to use the short-circuit versions.\n\n**Example:**\n\n\n void foo(boolean x, boolean y, boolean z) {\n if (x | y) { x |= z; }\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(boolean x, boolean y) {\n if (x || y) { x = x || z; }\n }\n\nInspection ID: NonShortCircuitBoolean" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonShortCircuitBooleanExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AbstractClassNeverImplemented", + "shortDescription": { + "text": "Abstract class which has no concrete subclass" + }, + "fullDescription": { + "text": "Reports 'abstract' classes that have no concrete subclasses. Deprecated abstract classes are not reported. Inspection ID: AbstractClassNeverImplemented", + "markdown": "Reports `abstract` classes that have no concrete subclasses. Deprecated abstract classes are not reported.\n\nInspection ID: AbstractClassNeverImplemented" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AbstractClassNeverImplemented", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThrowablePrintedToSystemOut", + "shortDescription": { + "text": "'Throwable' printed to 'System.out'" + }, + "fullDescription": { + "text": "Reports calls to 'System.out.println()' with an exception as an argument. Using print statements for logging exceptions hides the stack trace from you, which can complicate the investigation of the problem. It is recommended that you use logger instead. Calls to 'System.out.print()', 'System.err.println()', and 'System.err.print()' with an exception argument are also reported. It is better to use a logger to log exceptions instead. The provided quick-fix supports SLF4J and Log4j 2. It replaces 'System.out.println()' call with log calls Example: 'try {\n foo();\n } catch (Exception e) {\n System.out.println(e);\n }' After the quick-fix is applied: 'try {\n foo();\n } catch (Exception e) {\n log.error(\"e: \", e);\n }' Use the Log method for fix option to specify a method which it is used to log a message. Inspection ID: ThrowablePrintedToSystemOut", + "markdown": "Reports calls to `System.out.println()` with an exception as an argument.\n\nUsing print statements for logging exceptions hides the stack trace from you, which can complicate the investigation of the problem.\nIt is recommended that you use logger instead.\n\nCalls to `System.out.print()`, `System.err.println()`, and `System.err.print()` with an exception argument are also\nreported. It is better to use a logger to log exceptions instead.\n\nThe provided quick-fix supports **SLF4J** and **Log4j 2** .\nIt replaces `System.out.println()` call with log calls\n\n**Example:**\n\n\n try {\n foo();\n } catch (Exception e) {\n System.out.println(e);\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n foo();\n } catch (Exception e) {\n log.error(\"e: \", e);\n }\n\n\nUse the **Log method for fix** option to specify a method which it is used to log a message.\n\nInspection ID: ThrowablePrintedToSystemOut" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ThrowablePrintedToSystemOut", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StreamToLoop", + "shortDescription": { + "text": "Stream API call chain can be replaced with loop" + }, + "fullDescription": { + "text": "Reports Stream API chains, 'Iterable.forEach()', and 'Map.forEach()' calls that can be automatically converted into classical loops. This can help to downgrade for backward compatibility with earlier Java versions. Example: 'String joinNonEmpty(List list) {\n return list.stream() // Stream can be converted to loop\n .filter(s -> !s.isEmpty())\n .map(String::trim)\n .collect(Collectors.joining(\", \"));\n }' After the quick-fix is applied: 'String joinNonEmpty(List list) {\n StringJoiner joiner = new StringJoiner(\", \");\n for (String s : list) {\n if (!s.isEmpty()) {\n String trim = s.trim();\n joiner.add(trim);\n }\n }\n return joiner.toString();\n }' Note that sometimes this inspection might cause slight semantic changes. Special care should be taken when it comes to short-circuiting, as it's not specified how many elements will be actually read when the stream short-circuits. Configure the inspection: Use the Iterate unknown Stream sources via Stream.iterator() option to suggest conversions for streams with unrecognized source. In this case, iterator will be created from the stream. For example, when checkbox is selected, the conversion will be suggested here: 'List handles = ProcessHandle.allProcesses().collect(Collectors.toList());' In this case, the result will be as follows: 'List handles = new ArrayList<>();\n for (Iterator it = ProcessHandle.allProcesses().iterator(); it.hasNext(); ) {\n ProcessHandle allProcess = it.next();\n handles.add(allProcess);\n }' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: StreamToLoop New in 2017.1", + "markdown": "Reports Stream API chains, `Iterable.forEach()`, and `Map.forEach()` calls that can be automatically converted into classical loops. This can help to downgrade for backward compatibility with earlier Java versions.\n\n**Example:**\n\n\n String joinNonEmpty(List list) {\n return list.stream() // Stream can be converted to loop\n .filter(s -> !s.isEmpty())\n .map(String::trim)\n .collect(Collectors.joining(\", \"));\n }\n\nAfter the quick-fix is applied:\n\n\n String joinNonEmpty(List list) {\n StringJoiner joiner = new StringJoiner(\", \");\n for (String s : list) {\n if (!s.isEmpty()) {\n String trim = s.trim();\n joiner.add(trim);\n }\n }\n return joiner.toString();\n }\n\n\nNote that sometimes this inspection might cause slight semantic changes.\nSpecial care should be taken when it comes to short-circuiting, as it's not specified how many elements will be actually read when\nthe stream short-circuits.\n\nConfigure the inspection:\n\nUse the **Iterate unknown Stream sources via Stream.iterator()** option to suggest conversions for streams with unrecognized source.\nIn this case, iterator will be created from the stream.\nFor example, when checkbox is selected, the conversion will be suggested here:\n\n\n List handles = ProcessHandle.allProcesses().collect(Collectors.toList());\n\nIn this case, the result will be as follows:\n\n\n List handles = new ArrayList<>();\n for (Iterator it = ProcessHandle.allProcesses().iterator(); it.hasNext(); ) {\n ProcessHandle allProcess = it.next();\n handles.add(allProcess);\n }\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: StreamToLoop\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "StreamToLoop", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NotifyWithoutCorrespondingWait", + "shortDescription": { + "text": "'notify()' without corresponding 'wait()'" + }, + "fullDescription": { + "text": "Reports calls to 'Object.notify()' or 'Object.notifyAll()' for which no call to a corresponding 'Object.wait()' can be found. Only calls that target fields of the current class are reported by this inspection. Example: 'synchronized (synList) {\n synList.notify(); //synList.wait() is never called\n }' Inspection ID: NotifyWithoutCorrespondingWait", + "markdown": "Reports calls to `Object.notify()` or `Object.notifyAll()` for which no call to a corresponding `Object.wait()` can be found.\n\nOnly calls that target fields of the current class are reported by this inspection.\n\n**Example:**\n\n\n synchronized (synList) {\n synList.notify(); //synList.wait() is never called\n }\n\nInspection ID: NotifyWithoutCorrespondingWait" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NotifyWithoutCorrespondingWait", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantRecordConstructor", + "shortDescription": { + "text": "Redundant record constructor" + }, + "fullDescription": { + "text": "Reports redundant constructors declared inside Java records. Example 1: 'record Point(int x, int y) {\n public Point {} // could be removed\n }\n \n record Point(int x, int y) {\n public Point(int x, int y) { // could be removed\n this.x = x;\n this.y = y;\n }\n }' The quick-fix removes the redundant constructors. Example 2: '// could be converted to compact constructor\n record Range(int from, int to) {\n public Range(int from, int to) {\n if (from > to) throw new IllegalArgumentException();\n this.from = from;\n this.to = to;\n }\n }' The quick-fix converts this code into a compact constructor. This inspection depends on the Java feature 'Records', which is available since Java 16. Inspection ID: RedundantRecordConstructor New in 2020.1", + "markdown": "Reports redundant constructors declared inside Java records.\n\n**Example 1:**\n\n\n record Point(int x, int y) {\n public Point {} // could be removed\n }\n \n record Point(int x, int y) {\n public Point(int x, int y) { // could be removed\n this.x = x;\n this.y = y;\n }\n }\n\nThe quick-fix removes the redundant constructors.\n\n**Example 2:**\n\n\n // could be converted to compact constructor\n record Range(int from, int to) {\n public Range(int from, int to) {\n if (from > to) throw new IllegalArgumentException();\n this.from = from;\n this.to = to;\n }\n }\n\nThe quick-fix converts this code into a compact constructor.\n\nThis inspection depends on the Java feature 'Records', which is available since Java 16.\n\nInspection ID: RedundantRecordConstructor\n\nNew in 2020.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantRecordConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AmbiguousMethodCall", + "shortDescription": { + "text": "Call to inherited method looks like call to local method" + }, + "fullDescription": { + "text": "Reports calls to a superclass method from an anonymous, inner or local class, if a method with the same signature exists in the code surrounding the class. In this case it may seem that a method from the surrounding code is called, when in fact it is a call to a method from the superclass. To clarify the intent of the code, it is recommended to add an explicit 'super' qualifier to the method call. Example: 'class Parent {\n void ambiguous(){}\n }\n\n class Example {\n void ambiguous(){}\n\n class Inner extends Parent {\n void example(){\n ambiguous(); //warning\n }\n }\n }' After the quick-fix is applied: 'class Parent {\n void ambiguous(){}\n }\n\n class Example {\n void ambiguous(){}\n\n class Inner extends Parent {\n void example(){\n super.ambiguous();\n }\n }\n }' Inspection ID: AmbiguousMethodCall", + "markdown": "Reports calls to a superclass method from an anonymous, inner or local class, if a method with the same signature exists in the code surrounding the class. In this case it may seem that a method from the surrounding code is called, when in fact it is a call to a method from the superclass.\n\n\nTo clarify the intent of the code, it is recommended to add an explicit\n`super` qualifier to the method call.\n\n**Example:**\n\n\n class Parent {\n void ambiguous(){}\n }\n\n class Example {\n void ambiguous(){}\n\n class Inner extends Parent {\n void example(){\n ambiguous(); //warning\n }\n }\n }\n \nAfter the quick-fix is applied:\n\n\n class Parent {\n void ambiguous(){}\n }\n\n class Example {\n void ambiguous(){}\n\n class Inner extends Parent {\n void example(){\n super.ambiguous();\n }\n }\n }\n\nInspection ID: AmbiguousMethodCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AmbiguousMethodCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassInitializerMayBeStatic", + "shortDescription": { + "text": "Instance initializer can be made 'static'" + }, + "fullDescription": { + "text": "Reports instance initializers which can be made 'static' without producing any errors. An instance initializer may be static if it does not reference any of its class' non-static members. Static initializers are executed once when the class is resolved, while instance initializers are executed on each instantiation of the class. This inspection doesn't report instance empty initializers and initializers in anonymous classes. Example: 'class A {\n public static String CONSTANT;\n {\n CONSTANT = \"Hello\";\n }\n }' After the quick-fix is applied: 'class A {\n public static String CONSTANT;\n static {\n CONSTANT = \"Hello\"; //now initialized only once per class\n }\n }' Inspection ID: ClassInitializerMayBeStatic", + "markdown": "Reports instance initializers which can be made `static` without producing any errors.\n\n\nAn instance initializer may be static if it does not reference any of its class' non-static members.\nStatic initializers are executed once when the class is resolved,\nwhile instance initializers are executed on each instantiation of the class.\n\nThis inspection doesn't report instance empty initializers and initializers in anonymous classes.\n\n**Example:**\n\n\n class A {\n public static String CONSTANT;\n {\n CONSTANT = \"Hello\";\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class A {\n public static String CONSTANT;\n static {\n CONSTANT = \"Hello\"; //now initialized only once per class\n }\n }\n\nInspection ID: ClassInitializerMayBeStatic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassInitializerMayBeStatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MagicCharacter", + "shortDescription": { + "text": "Magic character" + }, + "fullDescription": { + "text": "Reports character literals that are used without constant declaration. These characters might result in bad code readability. Also, there might be errors if a character is changed only in one location but not everywhere in code. Example: 'char c = 'c';' Inspection ID: MagicCharacter", + "markdown": "Reports character literals that are used without constant declaration. These characters might result in bad code readability. Also, there might be errors if a character is changed only in one location but not everywhere in code.\n\n**Example:**\n\n char c = 'c';\n\nInspection ID: MagicCharacter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MagicCharacter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SlowAbstractSetRemoveAll", + "shortDescription": { + "text": "Call to 'set.removeAll(list)' may work slowly" + }, + "fullDescription": { + "text": "Reports calls to 'java.util.Set.removeAll()' with a 'java.util.List' argument. Such a call can be slow when the size of the argument is greater than or equal to the size of the set, and the set is a subclass of 'java.util.AbstractSet'. In this case, 'List.contains()' is called for each element in the set, which will perform a linear search. Example: 'public void check(String... ss) {\n // possible O(n^2) complexity\n mySet.removeAll(List.of(ss));\n }' After the quick fix is applied: 'public void check(String... ss) {\n // O(n) complexity\n List.of(ss).forEach(mySet::remove);\n }' Inspection ID: SlowAbstractSetRemoveAll New in 2020.3", + "markdown": "Reports calls to `java.util.Set.removeAll()` with a `java.util.List` argument.\n\n\nSuch a call can be slow when the size of the argument is greater than or equal to the size of the set,\nand the set is a subclass of `java.util.AbstractSet`.\nIn this case, `List.contains()` is called for each element in the set, which will perform a linear search.\n\n**Example:**\n\n\n public void check(String... ss) {\n // possible O(n^2) complexity\n mySet.removeAll(List.of(ss));\n }\n\nAfter the quick fix is applied:\n\n\n public void check(String... ss) {\n // O(n) complexity\n List.of(ss).forEach(mySet::remove);\n }\n\nInspection ID: SlowAbstractSetRemoveAll\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SlowAbstractSetRemoveAll", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrayEquality", + "shortDescription": { + "text": "Array comparison using '==', instead of 'Arrays.equals()'" + }, + "fullDescription": { + "text": "Reports operators '==' and '!=' used to test for array equality. In most cases, testing for the equality of array contents is intended, which can be done with the 'java.util.Arrays.equals()' method. A quick-fix is suggested to replace '==' with 'java.util.Arrays.equals()'. Example: 'void foo(Object[] x, Object[] y) {\n boolean comparison = x == y;\n }' After the quick-fix is applied: 'void foo(Object[] x, Object[] y) {\n boolean comparison = Arrays.equals(x, y);\n }' Inspection ID: ArrayEquality", + "markdown": "Reports operators `==` and `!=` used to test for array equality. In most cases, testing for the equality of array contents is intended, which can be done with the `java.util.Arrays.equals()` method.\n\n\nA quick-fix is suggested to replace `==` with `java.util.Arrays.equals()`.\n\n**Example:**\n\n\n void foo(Object[] x, Object[] y) {\n boolean comparison = x == y;\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(Object[] x, Object[] y) {\n boolean comparison = Arrays.equals(x, y);\n }\n\nInspection ID: ArrayEquality" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ArrayEquality", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticInheritance", + "shortDescription": { + "text": "Static inheritance" + }, + "fullDescription": { + "text": "Reports interfaces that are implemented only to provide access to constants. This kind of inheritance is often confusing and may hide important dependency information. Inspection ID: StaticInheritance", + "markdown": "Reports interfaces that are implemented only to provide access to constants. This kind of inheritance is often confusing and may hide important dependency information.\n\n\nInspection ID: StaticInheritance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticInheritance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Inheritance issues", + "index": 24, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticCollection", + "shortDescription": { + "text": "Static collection" + }, + "fullDescription": { + "text": "Reports static fields of a 'Collection' type. While it's not necessarily a problem, static collections often cause memory leaks and are therefore prohibited by some coding standards. Example: 'public class Example {\n static List list = new ArrayList<>();\n\n }' Configure the inspection: Use the Ignore weak static collections or maps option to ignore the fields of the 'java.util.WeakHashMap' type. Inspection ID: StaticCollection", + "markdown": "Reports static fields of a `Collection` type. While it's not necessarily a problem, static collections often cause memory leaks and are therefore prohibited by some coding standards.\n\n**Example:**\n\n\n public class Example {\n static List list = new ArrayList<>();\n\n }\n\n\nConfigure the inspection:\n\n* Use the **Ignore weak static collections or maps** option to ignore the fields of the `java.util.WeakHashMap` type.\n\nInspection ID: StaticCollection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticCollection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Memory", + "index": 69, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantUnmodifiable", + "shortDescription": { + "text": "Redundant usage of unmodifiable collection wrappers" + }, + "fullDescription": { + "text": "Reports redundant calls to unmodifiable collection wrappers from the 'Collections' class. If the argument that is passed to an unmodifiable collection wrapper is already immutable, such a wrapping becomes redundant. Example: 'List x = Collections.unmodifiableList(Collections.singletonList(\"abc\"));' After the quick-fix is applied: 'List x = Collections.singletonList(\"abc\");' In order to detect the methods that return unmodifiable collections, the inspection uses the 'org.jetbrains.annotations.Unmodifiable' and 'org.jetbrains.annotations.UnmodifiableView' annotations. Use them to extend the inspection to your own unmodifiable collection wrappers. Inspection ID: RedundantUnmodifiable New in 2020.3", + "markdown": "Reports redundant calls to unmodifiable collection wrappers from the `Collections` class.\n\nIf the argument that is passed to an unmodifiable\ncollection wrapper is already immutable, such a wrapping becomes redundant.\n\nExample:\n\n\n List x = Collections.unmodifiableList(Collections.singletonList(\"abc\"));\n\nAfter the quick-fix is applied:\n\n\n List x = Collections.singletonList(\"abc\");\n\nIn order to detect the methods that return unmodifiable collections, the\ninspection uses the `org.jetbrains.annotations.Unmodifiable`\nand `org.jetbrains.annotations.UnmodifiableView` annotations.\nUse them to extend the inspection to your own unmodifiable collection\nwrappers.\n\nInspection ID: RedundantUnmodifiable\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantUnmodifiable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonExceptionNameEndsWithException", + "shortDescription": { + "text": "Non-exception class name ends with 'Exception'" + }, + "fullDescription": { + "text": "Reports non-'exception' classes whose names end with 'Exception'. Such classes may cause confusion by breaking a common naming convention and often indicate that the 'extends Exception' clause is missing. Example: 'public class NotStartedException {}' A quick-fix that renames such classes is available only in the editor. Inspection ID: NonExceptionNameEndsWithException", + "markdown": "Reports non-`exception` classes whose names end with `Exception`.\n\nSuch classes may cause confusion by breaking a common naming convention and\noften indicate that the `extends Exception` clause is missing.\n\n**Example:**\n\n public class NotStartedException {}\n\nA quick-fix that renames such classes is available only in the editor.\n\nInspection ID: NonExceptionNameEndsWithException" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonExceptionNameEndsWithException", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Class", + "index": 68, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantValue", + "shortDescription": { + "text": "Constant values" + }, + "fullDescription": { + "text": "Reports expressions and conditions that always produce the same result, like 'true', 'false', 'null', or '0'. Such expressions can be replaced with the corresponding constant value, or may indicate there is a bug in the code. Examples: '// always true\n // cause: || is used instead of &&\n if (x > 0 || x < 10) {}\n\n System.out.println(str.trim());\n // always false\n // cause: variable was dereferenced before null-check\n if (str == null) {}' The inspection's behavior may be controlled by annotations, such as nullability annotations, '@Contract' annotation, '@Range' annotation and so on. Configure the inspection: Use the Don't report assertions with condition statically proven to be always true option to avoid reporting assertions that were statically proven to be always true. This includes conditions like 'if (alwaysFalseCondition) throw new IllegalArgumentException();'. Use the Ignore assert statements option to control how the inspection treats 'assert' statements. By default, assertions are assumed to be executed ('-ea' mode). When the option is enabled, assertions will be ignored ('-da' mode). Use the Warn when constant is stored in variable option to display warnings when a variable is used, whose value is known to be constant. Before IntelliJ IDEA 2022.3, this inspection was part of the Constant Conditions & Exceptions inspection. This inspection has been split into two inspections: Constant Values and Nullability and data flow problems. Inspection ID: ConstantValue", + "markdown": "Reports expressions and conditions that always produce the same result, like `true`, `false`, `null`, or `0`. Such expressions can be replaced with the corresponding constant value, or may indicate there is a bug in the code.\n\nExamples:\n\n // always true\n // cause: || is used instead of &&\n if (x > 0 || x < 10) {}\n\n System.out.println(str.trim());\n // always false\n // cause: variable was dereferenced before null-check\n if (str == null) {}\n\n\nThe inspection's behavior may be controlled by annotations, such as\n[nullability](https://www.jetbrains.com/help/idea/nullable-and-notnull-annotations.html) annotations,\n[@Contract](https://www.jetbrains.com/help/idea/contract-annotations.html) annotation,\n`@Range` annotation and so on.\n\nConfigure the inspection:\n\n* Use the **Don't report assertions with condition statically proven to be always true** option to avoid reporting assertions that were statically proven to be always true. This includes conditions like `if (alwaysFalseCondition) throw new IllegalArgumentException();`.\n* Use the **Ignore assert statements** option to control how the inspection treats `assert` statements. By default, assertions are assumed to be executed (`-ea` mode). When the option is enabled, assertions will be ignored (`-da` mode).\n* Use the **Warn when constant is stored in variable** option to display warnings when a variable is used, whose value is known to be constant.\n\n\nBefore IntelliJ IDEA 2022.3, this inspection was part of the *Constant Conditions \\& Exceptions* inspection.\nThis inspection has been split into two inspections: *Constant Values* and *Nullability and data flow problems*.\n\nInspection ID: ConstantValue" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CastCanBeReplacedWithVariable", + "shortDescription": { + "text": "Cast can be replaced with variable" + }, + "fullDescription": { + "text": "Reports type cast operations that can be replaced with existing local or pattern variables with the same value. Example: 'void foo(Object obj) {\n String s = (String) obj;\n System.out.println(((String) obj).trim());\n }' After the quick-fix is applied: 'void foo(Object obj) {\n String s = (String) obj;\n System.out.println(s.trim());\n }' Inspection ID: CastCanBeReplacedWithVariable New in 2022.3", + "markdown": "Reports type cast operations that can be replaced with existing local or pattern variables with the same value.\n\nExample:\n\n\n void foo(Object obj) {\n String s = (String) obj;\n System.out.println(((String) obj).trim());\n }\n\nAfter the quick-fix is applied:\n\n\n void foo(Object obj) {\n String s = (String) obj;\n System.out.println(s.trim());\n }\n\nInspection ID: CastCanBeReplacedWithVariable\n\nNew in 2022.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CastCanBeReplacedWithVariable", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Convert2Diamond", + "shortDescription": { + "text": "Explicit type can be replaced with '<>'" + }, + "fullDescription": { + "text": "Reports 'new' expressions with type arguments that can be replaced a with diamond type '<>'. Example: 'List list = new ArrayList(); // reports array list type argument' After the quick-fix is applied: 'List list = new ArrayList<>();' This inspection depends on the Java feature 'Diamond types', which is available since Java 7. Inspection ID: Convert2Diamond", + "markdown": "Reports `new` expressions with type arguments that can be replaced a with diamond type `<>`.\n\nExample:\n\n\n List list = new ArrayList(); // reports array list type argument\n\nAfter the quick-fix is applied:\n\n\n List list = new ArrayList<>();\n\nThis inspection depends on the Java feature 'Diamond types', which is available since Java 7.\n\nInspection ID: Convert2Diamond" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Convert2Diamond", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 7", + "index": 118, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VarargParameter", + "shortDescription": { + "text": "Varargs method" + }, + "fullDescription": { + "text": "Reports methods that accept an arbitrary number of parameters (also known as varargs methods). Example: 'enum EnumConstants {\n A(null), B, C;\n\n EnumConstants(String... ss) {}\n}' A quick-fix is available to replace a variable argument parameter with an equivalent array parameter. Relevant arguments in method calls are wrapped in an array initializer expression. After the quick-fix is applied: 'enum EnumConstants {\n A(null), B(new String[]{}), C(new String[]{});\n\n EnumConstants(String[] ss) {}\n}' Varargs method appeared in Java 5. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: VarargParameter", + "markdown": "Reports methods that accept an arbitrary number of parameters (also known as varargs methods).\n\n**Example:**\n\n\n enum EnumConstants {\n A(null), B, C;\n\n EnumConstants(String... ss) {}\n }\n\nA quick-fix is available to replace a variable argument\nparameter with an equivalent array parameter. Relevant arguments in method calls are wrapped in an array initializer expression.\nAfter the quick-fix is applied:\n\n\n enum EnumConstants {\n A(null), B(new String[]{}), C(new String[]{});\n\n EnumConstants(String[] ss) {}\n }\n\n\n*Varargs method* appeared in Java 5.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: VarargParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "VariableArgumentMethod", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level issues", + "index": 62, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SystemGC", + "shortDescription": { + "text": "Call to 'System.gc()' or 'Runtime.gc()'" + }, + "fullDescription": { + "text": "Reports 'System.gc()' or 'Runtime.gc()' calls. While occasionally useful in testing, explicitly triggering garbage collection via 'System.gc()' is almost never recommended in production code and can result in serious performance issues. Inspection ID: SystemGC", + "markdown": "Reports `System.gc()` or `Runtime.gc()` calls. While occasionally useful in testing, explicitly triggering garbage collection via `System.gc()` is almost never recommended in production code and can result in serious performance issues.\n\nInspection ID: SystemGC" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToSystemGC", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Memory", + "index": 69, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassComplexity", + "shortDescription": { + "text": "Overly complex class" + }, + "fullDescription": { + "text": "Reports classes whose total complexity exceeds the specified maximum. The total complexity of a class is the sum of cyclomatic complexities of all the methods and initializers the class declares. Inherited methods and initializers are not counted toward the total complexity. Too high complexity indicates that the class should be refactored into several smaller classes. Use the Cyclomatic complexity limit field below to specify the maximum allowed complexity for a class. Inspection ID: ClassComplexity", + "markdown": "Reports classes whose total complexity exceeds the specified maximum.\n\nThe total complexity of a class is the sum of cyclomatic complexities of all the methods\nand initializers the class declares. Inherited methods and initializers are not counted\ntoward the total complexity.\n\nToo high complexity indicates that the class should be refactored into several smaller classes.\n\nUse the **Cyclomatic complexity limit** field below to specify the maximum allowed complexity for a class.\n\nInspection ID: ClassComplexity" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyComplexClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class metrics", + "index": 90, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ArrayLengthInLoopCondition", + "shortDescription": { + "text": "Array.length in loop condition" + }, + "fullDescription": { + "text": "Reports accesses to the '.length' property of an array in the condition part of a loop statement. In highly resource constrained environments, such calls may have adverse performance implications. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Example: 'void foo(Object[] x) {\n for (int i = 0; i < x.length; i++) { /**/ }\n }' Inspection ID: ArrayLengthInLoopCondition", + "markdown": "Reports accesses to the `.length` property of an array in the condition part of a loop statement. In highly resource constrained environments, such calls may have adverse performance implications.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n**Example:**\n\n\n void foo(Object[] x) {\n for (int i = 0; i < x.length; i++) { /**/ }\n }\n\nInspection ID: ArrayLengthInLoopCondition" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ArrayLengthInLoopCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckForOutOfMemoryOnLargeArrayAllocation", + "shortDescription": { + "text": "Large array allocation with no OutOfMemoryError check" + }, + "fullDescription": { + "text": "Reports large array allocations which do not check for 'java.lang.OutOfMemoryError'. In memory constrained environments, allocations of large data objects should probably be checked for memory depletion. This inspection is intended for Java ME and other highly resource constrained environments. Applying the results of this inspection without consideration might have negative effects on code clarity and design. Use the option to specify the maximum number of elements to allow in unchecked array allocations. Inspection ID: CheckForOutOfMemoryOnLargeArrayAllocation", + "markdown": "Reports large array allocations which do not check for `java.lang.OutOfMemoryError`. In memory constrained environments, allocations of large data objects should probably be checked for memory depletion.\n\n\nThis inspection is intended for Java ME and other highly resource constrained environments.\nApplying the results of this inspection without consideration might have negative effects on code clarity and design.\n\n\nUse the option to specify the maximum number of elements to allow in unchecked array allocations.\n\nInspection ID: CheckForOutOfMemoryOnLargeArrayAllocation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CheckForOutOfMemoryOnLargeArrayAllocation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance/Embedded", + "index": 18, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithoutConstructor", + "shortDescription": { + "text": "Class without constructor" + }, + "fullDescription": { + "text": "Reports classes without constructors. Some coding standards prohibit such classes. Inspection ID: ClassWithoutConstructor", + "markdown": "Reports classes without constructors.\n\nSome coding standards prohibit such classes.\n\n\nInspection ID: ClassWithoutConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithoutConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/JavaBeans issues", + "index": 35, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverflowingLoopIndex", + "shortDescription": { + "text": "Loop executes zero or billions of times" + }, + "fullDescription": { + "text": "Reports loops that cannot be completed without an index overflow or loops that don't loop at all. It usually happens because of a mistake in the update operation. Example: 'void foo(int s) {\n for (int i = s; i > 12; i++) { // i-- should be here\n System.out.println(i);\n }\n }' Inspection ID: OverflowingLoopIndex New in 2019.1", + "markdown": "Reports loops that cannot be completed without an index overflow or loops that don't loop at all. It usually happens because of a mistake in the update operation.\n\nExample:\n\n\n void foo(int s) {\n for (int i = s; i > 12; i++) { // i-- should be here\n System.out.println(i);\n }\n }\n\nInspection ID: OverflowingLoopIndex\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "OverflowingLoopIndex", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java9UndeclaredServiceUsage", + "shortDescription": { + "text": "Usage of service not declared in 'module-info'" + }, + "fullDescription": { + "text": "Reports situations in which a service is loaded with 'java.util.ServiceLoader' but it isn't declared with the 'uses' clause in the 'module-info.java' file and suggests inserting it. This inspection depends on the Java feature 'Modules', which is available since Java 9. Inspection ID: Java9UndeclaredServiceUsage New in 2018.1", + "markdown": "Reports situations in which a service is loaded with `java.util.ServiceLoader` but it isn't declared with the `uses` clause in the `module-info.java` file and suggests inserting it.\n\nThis inspection depends on the Java feature 'Modules', which is available since Java 9.\n\nInspection ID: Java9UndeclaredServiceUsage\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Java9UndeclaredServiceUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Visibility", + "index": 56, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InnerClassMayBeStatic", + "shortDescription": { + "text": "Inner class may be 'static'" + }, + "fullDescription": { + "text": "Reports inner classes that can be made 'static'. A 'static' inner class does not keep an implicit reference to its enclosing instance. When using Java 17 or before, this prevents a common cause of memory leaks and uses less memory per instance of the class. Example: 'public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' After the quick-fix is applied: 'public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }' Inspection ID: InnerClassMayBeStatic", + "markdown": "Reports inner classes that can be made `static`.\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nWhen using Java 17 or before,\nthis prevents a common cause of memory leaks and uses less memory per instance of the class.\n\n**Example:**\n\n\n public class Outer {\n class Inner { // not static\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Outer {\n static class Inner {\n public void foo() {\n bar(\"x\");\n }\n\n private void bar(String string) {}\n }\n }\n\nInspection ID: InnerClassMayBeStatic" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InnerClassMayBeStatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Memory", + "index": 69, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SetReplaceableByEnumSet", + "shortDescription": { + "text": "'Set' can be replaced with 'EnumSet'" + }, + "fullDescription": { + "text": "Reports instantiations of 'java.util.Set' objects whose content types are enumerated classes. Such 'Set' objects can be replaced with 'java.util.EnumSet' objects. 'EnumSet' implementations can be much more efficient compared to other sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to 'EnumSet.noneOf()'. This quick-fix is not available when the type of the variable is a sub-class of 'Set'. Example: 'enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();' After the quick-fix is applied: 'enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);' Inspection ID: SetReplaceableByEnumSet", + "markdown": "Reports instantiations of `java.util.Set` objects whose content types are enumerated classes. Such `Set` objects can be replaced with `java.util.EnumSet` objects.\n\n\n`EnumSet` implementations can be much more efficient compared to\nother sets, as the underlying data structure is a bit vector. Use the quick-fix to replace the initializer with a call to\n`EnumSet.noneOf()`. This quick-fix is not available when the type of the variable is a sub-class of `Set`.\n\n**Example:**\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = new HashSet();\n\nAfter the quick-fix is applied:\n\n\n enum MyEnum { FOO, BAR; }\n\n Set enums = EnumSet.noneOf(MyEnum.class);\n\nInspection ID: SetReplaceableByEnumSet" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SetReplaceableByEnumSet", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageInfoWithoutPackage", + "shortDescription": { + "text": "'package-info.java' without 'package' statement" + }, + "fullDescription": { + "text": "Reports 'package-info.java' files without a 'package' statement. The Javadoc tool considers such files documentation for the default package even when the file is located somewhere else. Inspection ID: PackageInfoWithoutPackage", + "markdown": "Reports `package-info.java` files without a `package` statement.\n\n\nThe Javadoc tool considers such files documentation for the default package even when the file is located somewhere else.\n\nInspection ID: PackageInfoWithoutPackage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PackageInfoWithoutPackage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CallToSimpleSetterInClass", + "shortDescription": { + "text": "Call to simple setter from within class" + }, + "fullDescription": { + "text": "Reports calls to a simple property setter from within the property's class. A simple property setter is defined as one which simply assigns the value of its parameter to a field, and does no other calculations. Such simple setter calls can be safely inlined. Some coding standards also suggest against the use of simple setters for code clarity reasons. Example: 'class Foo {\n private int index;\n public Foo(int idx) {\n setIndex(idx);\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }' After the quick-fix is applied: 'class Foo {\n private int index;\n public Foo(int idx) {\n index = idx;\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }' Use the following options to configure the inspection: Whether to only report setter calls on 'this', not on objects of the same type passed in as a parameter. Whether to ignore non-'private' setters. Inspection ID: CallToSimpleSetterInClass", + "markdown": "Reports calls to a simple property setter from within the property's class.\n\n\nA simple property setter is defined as one which simply assigns the value of its parameter to a field,\nand does no other calculations. Such simple setter calls can be safely inlined.\nSome coding standards also suggest against the use of simple setters for code clarity reasons.\n\n**Example:**\n\n\n class Foo {\n private int index;\n public Foo(int idx) {\n setIndex(idx);\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n private int index;\n public Foo(int idx) {\n index = idx;\n }\n public void setIndex(int idx) {\n index = idx;\n }\n }\n\nUse the following options to configure the inspection:\n\n* Whether to only report setter calls on `this`, not on objects of the same type passed in as a parameter.\n* Whether to ignore non-`private` setters.\n\nInspection ID: CallToSimpleSetterInClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToSimpleSetterFromWithinClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonSerializableWithSerializationMethods", + "shortDescription": { + "text": "Non-serializable class with 'readObject()' or 'writeObject()'" + }, + "fullDescription": { + "text": "Reports non-'Serializable' classes that define 'readObject()' or 'writeObject()' methods. Such methods in that context normally indicate an error. Example: 'public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }' Inspection ID: NonSerializableWithSerializationMethods", + "markdown": "Reports non-`Serializable` classes that define `readObject()` or `writeObject()` methods. Such methods in that context normally indicate an error.\n\n**Example:**\n\n\n public class SampleClass {\n private void readObject(ObjectInputStream str) {}\n private void writeObject(ObjectOutputStream str) {}\n }\n\nInspection ID: NonSerializableWithSerializationMethods" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonSerializableClassWithSerializationMethods", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CloneReturnsClassType", + "shortDescription": { + "text": "'clone()' should have return type equal to the class it contains" + }, + "fullDescription": { + "text": "Reports 'clone()' methods with return types different from the class they're located in. Often a 'clone()' method will have a return type of 'java.lang.Object', which makes it harder to use by its clients. Effective Java (the second and third editions) recommends making the return type of the 'clone()' method the same as the class type of the object it returns. Example: 'class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' After the quick-fix is applied: 'class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }' Inspection ID: CloneReturnsClassType", + "markdown": "Reports `clone()` methods with return types different from the class they're located in.\n\nOften a `clone()` method will have a return type of `java.lang.Object`, which makes it harder to use by its clients.\n*Effective Java* (the second and third editions) recommends making the return type of the `clone()` method the same as the\nclass type of the object it returns.\n\n**Example:**\n\n\n class Foo implements Cloneable {\n public Object clone() {\n try {\n return super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo implements Cloneable {\n public Foo clone() {\n try {\n return (Foo)super.clone();\n } catch (CloneNotSupportedException e) {\n throw new AssertionError();\n }\n }\n }\n\nInspection ID: CloneReturnsClassType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CloneReturnsClassType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Cloning issues", + "index": 82, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OptionalToIf", + "shortDescription": { + "text": "'Optional' can be replaced with sequence of 'if' statements" + }, + "fullDescription": { + "text": "Reports 'Optional' call chains that can be replaced with a sequence of 'if' statements. Example: 'return Optional.ofNullable(name)\n .map(this::extractInitials)\n .map(initials -> initials.toUpperCase(Locale.ENGLISH))\n .orElseGet(this::getDefault);' After the quick-fix is applied: 'if (name != null) {\n String initials = extractInitials(name);\n if (initials != null) return initials.toUpperCase(Locale.ENGLISH);\n }\n return getDefault();' This inspection can help to downgrade for backward compatibility with earlier Java versions. This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalToIf New in 2020.2", + "markdown": "Reports `Optional` call chains that can be replaced with a sequence of `if` statements.\n\nExample:\n\n\n return Optional.ofNullable(name)\n .map(this::extractInitials)\n .map(initials -> initials.toUpperCase(Locale.ENGLISH))\n .orElseGet(this::getDefault);\n\nAfter the quick-fix is applied:\n\n\n if (name != null) {\n String initials = extractInitials(name);\n if (initials != null) return initials.toUpperCase(Locale.ENGLISH);\n }\n return getDefault();\n\n\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalToIf\n\nNew in 2020.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "OptionalToIf", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryFinalOnLocalVariableOrParameter", + "shortDescription": { + "text": "Unnecessary 'final' on local variable or parameter" + }, + "fullDescription": { + "text": "Reports local variables or parameters unnecessarily declared 'final'. Some coding standards frown upon variables declared 'final' for reasons of terseness. Example: 'class Foo {\n Foo(Object o) {}\n\n void bar(final Object o) {\n new Foo(o);\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo(Object o) {}\n\n void bar(Object o) {\n new Foo(o);\n }\n }' Use the inspection options to toggle the reporting for: local variables parameters (including parameters of 'catch' blocks and enhanced 'for' statements) Also, you can configure the inspection to only report 'final' parameters of 'abstract' or interface methods, which may be considered extra unnecessary as such markings don't affect the implementation of these methods. Inspection ID: UnnecessaryFinalOnLocalVariableOrParameter", + "markdown": "Reports local variables or parameters unnecessarily declared `final`.\n\nSome coding standards frown upon variables declared `final` for reasons of terseness.\n\n**Example:**\n\n\n class Foo {\n Foo(Object o) {}\n\n void bar(final Object o) {\n new Foo(o);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo(Object o) {}\n\n void bar(Object o) {\n new Foo(o);\n }\n }\n\n\nUse the inspection options to toggle the reporting for:\n\n* local variables\n* parameters (including parameters of `catch` blocks and enhanced `for` statements)\n\n\nAlso, you can configure the inspection to only report `final` parameters of `abstract` or interface\nmethods, which may be considered extra unnecessary as such markings don't\naffect the implementation of these methods.\n\nInspection ID: UnnecessaryFinalOnLocalVariableOrParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryFinalOnLocalVariableOrParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IllegalDependencyOnInternalPackage", + "shortDescription": { + "text": "Illegal dependency on internal package" + }, + "fullDescription": { + "text": "Reports references in modules without 'module-info.java' on packages which are not exported from named modules. Such configuration may occur when some modules in the project are already migrated to Java modules but others are still non-modular. By analogy to the JDK, such non-modular code should not get access to the code in named modules which is not explicitly exported. Inspection ID: IllegalDependencyOnInternalPackage", + "markdown": "Reports references in modules without `module-info.java` on packages which are not exported from named modules.\n\nSuch configuration may occur when some modules in the project are already migrated to Java modules but others are still non-modular.\nBy analogy to the JDK, such non-modular code should not get access to the code in named modules which is not explicitly exported.\n\nInspection ID: IllegalDependencyOnInternalPackage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "IllegalDependencyOnInternalPackage", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonBooleanMethodNameMayNotStartWithQuestion", + "shortDescription": { + "text": "Non-boolean method name must not start with question word" + }, + "fullDescription": { + "text": "Reports non-boolean methods whose names start with a question word. Such method names may be confusing. Non-boolean methods that override library methods are ignored by this inspection. Example: 'public void hasName(String name) {\n assert names.contains(name);\n }' A quick-fix that renames such methods is available only in the editor. Configure the inspection: Use the Boolean method name prefixes list to specify the question words that should be used only for boolean methods. Use the Ignore methods with 'java.lang.Boolean' return type option to ignore methods with 'java.lang.Boolean' return type. Use the Ignore methods overriding/implementing a super method option to ignore methods which have supers. Inspection ID: NonBooleanMethodNameMayNotStartWithQuestion", + "markdown": "Reports non-boolean methods whose names start with a question word. Such method names may be confusing.\n\nNon-boolean methods that override library methods are ignored by this inspection.\n\n**Example:**\n\n\n public void hasName(String name) {\n assert names.contains(name);\n }\n\nA quick-fix that renames such methods is available only in the editor.\n\nConfigure the inspection:\n\n* Use the **Boolean method name prefixes** list to specify the question words that should be used only for boolean methods.\n* Use the **Ignore methods with 'java.lang.Boolean' return type** option to ignore methods with `java.lang.Boolean` return type.\n* Use the **Ignore methods overriding/implementing a super method** option to ignore methods which have supers.\n\nInspection ID: NonBooleanMethodNameMayNotStartWithQuestion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonBooleanMethodNameMayNotStartWithQuestion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Method", + "index": 91, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WeakerAccess", + "shortDescription": { + "text": "Declaration access can be weaker" + }, + "fullDescription": { + "text": "Reports fields, methods or classes that may have their access modifier narrowed down. Example: 'class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }' After the quick-fix is applied: 'class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }' Use the inspection's options to define the rules for the modifier change suggestions. Inspection ID: WeakerAccess", + "markdown": "Reports fields, methods or classes that may have their access modifier narrowed down.\n\nExample:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n void bar(String x, String y) { } // can be private\n }\n\nAfter the quick-fix is applied:\n\n\n class Sample {\n void foo() {\n bar(\"foo\", \"foo\");\n }\n private void bar(String x, String y) { }\n }\n\nUse the inspection's options to define the rules for the modifier change suggestions.\n\nInspection ID: WeakerAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WeakerAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceWithJavadoc", + "shortDescription": { + "text": "Comment replaceable with Javadoc" + }, + "fullDescription": { + "text": "Reports a regular comment that belongs to a field, method, or class that can be replaced with a Javadoc comment. Example: 'public class Main {\n /*\n * Hello,\n */\n // World!\n void f() {\n }\n }' After the quick-fix is applied: 'public class Main {\n /**\n * Hello,\n * World!\n */\n void f() {\n }\n }' Inspection ID: ReplaceWithJavadoc", + "markdown": "Reports a regular comment that belongs to a field, method, or class that can be replaced with a Javadoc comment.\n\n**Example:**\n\n\n public class Main {\n /*\n * Hello,\n */\n // World!\n void f() {\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Main {\n /**\n * Hello,\n * World!\n */\n void f() {\n }\n }\n\nInspection ID: ReplaceWithJavadoc" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ReplaceWithJavadoc", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BigDecimalMethodWithoutRoundingCalled", + "shortDescription": { + "text": "Call to 'BigDecimal' method without a rounding mode argument" + }, + "fullDescription": { + "text": "Reports calls to 'divide()' or 'setScale()' without a rounding mode argument. Such calls can lead to an 'ArithmeticException' when the exact value cannot be represented in the result (for example, because it has a non-terminating decimal expansion). Specifying a rounding mode prevents the 'ArithmeticException'. Example: 'BigDecimal.valueOf(1).divide(BigDecimal.valueOf(3));' Inspection ID: BigDecimalMethodWithoutRoundingCalled", + "markdown": "Reports calls to `divide()` or `setScale()` without a rounding mode argument.\n\nSuch calls can lead to an `ArithmeticException` when the exact value cannot be represented in the result\n(for example, because it has a non-terminating decimal expansion).\n\nSpecifying a rounding mode prevents the `ArithmeticException`.\n\n**Example:**\n\n\n BigDecimal.valueOf(1).divide(BigDecimal.valueOf(3));\n\nInspection ID: BigDecimalMethodWithoutRoundingCalled" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "BigDecimalMethodWithoutRoundingCalled", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverlyComplexArithmeticExpression", + "shortDescription": { + "text": "Overly complex arithmetic expression" + }, + "fullDescription": { + "text": "Reports arithmetic expressions with the excessive number of terms. Such expressions might be hard to understand and might contain errors. Parameters, field references, and other primary expressions are counted as a term. Example: 'int calc(int a, int b) {\n return a + a + a + b + b + b + b; // The line contains 7 terms and will be reported.\n }' Use the field below to specify a number of terms allowed in arithmetic expressions. Inspection ID: OverlyComplexArithmeticExpression", + "markdown": "Reports arithmetic expressions with the excessive number of terms. Such expressions might be hard to understand and might contain errors.\n\nParameters, field references, and other primary expressions are counted as a term.\n\n**Example:**\n\n int calc(int a, int b) {\n return a + a + a + b + b + b + b; // The line contains 7 terms and will be reported.\n }\n\nUse the field below to specify a number of terms allowed in arithmetic expressions.\n\nInspection ID: OverlyComplexArithmeticExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverlyComplexArithmeticExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Numeric issues", + "index": 25, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DriverManagerGetConnection", + "shortDescription": { + "text": "Use of 'DriverManager' to get JDBC connection" + }, + "fullDescription": { + "text": "Reports any uses of 'java.sql.DriverManager' to acquire a JDBC connection. 'java.sql.DriverManager' has been superseded by 'javax.sql.Datasource', which allows for connection pooling and other optimizations. Example: 'Connection conn = DriverManager.getConnection(url, username, password);' Inspection ID: DriverManagerGetConnection", + "markdown": "Reports any uses of `java.sql.DriverManager` to acquire a JDBC connection.\n\n\n`java.sql.DriverManager`\nhas been superseded by `javax.sql.Datasource`, which\nallows for connection pooling and other optimizations.\n\n**Example:**\n\n Connection conn = DriverManager.getConnection(url, username, password);\n\nInspection ID: DriverManagerGetConnection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToDriverManagerGetConnection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Resource management", + "index": 47, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WrapperTypeMayBePrimitive", + "shortDescription": { + "text": "Wrapper type may be primitive" + }, + "fullDescription": { + "text": "Reports local variables of wrapper type that are mostly used as primitive types. In some cases, boxing can be source of significant performance penalty, especially in loops. Heuristics are applied to estimate the number of boxing operations. For example, conversions inside loops are considered as much more numerous. Example: 'public void example() {\n Integer value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}' After the quick-fix is applied: 'public void example() {\n int value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}' New in 2018.2 Inspection ID: WrapperTypeMayBePrimitive", + "markdown": "Reports local variables of wrapper type that are mostly used as primitive types.\n\nIn some cases, boxing can be source of significant performance penalty, especially in loops.\n\nHeuristics are applied to estimate the number of boxing operations. For example, conversions inside loops are considered\nas much more numerous.\n\n**Example:**\n\n public void example() {\n Integer value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}\n\nAfter the quick-fix is applied:\n\n public void example() {\n int value = 12;\n needBox(value);\n for (int i = 0; i < 10; i++) {\n // Loop usages considered as happening more often\n needPrimitive(value);\n }\n }\n\n void needPrimitive(int value) {}\n void needBox(Integer value) {}\n\n\nNew in 2018.2\n\nInspection ID: WrapperTypeMayBePrimitive" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "WrapperTypeMayBePrimitive", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyStatementBody", + "shortDescription": { + "text": "Statement with empty body" + }, + "fullDescription": { + "text": "Reports 'if', 'while', 'do', 'for', and 'switch' statements with empty bodies. While occasionally intended, such code is confusing and is often the result of a typo. This inspection is disabled in JSP files. Inspection ID: EmptyStatementBody", + "markdown": "Reports `if`, `while`, `do`, `for`, and `switch` statements with empty bodies.\n\nWhile occasionally intended, such code is confusing and is often the result of a typo.\n\nThis inspection is disabled in JSP files.\n\nInspection ID: EmptyStatementBody" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StatementWithEmptyBody", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyFinallyBlock", + "shortDescription": { + "text": "Empty 'finally' block" + }, + "fullDescription": { + "text": "Reports empty 'finally' blocks. Empty 'finally' blocks usually indicate coding errors. They may also remain after code refactoring and can safely be removed. This inspection doesn't report empty 'finally' blocks found in JSP files. Example: 'try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n\n }' After the quick-fix is applied: 'try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }' Inspection ID: EmptyFinallyBlock", + "markdown": "Reports empty `finally` blocks.\n\nEmpty `finally` blocks usually indicate coding errors. They may also remain after code refactoring and can safely be removed.\n\nThis inspection doesn't report empty `finally` blocks found in JSP files.\n\n**Example:**\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n Files.readString(Paths.get(\"in.txt\"));\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n\nInspection ID: EmptyFinallyBlock" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyFinallyBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InconsistentLanguageLevel", + "shortDescription": { + "text": "Inconsistent language level settings" + }, + "fullDescription": { + "text": "Reports modules which depend on other modules with a higher language level. Such dependencies should be removed or the language level of the module be increased. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: InconsistentLanguageLevel", + "markdown": "Reports modules which depend on other modules with a higher language level.\n\nSuch dependencies should be removed or the language level of the module be increased.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: InconsistentLanguageLevel" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InconsistentLanguageLevel", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Modularization issues", + "index": 66, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EnumerationCanBeIteration", + "shortDescription": { + "text": "Enumeration can be iteration" + }, + "fullDescription": { + "text": "Reports calls to 'Enumeration' methods that are used on collections and may be replaced with equivalent 'Iterator' constructs. Example: 'Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }' After the quick-fix is applied: 'Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }' Inspection ID: EnumerationCanBeIteration", + "markdown": "Reports calls to `Enumeration` methods that are used on collections and may be replaced with equivalent `Iterator` constructs.\n\n**Example:**\n\n\n Enumeration keys = map.keys();\n while (keys.hasMoreElements()) {\n String name = keys.nextElement();\n }\n\nAfter the quick-fix is applied:\n\n\n Iterator iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n String name = iterator.next();\n }\n\nInspection ID: EnumerationCanBeIteration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EnumerationCanBeIteration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadDumpStack", + "shortDescription": { + "text": "Call to 'Thread.dumpStack()'" + }, + "fullDescription": { + "text": "Reports usages of 'Thread.dumpStack()'. Such statements are often used for temporary debugging and should be either removed from the production code or replaced with a more robust logging facility. Inspection ID: ThreadDumpStack", + "markdown": "Reports usages of `Thread.dumpStack()`.\n\nSuch statements are often used for temporary debugging and should be either removed from the production code\nor replaced with a more robust logging facility.\n\nInspection ID: ThreadDumpStack" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToThreadDumpStack", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryBlockStatement", + "shortDescription": { + "text": "Unnecessary code block" + }, + "fullDescription": { + "text": "Reports code blocks that are redundant to the semantics of the program and can be replaced with their contents. The code blocks that are the bodies of 'if', 'do', 'while', or 'for' statements will not be reported by this inspection. Example: 'void foo() {\n { // unnecessary\n int result = call();\n analyze(result);\n } // unnecessary\n }' Configure the inspection: Use the Ignore branches of 'switch' statements option to ignore the code blocks that are used as branches of switch statements. Inspection ID: UnnecessaryBlockStatement", + "markdown": "Reports code blocks that are redundant to the semantics of the program and can be replaced with their contents.\n\nThe code blocks that are the bodies of `if`, `do`,\n`while`, or `for` statements will not be reported by this\ninspection.\n\nExample:\n\n\n void foo() {\n { // unnecessary\n int result = call();\n analyze(result);\n } // unnecessary\n }\n\nConfigure the inspection:\n\n\nUse the **Ignore branches of 'switch' statements** option to ignore the code blocks that are used as branches of switch statements.\n\n\nInspection ID: UnnecessaryBlockStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UnnecessaryCodeBlock", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FinalMethodInFinalClass", + "shortDescription": { + "text": "'final' method in 'final' class" + }, + "fullDescription": { + "text": "Reports 'final' methods in 'final' classes. Since 'final' classes cannot be inherited, marking a method as 'final' may be unnecessary and confusing. Example: 'record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n}'\n After the quick-fix is applied: 'record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n}' As shown in the example, a class can be marked as 'final' explicitly or implicitly. Inspection ID: FinalMethodInFinalClass", + "markdown": "Reports `final` methods in `final` classes.\n\nSince `final` classes cannot be inherited, marking a method as `final`\nmay be unnecessary and confusing.\n\n**Example:**\n\n record Bar(int a, int b) {\n public final int sum() { \n return a + b;\n }\n }\n\nAfter the quick-fix is applied:\n\n record Bar(int a, int b) {\n public int sum() { \n return a + b;\n }\n }\n\nAs shown in the example, a class can be marked as `final` explicitly or implicitly.\n\n\nInspection ID: FinalMethodInFinalClass" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FinalMethodInFinalClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FinalPrivateMethod", + "shortDescription": { + "text": "'private' method declared 'final'" + }, + "fullDescription": { + "text": "Reports methods that are marked with both 'final' and 'private' keywords. Since 'private' methods cannot be meaningfully overridden because of their visibility, declaring them 'final' is redundant. Inspection ID: FinalPrivateMethod", + "markdown": "Reports methods that are marked with both `final` and `private` keywords.\n\nSince `private` methods cannot be meaningfully overridden because of their visibility, declaring them\n`final` is redundant.\n\nInspection ID: FinalPrivateMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FinalPrivateMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FinalStaticMethod", + "shortDescription": { + "text": "'static' method declared 'final'" + }, + "fullDescription": { + "text": "Reports static methods that are marked as 'final'. Such code might indicate an error or an incorrect assumption about the effect of the 'final' keyword. Static methods are not subject to runtime polymorphism, so the only purpose of the 'final' keyword used with static methods is to ensure the method will not be hidden in a subclass. Inspection ID: FinalStaticMethod", + "markdown": "Reports static methods that are marked as `final`.\n\nSuch code might indicate an error or an incorrect assumption about the effect of the `final` keyword.\nStatic methods are not subject to runtime polymorphism, so the only purpose of the `final` keyword used with static methods\nis to ensure the method will not be hidden in a subclass.\n\n\nInspection ID: FinalStaticMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FinalStaticMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantTypeArguments", + "shortDescription": { + "text": "Redundant type arguments" + }, + "fullDescription": { + "text": "Reports calls to parametrized methods with explicit argument types that can be omitted since they will be unambiguously inferred by the compiler. Using redundant type arguments is unnecessary and makes the code less readable. Example: 'List list = Arrays.asList(\"Hello\", \"World\");' A quick-fix is provided to remove redundant type arguments: 'List list = Arrays.asList(\"Hello\", \"World\");' Inspection ID: RedundantTypeArguments", + "markdown": "Reports calls to parametrized methods with explicit argument types that can be omitted since they will be unambiguously inferred by the compiler.\n\n\nUsing redundant type arguments is unnecessary and makes the code less readable.\n\nExample:\n\n\n List list = Arrays.asList(\"Hello\", \"World\");\n\nA quick-fix is provided to remove redundant type arguments:\n\n\n List list = Arrays.asList(\"Hello\", \"World\");\n\nInspection ID: RedundantTypeArguments" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantTypeArguments", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldHasSetterButNoGetter", + "shortDescription": { + "text": "Field has setter but no getter" + }, + "fullDescription": { + "text": "Reports fields that have setter methods but no getter methods. In certain bean containers, when used within the Java beans specification, such fields might be difficult to work with. Inspection ID: FieldHasSetterButNoGetter", + "markdown": "Reports fields that have setter methods but no getter methods.\n\n\nIn certain bean containers, when used within the Java beans specification, such fields might be difficult\nto work with.\n\nInspection ID: FieldHasSetterButNoGetter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FieldHasSetterButNoGetter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/JavaBeans issues", + "index": 35, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryUnboxing", + "shortDescription": { + "text": "Unnecessary unboxing" + }, + "fullDescription": { + "text": "Reports unboxing, that is explicit unwrapping of wrapped primitive values. Unboxing is unnecessary as of Java 5 and later, and can safely be removed. Examples: 'Integer i = Integer.valueOf(42).intValue();' → 'Integer i = Integer.valueOf(42);' 'int k = Integer.valueOf(42).intValue();' → 'int k = Integer.valueOf(42);' (reports only when the Only report truly superfluously unboxed expressions option is not checked) Use the Only report truly superfluously unboxed expressions option to only report truly superfluous unboxing, where an unboxed value is immediately boxed either implicitly or explicitly. In this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing. This inspection only reports if the language level of the project or module is 5 or higher. Inspection ID: UnnecessaryUnboxing", + "markdown": "Reports unboxing, that is explicit unwrapping of wrapped primitive values.\n\nUnboxing is unnecessary as of Java 5 and later, and can safely be removed.\n\n**Examples:**\n\n* `Integer i = Integer.valueOf(42).intValue();` → `Integer i = Integer.valueOf(42);`\n* `int k = Integer.valueOf(42).intValue();` → `int k = Integer.valueOf(42);`\n\n (reports only when the **Only report truly superfluously unboxed expressions** option is not checked)\n\n\nUse the **Only report truly superfluously unboxed expressions** option to only report truly superfluous unboxing,\nwhere an unboxed value is immediately boxed either implicitly or explicitly.\nIn this case, the entire unboxing-boxing step can be removed. The inspection doesn't report simple explicit unboxing.\n\nThis inspection only reports if the language level of the project or module is 5 or higher.\n\nInspection ID: UnnecessaryUnboxing" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryUnboxing", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 5", + "index": 53, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RuntimeExecWithNonConstantString", + "shortDescription": { + "text": "Call to 'Runtime.exec()' with non-constant string" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.Runtime.exec()' which take a dynamically-constructed string as the command to execute. Constructed execution strings are a common source of security breaches. By default, this inspection ignores compile-time constants. Example: 'String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning' Use the inspection settings to consider any 'static' 'final' fields as constant. Be careful, because strings like the following will be ignored when the option is enabled: 'static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";' Inspection ID: RuntimeExecWithNonConstantString", + "markdown": "Reports calls to `java.lang.Runtime.exec()` which take a dynamically-constructed string as the command to execute.\n\n\nConstructed execution strings are a common source of security breaches.\nBy default, this inspection ignores compile-time constants.\n\n**Example:**\n\n\n String i = getUserInput();\n Runtime runtime = Runtime.getRuntime();\n runtime.exec(\"foo\" + i); // reports warning\n\n\nUse the inspection settings to consider any `static` `final` fields as constant.\nBe careful, because strings like the following will be ignored when the option is enabled:\n\n\n static final String COMMAND = \"ping \" + getDomainFromUserInput() + \"'\";\n\n\nInspection ID: RuntimeExecWithNonConstantString" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToRuntimeExecWithNonConstantString", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssignmentOrReturnOfFieldWithMutableType", + "shortDescription": { + "text": "Assignment or return of field with mutable type" + }, + "fullDescription": { + "text": "Reports return of, or assignment from a method parameter to a field of an array or a mutable type such as 'Collection', 'Date', 'Map', 'Calendar', etc. Because such types are mutable, this construct may result in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for performance reasons, it is inherently prone to bugs. The following mutable types are reported: 'java.util.Date' 'java.util.Calendar' 'java.util.Collection' 'java.util.Map' 'com.google.common.collect.Multimap' 'com.google.common.collect.Table' The quick-fix adds a call to the field's '.clone()' method for arrays or uses an unmodifiable collection wrapper. Example: 'import java.util.*;\n class Log {\n private String[] messages = {\"one\", \"two\", \"three\"};\n private Map map = new HashMap<>();\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n\n Map mapping() {\n return map; // warning: Return of Map field 'map'\n }\n }' After the quick-fix is applied: 'import java.util.*;\n class Log {\n String[] messages = {\"one\", \"two\", \"three\"};\n private Map map = new HashMap<>();\n\n String[] getMessages() {\n return messages.clone();\n }\n\n Map mapping() {\n return Collections.unmodifiableMap(map);\n }\n }' Use the Ignore assignments in and returns from private methods option to ignore assignments and returns in 'private' methods. Inspection ID: AssignmentOrReturnOfFieldWithMutableType", + "markdown": "Reports return of, or assignment from a method parameter to a field of an array or a mutable type such as `Collection`, `Date`, `Map`, `Calendar`, etc.\n\nBecause such types are mutable, this construct may\nresult in unexpected modifications of an object's state from outside the owning class. Although this construct may be useful for\nperformance reasons, it is inherently prone to bugs.\n\nThe following mutable types are reported:\n\n* `java.util.Date`\n* `java.util.Calendar`\n* `java.util.Collection`\n* `java.util.Map`\n* `com.google.common.collect.Multimap`\n* `com.google.common.collect.Table`\n\nThe quick-fix adds a call to the field's `.clone()` method for arrays or uses an unmodifiable collection wrapper.\n\n**Example:**\n\n\n import java.util.*;\n class Log {\n private String[] messages = {\"one\", \"two\", \"three\"};\n private Map map = new HashMap<>();\n\n String[] getMessages() {\n return messages; // warning: Return of String[] field 'messages'\n }\n\n Map mapping() {\n return map; // warning: Return of Map field 'map'\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import java.util.*;\n class Log {\n String[] messages = {\"one\", \"two\", \"three\"};\n private Map map = new HashMap<>();\n\n String[] getMessages() {\n return messages.clone();\n }\n\n Map mapping() {\n return Collections.unmodifiableMap(map);\n }\n }\n\nUse the **Ignore assignments in and returns from private methods** option to ignore assignments and returns in `private` methods.\n\nInspection ID: AssignmentOrReturnOfFieldWithMutableType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssignmentOrReturnOfFieldWithMutableType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Encapsulation", + "index": 59, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OptionalAssignedToNull", + "shortDescription": { + "text": "Null value for Optional type" + }, + "fullDescription": { + "text": "Reports 'null' assigned to an 'Optional' variable or returned from a method returning 'Optional'. It's recommended that you use 'Optional.empty()' (or 'Optional.absent()' for Guava) to denote an empty value. Example: 'Optional foo(boolean flag) {\n return flag ? Optional.of(42) : null;\n }' After the quick-fix is applied: 'Optional foo(boolean flag) {\n return flag ? Optional.of(42) : Optional.empty();\n }' Configure the inspection: Use the Report comparison of Optional with null option to also report comparisons like 'optional == null'. While in rare cases (e.g. lazily initialized optional field) this might be correct, optional variable is usually never null, and probably 'optional.isPresent()' was intended. New in 2017.2 This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalAssignedToNull", + "markdown": "Reports `null` assigned to an `Optional` variable or returned from a method returning `Optional`.\n\nIt's recommended that you use `Optional.empty()` (or `Optional.absent()` for Guava) to denote an empty value.\n\nExample:\n\n\n Optional foo(boolean flag) {\n return flag ? Optional.of(42) : null;\n }\n\nAfter the quick-fix is applied:\n\n\n Optional foo(boolean flag) {\n return flag ? Optional.of(42) : Optional.empty();\n }\n\nConfigure the inspection:\n\n\nUse the **Report comparison of Optional with null** option to also report comparisons like `optional == null`. While in rare cases (e.g. lazily initialized\noptional field) this might be correct, optional variable is usually never null, and probably `optional.isPresent()` was\nintended.\n\nNew in 2017.2\n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalAssignedToNull" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OptionalAssignedToNull", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PointlessIndexOfComparison", + "shortDescription": { + "text": "Pointless 'indexOf()' comparison" + }, + "fullDescription": { + "text": "Reports unnecessary comparisons with '.indexOf()' expressions. An example of such an expression is comparing the result of '.indexOf()' with numbers smaller than -1. Inspection ID: PointlessIndexOfComparison", + "markdown": "Reports unnecessary comparisons with `.indexOf()` expressions. An example of such an expression is comparing the result of `.indexOf()` with numbers smaller than -1.\n\nInspection ID: PointlessIndexOfComparison" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PointlessIndexOfComparison", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ErrorRethrown", + "shortDescription": { + "text": "'Error' not rethrown" + }, + "fullDescription": { + "text": "Reports 'try' statements that catch 'java.lang.Error' or any of its subclasses and do not rethrow the error. Statements that catch 'java.lang.ThreadDeath' are not reported. Example: 'try {\n executeTests(request);\n }\n catch (OutOfMemoryError ex) { // warning: Error 'ex' not rethrown\n return false;\n }' Inspection ID: ErrorRethrown", + "markdown": "Reports `try` statements that catch `java.lang.Error` or any of its subclasses and do not rethrow the error.\n\nStatements that catch `java.lang.ThreadDeath` are not\nreported.\n\n**Example:**\n\n\n try {\n executeTests(request);\n }\n catch (OutOfMemoryError ex) { // warning: Error 'ex' not rethrown\n return false;\n }\n\nInspection ID: ErrorRethrown" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ErrorNotRethrown", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EqualsAndHashcode", + "shortDescription": { + "text": "'equals()' and 'hashCode()' not paired" + }, + "fullDescription": { + "text": "Reports classes that override the 'equals()' method but do not override the 'hashCode()' method or vice versa, which can potentially lead to problems when the class is added to a 'Collection' or a 'HashMap'. The quick-fix generates the default implementation for an absent method. Example: 'class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n}' After the quick-fix is applied: 'class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof StringHolder)) return false;\n\n StringHolder holder = (StringHolder)o;\n\n if (s != null ? !s.equals(holder.s) : holder.s != null) return false;\n\n return true;\n }\n}' Inspection ID: EqualsAndHashcode", + "markdown": "Reports classes that override the `equals()` method but do not override the `hashCode()` method or vice versa, which can potentially lead to problems when the class is added to a `Collection` or a `HashMap`.\n\nThe quick-fix generates the default implementation for an absent method.\n\nExample:\n\n\n class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class StringHolder {\n String s;\n\n @Override public int hashCode() {\n return s != null ? s.hashCode() : 0;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof StringHolder)) return false;\n\n StringHolder holder = (StringHolder)o;\n\n if (s != null ? !s.equals(holder.s) : holder.s != null) return false;\n\n return true;\n }\n }\n\nInspection ID: EqualsAndHashcode" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EqualsAndHashcode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IteratorHasNextCallsIteratorNext", + "shortDescription": { + "text": "'Iterator.hasNext()' which calls 'next()'" + }, + "fullDescription": { + "text": "Reports implementations of 'Iterator.hasNext()' or 'ListIterator.hasPrevious()' that call 'Iterator.next()' or 'ListIterator.previous()' on the iterator instance. Such calls are almost certainly an error, as methods like 'hasNext()' should not modify the iterators state, while 'next()' should. Example: 'class MyIterator implements Iterator {\n public boolean hasNext() {\n return next() != null;\n }\n }' Inspection ID: IteratorHasNextCallsIteratorNext", + "markdown": "Reports implementations of `Iterator.hasNext()` or `ListIterator.hasPrevious()` that call `Iterator.next()` or `ListIterator.previous()` on the iterator instance. Such calls are almost certainly an error, as methods like `hasNext()` should not modify the iterators state, while `next()` should.\n\n**Example:**\n\n\n class MyIterator implements Iterator {\n public boolean hasNext() {\n return next() != null;\n }\n }\n\nInspection ID: IteratorHasNextCallsIteratorNext" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "IteratorHasNextCallsIteratorNext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringRepeatCanBeUsed", + "shortDescription": { + "text": "String.repeat() can be used" + }, + "fullDescription": { + "text": "Reports loops that can be replaced with a single 'String.repeat()' method (available since Java 11). Example: 'void append(StringBuilder sb, int count, Object obj) {\n for (int i = 0; i < count; i++) {\n sb.append(obj);\n }\n }' After the quick-fix is applied: 'void append(StringBuilder sb, int count, Object obj) {\n sb.append(String.valueOf(obj).repeat(Math.max(0, count)));\n }' By default, the inspection may wrap 'count' with 'Math.max(0, count)' if it cannot prove statically that 'count' is not negative. This is done to prevent possible semantics change, as 'String.repeat()' rejects negative numbers. Use the Add Math.max(0,count) to avoid possible semantics change option to disable this behavior if required. Similarly, a string you want to repeat can be wrapped in 'String.valueOf' to prevent possible 'NullPointerException' if it's unknown whether it can be 'null'. This inspection only reports if the language level of the project or module is 11 or higher. Inspection ID: StringRepeatCanBeUsed New in 2019.1", + "markdown": "Reports loops that can be replaced with a single `String.repeat()` method (available since Java 11).\n\n**Example:**\n\n\n void append(StringBuilder sb, int count, Object obj) {\n for (int i = 0; i < count; i++) {\n sb.append(obj);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void append(StringBuilder sb, int count, Object obj) {\n sb.append(String.valueOf(obj).repeat(Math.max(0, count)));\n }\n\n\nBy default, the inspection may wrap `count` with `Math.max(0, count)` if it cannot prove statically that `count` is\nnot negative. This is done to prevent possible semantics change, as `String.repeat()` rejects negative numbers.\nUse the **Add Math.max(0,count) to avoid possible semantics change** option to disable this behavior if required.\n\nSimilarly, a string you want to repeat can be wrapped in\n`String.valueOf` to prevent possible `NullPointerException` if it's unknown whether it can be `null`.\n\nThis inspection only reports if the language level of the project or module is 11 or higher.\n\nInspection ID: StringRepeatCanBeUsed\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringRepeatCanBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 11", + "index": 125, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CyclicPackageDependency", + "shortDescription": { + "text": "Cyclic package dependency" + }, + "fullDescription": { + "text": "Reports packages that are mutually or cyclically dependent on other packages. Such cyclic dependencies make code fragile and hard to maintain. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: CyclicPackageDependency", + "markdown": "Reports packages that are mutually or cyclically dependent on other packages.\n\nSuch cyclic dependencies make code fragile and hard to maintain.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: CyclicPackageDependency" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CyclicPackageDependency", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Dependency issues", + "index": 93, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnsatisfiedRange", + "shortDescription": { + "text": "Return value is outside of declared range" + }, + "fullDescription": { + "text": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations: 'org.jetbrains.annotations.Range' from JetBrains annotations package (specify 'from' and 'to') 'org.checkerframework.common.value.qual.IntRange' from Checker Framework annotations package (specify 'from' and 'to') 'org.checkerframework.checker.index.qual.GTENegativeOne' from Checker Framework annotations package (range is '>= -1') 'org.checkerframework.checker.index.qual.NonNegative' from Checker Framework annotations package (range is '>= 0') 'org.checkerframework.checker.index.qual.Positive' from Checker Framework annotations package (range is '> 0') 'javax.annotation.Nonnegative' from JSR 305 annotations package (range is '>= 0') 'javax.validation.constraints.Min' (specify minimum value) 'javax.validation.constraints.Max' (specify maximum value) Example: '@Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }' Inspection ID: UnsatisfiedRange New in 2021.2", + "markdown": "Reports numeric values returned from methods that don't conform to the declared method return range. You can declare method return range using a number of annotations:\n\n* `org.jetbrains.annotations.Range` from JetBrains annotations package (specify 'from' and 'to')\n* `org.checkerframework.common.value.qual.IntRange` from Checker Framework annotations package (specify 'from' and 'to')\n* `org.checkerframework.checker.index.qual.GTENegativeOne` from Checker Framework annotations package (range is '\\>= -1')\n* `org.checkerframework.checker.index.qual.NonNegative` from Checker Framework annotations package (range is '\\>= 0')\n* `org.checkerframework.checker.index.qual.Positive` from Checker Framework annotations package (range is '\\> 0')\n* `javax.annotation.Nonnegative` from JSR 305 annotations package (range is '\\>= 0')\n* `javax.validation.constraints.Min` (specify minimum value)\n* `javax.validation.constraints.Max` (specify maximum value)\n\nExample:\n\n\n @Range(from = 0, to = Integer.MAX_VALUE) int getValue() {\n // Warning: -1 is outside of declared range\n return -1;\n }\n\nInspection ID: UnsatisfiedRange\n\nNew in 2021.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnsatisfiedRange", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SystemSetSecurityManager", + "shortDescription": { + "text": "Call to 'System.setSecurityManager()'" + }, + "fullDescription": { + "text": "Reports calls to 'System.setSecurityManager()'. While often benign, any call to 'System.setSecurityManager()' should be closely examined in any security audit. Inspection ID: SystemSetSecurityManager", + "markdown": "Reports calls to `System.setSecurityManager()`.\n\nWhile often benign, any call to `System.setSecurityManager()` should be closely examined in any security audit.\n\nInspection ID: SystemSetSecurityManager" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CallToSystemSetSecurityManager", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithoutNoArgConstructor", + "shortDescription": { + "text": "Class without no-arg constructor" + }, + "fullDescription": { + "text": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection. Example: 'public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }' Use the checkbox below to ignore classes without explicit constructors. The compiler provides a default no-arg constructor to such classes. Inspection ID: ClassWithoutNoArgConstructor", + "markdown": "Reports classes without a constructor that takes no arguments (i.e. has no parameters). No-arg constructors are necessary in some contexts. For example, if a class needs to be created using reflection.\n\n**Example:**\n\n\n public class Bean {\n private String name;\n\n public Bean(String name) {\n this.name = name;\n }\n }\n\n\nUse the checkbox below to ignore classes without explicit constructors.\nThe compiler provides a default no-arg constructor to such classes.\n\nInspection ID: ClassWithoutNoArgConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithoutNoArgConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/JavaBeans issues", + "index": 35, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassWithTooManyDependencies", + "shortDescription": { + "text": "Class with too many dependencies" + }, + "fullDescription": { + "text": "Reports classes that are directly dependent on too many other classes in the project. Modifications to any dependency of such classes may require changing the class, thus making it prone to instability. Only top-level classes are reported. Use the Maximum number of dependencies field to specify the maximum allowed number of dependencies for a class. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: ClassWithTooManyDependencies", + "markdown": "Reports classes that are directly dependent on too many other classes in the project.\n\nModifications to any dependency of such classes may require changing the class, thus making it prone to instability.\n\nOnly top-level classes are reported.\n\nUse the **Maximum number of dependencies** field to specify the maximum allowed number of dependencies for a class.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: ClassWithTooManyDependencies" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithTooManyDependencies", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Dependency issues", + "index": 93, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CastConflictsWithInstanceof", + "shortDescription": { + "text": "Cast conflicts with 'instanceof'" + }, + "fullDescription": { + "text": "Reports type cast expressions that are preceded by an 'instanceof' check for a different type. Although this might be intended, such a construct is most likely an error, and will result in a 'java.lang.ClassCastException' at runtime. Example: 'class Main {\n int whenCharSequenceCastToNumber(Object o){\n if (o instanceof CharSequence) {\n return ((Number) o).intValue();\n }\n return 0;\n }\n\n int earlyReturnWhenNotCharSequence(Object o){\n if (!(o instanceof CharSequence)) return 0;\n return ((Number)o).intValue();\n }\n }' Inspection ID: CastConflictsWithInstanceof", + "markdown": "Reports type cast expressions that are preceded by an `instanceof` check for a different type.\n\n\nAlthough this might be intended, such a construct is most likely an error, and will\nresult in a `java.lang.ClassCastException` at runtime.\n\n**Example:**\n\n\n class Main {\n int whenCharSequenceCastToNumber(Object o){\n if (o instanceof CharSequence) {\n return ((Number) o).intValue();\n }\n return 0;\n }\n\n int earlyReturnWhenNotCharSequence(Object o){\n if (!(o instanceof CharSequence)) return 0;\n return ((Number)o).intValue();\n }\n }\n\nInspection ID: CastConflictsWithInstanceof" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CastConflictsWithInstanceof", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MathRoundingWithIntArgument", + "shortDescription": { + "text": "Call math rounding with 'int' argument" + }, + "fullDescription": { + "text": "Reports calls to 'round()', 'ceil()', 'floor()', 'rint()' methods for 'Math' and 'StrictMath' with 'int' as the argument. These methods could be called in case the argument is expected to be 'long' or 'double', and it may have unexpected results. The inspection provides a fix that simplify such expressions (except 'round') to cast to 'double'. Example: 'int i = 2;\n double d1 = Math.floor(i);' After the quick-fix is applied: 'int i = 2;\n double d1 = i;' Inspection ID: MathRoundingWithIntArgument New in 2023.1", + "markdown": "Reports calls to `round()`, `ceil()`, `floor()`, `rint()` methods for `Math` and `StrictMath` with `int` as the argument.\n\nThese methods could be called in case the argument is expected to be `long` or `double`, and it may have unexpected results.\n\nThe inspection provides a fix that simplify such expressions (except `round`) to cast to `double`.\n\n**Example:**\n\n\n int i = 2;\n double d1 = Math.floor(i);\n\nAfter the quick-fix is applied:\n\n\n int i = 2;\n double d1 = i;\n\nInspection ID: MathRoundingWithIntArgument\n\nNew in 2023.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MathRoundingWithIntArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NewExceptionWithoutArguments", + "shortDescription": { + "text": "Exception constructor called without arguments" + }, + "fullDescription": { + "text": "Reports creation of a exception instance without any arguments specified. When an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes debugging needlessly hard. Example: 'throw new IOException(); // warning: exception without arguments' Inspection ID: NewExceptionWithoutArguments", + "markdown": "Reports creation of a exception instance without any arguments specified.\n\nWhen an exception is constructed without any arguments, it contains no information about the problem that occurred, which makes\ndebugging needlessly hard.\n\n**Example:**\n\n\n throw new IOException(); // warning: exception without arguments\n\nInspection ID: NewExceptionWithoutArguments" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NewExceptionWithoutArguments", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Error handling", + "index": 15, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Contract", + "shortDescription": { + "text": "Contract issues" + }, + "fullDescription": { + "text": "Reports issues in method '@Contract' annotations. The types of issues that can be reported are: Errors in contract syntax Contracts that do not conform to the method signature (wrong parameter count) Method implementations that contradict the contract (e.g. return 'true' when the contract says 'false') Example: '// method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }' Inspection ID: Contract", + "markdown": "Reports issues in method `@Contract` annotations. The types of issues that can be reported are:\n\n* Errors in contract syntax\n* Contracts that do not conform to the method signature (wrong parameter count)\n* Method implementations that contradict the contract (e.g. return `true` when the contract says `false`)\n\nExample:\n\n\n // method has no parameters, but contract expects 1\n @Contract(\"_ -> fail\")\n void x() {\n throw new AssertionError();\n }\n\nInspection ID: Contract" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Contract", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EnhancedSwitchBackwardMigration", + "shortDescription": { + "text": "Enhanced 'switch'" + }, + "fullDescription": { + "text": "Reports enhanced 'switch' statements and expressions. Suggests replacing them with regular 'switch' statements. Example: 'boolean even = switch (condition) {\n case 1, 3, 5, 7, 9 -> false;\n default -> true;\n };' After the quick-fix is applied: 'boolean even;\n switch (condition) {\n case 1:\n case 3:\n case 5:\n case 7:\n case 9:\n even = false;\n break;\n default:\n even = true;\n break;\n}' Enhanced 'switch' appeared in Java 14. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: EnhancedSwitchBackwardMigration New in 2019.1", + "markdown": "Reports enhanced `switch` statements and expressions. Suggests replacing them with regular `switch` statements.\n\n**Example:**\n\n\n boolean even = switch (condition) {\n case 1, 3, 5, 7, 9 -> false;\n default -> true;\n };\n\nAfter the quick-fix is applied:\n\n\n boolean even;\n switch (condition) {\n case 1:\n case 3:\n case 5:\n case 7:\n case 9:\n even = false;\n break;\n default:\n even = true;\n break;\n }\n\n\n*Enhanced* `switch` appeared in Java 14.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: EnhancedSwitchBackwardMigration\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EnhancedSwitchBackwardMigration", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 14", + "index": 106, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PackageWithTooManyClasses", + "shortDescription": { + "text": "Package with too many classes" + }, + "fullDescription": { + "text": "Reports packages that contain too many classes. Overly large packages may indicate a lack of design clarity. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Maximum number of classes field to specify the maximum allowed number of classes in a package. Inspection ID: PackageWithTooManyClasses", + "markdown": "Reports packages that contain too many classes.\n\nOverly large packages may indicate a lack of design clarity.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Maximum number of classes** field to specify the maximum allowed number of classes in a package.\n\nInspection ID: PackageWithTooManyClasses" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PackageWithTooManyClasses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Packaging issues", + "index": 38, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LoggingGuardedByCondition", + "shortDescription": { + "text": "Logging calls guarded by log condition" + }, + "fullDescription": { + "text": "Reports logging calls surrounded with a guard condition. This inspection can be used to adjust with a custom code style. Example: 'public class TestObject {\n void test(Object object) {\n if(LOG.isDebugEnabled()){\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }\n }' After a quick-fix is applied: 'public class TestObject {\n void test(Object object) {\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }' This inspection supports Log4j2 and the SLF4J logging frameworks (except builders). Inspection ID: LoggingGuardedByCondition New in 2024.2", + "markdown": "Reports logging calls surrounded with a guard condition. This inspection can be used to adjust with a custom code style.\n\n**Example:**\n\n\n public class TestObject {\n void test(Object object) {\n if(LOG.isDebugEnabled()){\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }\n }\n\nAfter a quick-fix is applied:\n\n\n public class TestObject {\n void test(Object object) {\n LOG.debug(\"some logging \" + expensiveCalculation(1));\n }\n }\n\nThis inspection supports *Log4j2* and the *SLF4J* logging frameworks (except builders).\n\nInspection ID: LoggingGuardedByCondition\n\nNew in 2024.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "LoggingGuardedByCondition", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages/Logging", + "index": 46, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TryFinallyCanBeTryWithResources", + "shortDescription": { + "text": "'try finally' can be replaced with 'try' with resources" + }, + "fullDescription": { + "text": "Reports 'try'-'finally' statements that can use Java 7 Automatic Resource Management, which is less error-prone. A quick-fix is available to convert a 'try'-'finally' statement into a 'try'-with-resources statement. Example: 'PrintStream printStream = new PrintStream(fileName);\n try {\n printStream.print(true);\n } finally {\n printStream.close();\n }' A quick-fix is provided to pass the cause to a constructor: 'try (PrintStream printStream = new PrintStream(fileName)) {\n printStream.print(true);\n }' This inspection depends on the Java feature 'Try-with-resources', which is available since Java 7. Inspection ID: TryFinallyCanBeTryWithResources", + "markdown": "Reports `try`-`finally` statements that can use Java 7 Automatic Resource Management, which is less error-prone.\n\nA quick-fix is available to convert a `try`-`finally`\nstatement into a `try`-with-resources statement.\n\n**Example:**\n\n\n PrintStream printStream = new PrintStream(fileName);\n try {\n printStream.print(true);\n } finally {\n printStream.close();\n }\n\nA quick-fix is provided to pass the cause to a constructor:\n\n\n try (PrintStream printStream = new PrintStream(fileName)) {\n printStream.print(true);\n }\n\nThis inspection depends on the Java feature 'Try-with-resources', which is available since Java 7.\n\nInspection ID: TryFinallyCanBeTryWithResources" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TryFinallyCanBeTryWithResources", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 7", + "index": 118, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SynchronizationOnStaticField", + "shortDescription": { + "text": "Synchronization on 'static' field" + }, + "fullDescription": { + "text": "Reports synchronization on 'static' fields. While not strictly incorrect, synchronization on 'static' fields can lead to bad performance because of contention. Inspection ID: SynchronizationOnStaticField", + "markdown": "Reports synchronization on `static` fields. While not strictly incorrect, synchronization on `static` fields can lead to bad performance because of contention.\n\nInspection ID: SynchronizationOnStaticField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SynchronizationOnStaticField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwitchStatementWithConfusingDeclaration", + "shortDescription": { + "text": "Local variable used and declared in different 'switch' branches" + }, + "fullDescription": { + "text": "Reports local variables declared in one branch of a 'switch' statement and used in another branch. Such declarations can be extremely confusing. Example: 'switch(i) {\n case 2:\n int x = 0;\n break;\n case 3:\n x = 3;\n System.out.println(x);\n break;\n }' Inspection ID: SwitchStatementWithConfusingDeclaration", + "markdown": "Reports local variables declared in one branch of a `switch` statement and used in another branch. Such declarations can be extremely confusing.\n\nExample:\n\n\n switch(i) {\n case 2:\n int x = 0;\n break;\n case 3:\n x = 3;\n System.out.println(x);\n break;\n }\n\nInspection ID: SwitchStatementWithConfusingDeclaration" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "LocalVariableUsedAndDeclaredInDifferentSwitchBranches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticImportCanBeUsed", + "shortDescription": { + "text": "Static import can be used" + }, + "fullDescription": { + "text": "Reports qualifiers, which can be replaced with 'on-demand import static' statements. The list of classes that will be checked can be configured in Settings | Editor | General | Auto Import | Java | Include auto-import of static members in completion Inspection ID: StaticImportCanBeUsed New in 2025.1", + "markdown": "Reports qualifiers, which can be replaced with `on-demand import static` statements. The list of classes that will be checked can be configured in [Settings \\| Editor \\| General \\| Auto Import \\| Java \\| Include auto-import of static members in\ncompletion](settings://editor.preferences.import)\n\nInspection ID: StaticImportCanBeUsed\n\nNew in 2025.1" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StaticImportCanBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Imports", + "index": 21, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SamePackageImport", + "shortDescription": { + "text": "Unnecessary import from the same package" + }, + "fullDescription": { + "text": "Reports 'import' statements that refer to the same package as the containing file. Same-package files are always implicitly imported, so such 'import' statements are redundant and confusing. Since IntelliJ IDEA can automatically detect and fix such statements with its Optimize Imports command, this inspection is mostly useful for offline reporting on code bases that you don't intend to change. Inspection ID: SamePackageImport", + "markdown": "Reports `import` statements that refer to the same package as the containing file.\n\n\nSame-package files are always implicitly imported, so such `import`\nstatements are redundant and confusing.\n\n\nSince IntelliJ IDEA can automatically detect and fix such statements with its **Optimize Imports**\ncommand, this inspection is mostly useful for offline reporting on code bases that you\ndon't intend to change.\n\nInspection ID: SamePackageImport" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SamePackageImport", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Imports", + "index": 21, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadLocalSetWithNull", + "shortDescription": { + "text": "'ThreadLocal.set()' with null as an argument" + }, + "fullDescription": { + "text": "Reports 'java.lang.ThreadLocal.set()' with null as an argument. This call does not free the resources, and it may cause a memory leak. It may happen because: Firstly, 'ThreadLocal.set(null)' finds a map associated with the current Thread. If there is no such a map, it will be created It sets key and value: 'map.set(this, value)', where 'this' refers to instance of 'ThreadLocal' 'java.lang.ThreadLocal.remove()' should be used to free the resources. Example: 'ThreadLocal threadLocal = new ThreadLocal<>();\n threadLocal.set(null);' After the quick-fix is applied: 'threadLocal.remove();' Inspection ID: ThreadLocalSetWithNull New in 2023.2", + "markdown": "Reports `java.lang.ThreadLocal.set()` with null as an argument.\n\nThis call does not free the resources, and it may cause a memory leak.\nIt may happen because:\n\n* Firstly, `ThreadLocal.set(null)` finds a map associated with the current Thread. If there is no such a map, it will be created\n* It sets key and value: `map.set(this, value)`, where `this` refers to instance of `ThreadLocal`\n\n`java.lang.ThreadLocal.remove()` should be used to free the resources.\n\nExample:\n\n\n ThreadLocal threadLocal = new ThreadLocal<>();\n threadLocal.set(null);\n\nAfter the quick-fix is applied:\n\n\n threadLocal.remove();\n\nInspection ID: ThreadLocalSetWithNull\n\nNew in 2023.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "ThreadLocalSetWithNull", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldMayBeFinal", + "shortDescription": { + "text": "Field may be 'final'" + }, + "fullDescription": { + "text": "Reports fields that can be safely made 'final'. All 'final' fields have a value and this value does not change, which can make the code easier to reason about. To avoid too expensive analysis, this inspection only reports if the field has a 'private' modifier or it is defined in a local or anonymous class. A field can be 'final' if: It is 'static' and initialized once in its declaration or in one 'static' initializer. It is non-'static' and initialized once in its declaration, in one instance initializer or in every constructor And it is not modified anywhere else. Example: 'public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }' After the quick-fix is applied: 'public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }' Use the \"Annotations\" button to modify the list of annotations that assume implicit field write. Inspection ID: FieldMayBeFinal", + "markdown": "Reports fields that can be safely made `final`. All `final` fields have a value and this value does not change, which can make the code easier to reason about.\n\nTo avoid too expensive analysis, this inspection only reports if the field has a `private` modifier\nor it is defined in a local or anonymous class.\nA field can be `final` if:\n\n* It is `static` and initialized once in its declaration or in one `static` initializer.\n* It is non-`static` and initialized once in its declaration, in one instance initializer or in every constructor\n\nAnd it is not modified anywhere else.\n\n**Example:**\n\n\n public class Person {\n private String name; // can be final\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Person {\n private final String name;\n\n Person(String name) {\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n }\n\n\nUse the \"Annotations\" button to modify the list of annotations that assume implicit field write.\n\nInspection ID: FieldMayBeFinal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FieldMayBeFinal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingJavadoc", + "shortDescription": { + "text": "Missing Javadoc" + }, + "fullDescription": { + "text": "Reports missing Javadoc comments and tags. Example: '/**\n * Missing \"@param\" is reported (if configured).\n */\n public void sample(int param){\n }' The quick-fixes add missing tag or missing Javadoc comment: '/**\n * Missing \"@param\" is reported (if configured).\n * @param param\n */\n public void sample(int param){\n }' Inspection can be configured to ignore deprecated elements or simple accessor methods like 'getField()' or 'setField()'. You can also use options below to configure required tags and minimal required visibility for the specific code elements like method, field, class, package, module. Inspection ID: MissingJavadoc", + "markdown": "Reports missing Javadoc comments and tags.\n\nExample:\n\n\n /**\n * Missing \"@param\" is reported (if configured).\n */\n public void sample(int param){\n }\n\nThe quick-fixes add missing tag or missing Javadoc comment:\n\n\n /**\n * Missing \"@param\" is reported (if configured).\n * @param param\n */\n public void sample(int param){\n }\n\n\nInspection can be configured to ignore deprecated elements or simple accessor methods like `getField()` or `setField()`.\nYou can also use options below to configure required tags and minimal required visibility for the specific code elements like method, field, class, package, module.\n\nInspection ID: MissingJavadoc" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MissingJavadoc", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Javadoc", + "index": 45, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousArrayMethodCall", + "shortDescription": { + "text": "Suspicious 'Arrays' method call" + }, + "fullDescription": { + "text": "Reports calls to non-generic-array manipulation methods like 'Arrays.fill()' with mismatched argument types. Such calls don't do anything useful and are likely to be mistakes. Example: 'int foo(String[] strings) {\n return Arrays.binarySearch(strings, 1);\n }' Inspection ID: SuspiciousArrayMethodCall New in 2017.2", + "markdown": "Reports calls to non-generic-array manipulation methods like `Arrays.fill()` with mismatched argument types. Such calls don't do anything useful and are likely to be mistakes.\n\n**Example:**\n\n\n int foo(String[] strings) {\n return Arrays.binarySearch(strings, 1);\n }\n\nInspection ID: SuspiciousArrayMethodCall\n\nNew in 2017.2" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousArrayMethodCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassHasNoToStringMethod", + "shortDescription": { + "text": "Class does not override 'toString()' method" + }, + "fullDescription": { + "text": "Reports classes without a 'toString()' method. Inspection ID: ClassHasNoToStringMethod", + "markdown": "Reports classes without a `toString()` method.\n\nInspection ID: ClassHasNoToStringMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassHasNoToStringMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/toString() issues", + "index": 123, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AwaitWithoutCorrespondingSignal", + "shortDescription": { + "text": "'await()' without corresponding 'signal()'" + }, + "fullDescription": { + "text": "Reports calls to 'Condition.await()', for which no call to a corresponding 'Condition.signal()' or 'Condition.signalAll()' can be found. Calling 'Condition.await()' in a thread without corresponding 'Condition.signal()' may cause the thread to become disabled until it is interrupted or \"spurious wakeup\" occurs. Only calls that target fields of the current class are reported by this inspection. Example: 'class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n // isEmpty.signal();\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n isEmpty.await(); // 'await()' doesn't contain corresponding 'signal()'/'signalAll()' call\n // ...\n }\n }' Inspection ID: AwaitWithoutCorrespondingSignal", + "markdown": "Reports calls to `Condition.await()`, for which no call to a corresponding `Condition.signal()` or `Condition.signalAll()` can be found.\n\n\nCalling `Condition.await()` in a thread without corresponding `Condition.signal()` may cause the thread\nto become disabled until it is interrupted or \"spurious wakeup\" occurs.\n\nOnly calls that target fields of the current class are reported by this inspection.\n\n**Example:**\n\n\n class Queue {\n private final Condition isEmpty = ...;\n\n void add(Object elem) {\n // ...\n // isEmpty.signal();\n // ...\n }\n\n void remove(Object elem) throws InterruptedException {\n // ...\n isEmpty.await(); // 'await()' doesn't contain corresponding 'signal()'/'signalAll()' call\n // ...\n }\n }\n\nInspection ID: AwaitWithoutCorrespondingSignal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AwaitWithoutCorrespondingSignal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryLocalVariable", + "shortDescription": { + "text": "Redundant local variable" + }, + "fullDescription": { + "text": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including: Local variables that are immediately returned. Local variables that are immediately assigned to another variable and then not used. Local variables that always have the same value as another local variable or parameter. Example: 'boolean yes() {\n boolean b = true;\n return b;\n }' After the quick-fix is applied: 'boolean yes() {\n return true;\n }' Configure the inspection: Use the Ignore immediately returned or thrown variables option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging. Use the Ignore variables which have an annotation option to ignore annotated variables. Inspection ID: UnnecessaryLocalVariable", + "markdown": "Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:\n\n* Local variables that are immediately returned.\n* Local variables that are immediately assigned to another variable and then not used.\n* Local variables that always have the same value as another local variable or parameter.\n\n**Example:**\n\n\n boolean yes() {\n boolean b = true;\n return b;\n }\n\nAfter the quick-fix is applied:\n\n\n boolean yes() {\n return true;\n }\n \nConfigure the inspection:\n\n* Use the **Ignore immediately returned or thrown variables** option to ignore immediately returned or thrown variables. Some coding styles suggest using such variables for clarity and ease of debugging.\n* Use the **Ignore variables which have an annotation** option to ignore annotated variables.\n\nInspection ID: UnnecessaryLocalVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryLocalVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Data flow", + "index": 22, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Java9RedundantRequiresStatement", + "shortDescription": { + "text": "Redundant 'requires' directive in module-info" + }, + "fullDescription": { + "text": "Reports redundant 'requires' directives in Java Platform Module System 'module-info.java' files. A 'requires' directive is redundant when a module 'A' requires a module 'B', but the code in module 'A' doesn't import any packages or classes from 'B'. Furthermore, all modules have an implicitly declared dependence on the 'java.base' module, therefore a 'requires java.base;' directive is always redundant. The quick-fix deletes the redundant 'requires' directive. If the deleted dependency re-exported modules that are actually used, the fix adds a 'requires' directives for these modules. This inspection only reports if the language level of the project or module is 9 or higher. New in 2017.1 Inspection ID: Java9RedundantRequiresStatement", + "markdown": "Reports redundant `requires` directives in Java Platform Module System `module-info.java` files. A `requires` directive is redundant when a module `A` requires a module `B`, but the code in module `A` doesn't import any packages or classes from `B`. Furthermore, all modules have an implicitly declared dependence on the `java.base` module, therefore a `requires java.base;` directive is always redundant.\n\n\nThe quick-fix deletes the redundant `requires` directive.\nIf the deleted dependency re-exported modules that are actually used, the fix adds a `requires` directives for these modules.\n\nThis inspection only reports if the language level of the project or module is 9 or higher.\n\nNew in 2017.1\n\nInspection ID: Java9RedundantRequiresStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Java9RedundantRequiresStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldAccessNotGuarded", + "shortDescription": { + "text": "Unguarded field access or method call" + }, + "fullDescription": { + "text": "Reports accesses of fields declared as '@GuardedBy' that are not guarded by an appropriate synchronization structure. Example: '@GuardedBy(\"this\")\n void x() {\n notify();\n }\n void y() {\n x(); // unguarded method call\n }' Supported '@GuardedBy' annotations are: 'net.jcip.annotations.GuardedBy' 'javax.annotation.concurrent.GuardedBy' 'org.apache.http.annotation.GuardedBy' 'com.android.annotations.concurrency.GuardedBy' 'androidx.annotation.GuardedBy' 'com.google.errorprone.annotations.concurrent.GuardedBy' Inspection ID: FieldAccessNotGuarded", + "markdown": "Reports accesses of fields declared as `@GuardedBy` that are not guarded by an appropriate synchronization structure.\n\nExample:\n\n\n @GuardedBy(\"this\")\n void x() {\n notify();\n }\n void y() {\n x(); // unguarded method call\n }\n\nSupported `@GuardedBy` annotations are:\n\n* `net.jcip.annotations.GuardedBy`\n* `javax.annotation.concurrent.GuardedBy`\n* `org.apache.http.annotation.GuardedBy`\n* `com.android.annotations.concurrency.GuardedBy`\n* `androidx.annotation.GuardedBy`\n* `com.google.errorprone.annotations.concurrent.GuardedBy`\n\nInspection ID: FieldAccessNotGuarded" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FieldAccessNotGuarded", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Concurrency annotation issues", + "index": 60, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BusyWait", + "shortDescription": { + "text": "Busy wait" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.Thread.sleep()' that occur inside loops. Such calls are indicative of \"busy-waiting\". Busy-waiting is often inefficient, and may result in unexpected deadlocks as busy-waiting threads do not release locked resources. Example: 'class X {\n volatile int x;\n public void waitX() throws Exception {\n while (x > 0) {\n Thread.sleep(10);//warning: Call to 'Thread.sleep()' in a loop, probably busy-waiting\n }\n }\n }' Inspection ID: BusyWait", + "markdown": "Reports calls to `java.lang.Thread.sleep()` that occur inside loops.\n\nSuch calls\nare indicative of \"busy-waiting\". Busy-waiting is often inefficient, and may result in unexpected deadlocks\nas busy-waiting threads do not release locked resources.\n\n**Example:**\n\n\n class X {\n volatile int x;\n public void waitX() throws Exception {\n while (x > 0) {\n Thread.sleep(10);//warning: Call to 'Thread.sleep()' in a loop, probably busy-waiting\n }\n }\n }\n\n\nInspection ID: BusyWait" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "BusyWait", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForLoopWithMissingComponent", + "shortDescription": { + "text": "'for' loop with missing components" + }, + "fullDescription": { + "text": "Reports 'for' loops that lack initialization, condition, or update clauses. Some coding styles prohibit such loops. Example: 'for (int i = 0;;i++) {\n // body\n }' Use the Ignore collection iterations option to ignore loops which use an iterator. This is a standard way to iterate over a collection in which the 'for' loop does not have an update clause. Inspection ID: ForLoopWithMissingComponent", + "markdown": "Reports `for` loops that lack initialization, condition, or update clauses. Some coding styles prohibit such loops.\n\nExample:\n\n\n for (int i = 0;;i++) {\n // body\n }\n\n\nUse the **Ignore collection iterations** option to ignore loops which use an iterator.\nThis is a standard way to iterate over a collection in which the `for` loop does not have an update clause.\n\n\nInspection ID: ForLoopWithMissingComponent" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ForLoopWithMissingComponent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicStaticArrayField", + "shortDescription": { + "text": "'public static' array field" + }, + "fullDescription": { + "text": "Reports 'public' 'static' array fields. Such fields are often used to store arrays of constant values. Still, they represent a security hazard, as their contents may be modified, even if the field is declared 'final'. Example: 'public static String[] allowedPasswords = {\"foo\", \"bar\"};' Inspection ID: PublicStaticArrayField", + "markdown": "Reports `public` `static` array fields.\n\n\nSuch fields are often used to store arrays of constant values. Still, they represent a security\nhazard, as their contents may be modified, even if the field is declared `final`.\n\n**Example:**\n\n\n public static String[] allowedPasswords = {\"foo\", \"bar\"};\n\n\nInspection ID: PublicStaticArrayField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PublicStaticArrayField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MagicNumber", + "shortDescription": { + "text": "Magic number" + }, + "fullDescription": { + "text": "Reports \"magic numbers\": numeric literals that are not named by a constant declaration. Using magic numbers can lead to unclear code, as well as errors if a magic number is changed in one location but remains unchanged not another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 0L, 1L, 2L, 0.0, 1.0, 0.0F and 1.0F are not reported by this inspection. Example: 'void checkFileSize(long bytes) {\n if (bytes > 1_048_576) {\n throw new IllegalArgumentException(\"too big\");\n }\n }' A quick-fix introduces a new constant: 'static final int MAX_SUPPORTED_FILE_SIZE = 1_048_576;\n\n void checkFileSize(long bytes) {\n if (bytes > MAX_SUPPORTED_FILE_SIZE) {\n throw new IllegalArgumentException(\"too big\");\n }\n }' Configure the inspection: Use the Ignore constants in 'hashCode()' methods option to disable this inspection within 'hashCode()' methods. Use the Ignore in annotations option to ignore magic numbers in annotations. Use the Ignore initial capacity for StringBuilders and Collections option to ignore magic numbers used as initial capacity when constructing 'Collection', 'Map', 'StringBuilder' or 'StringBuffer' objects. Inspection ID: MagicNumber", + "markdown": "Reports \"magic numbers\": numeric literals that are not named by a constant declaration.\n\nUsing magic numbers can lead to unclear code, as well as errors if a magic\nnumber is changed in one location but remains unchanged not another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 0L, 1L, 2L,\n0.0, 1.0, 0.0F and 1.0F are not reported by this inspection.\n\nExample:\n\n\n void checkFileSize(long bytes) {\n if (bytes > 1_048_576) {\n throw new IllegalArgumentException(\"too big\");\n }\n }\n\nA quick-fix introduces a new constant:\n\n\n static final int MAX_SUPPORTED_FILE_SIZE = 1_048_576;\n\n void checkFileSize(long bytes) {\n if (bytes > MAX_SUPPORTED_FILE_SIZE) {\n throw new IllegalArgumentException(\"too big\");\n }\n }\n\nConfigure the inspection:\n\n* Use the **Ignore constants in 'hashCode()' methods** option to disable this inspection within `hashCode()` methods.\n* Use the **Ignore in annotations** option to ignore magic numbers in annotations.\n* Use the **Ignore initial capacity for StringBuilders and Collections** option to ignore magic numbers used as initial capacity when constructing `Collection`, `Map`, `StringBuilder` or `StringBuffer` objects.\n\nInspection ID: MagicNumber" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MagicNumber", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Abstraction issues", + "index": 76, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverwrittenKey", + "shortDescription": { + "text": "Overwritten Map, Set, or array element" + }, + "fullDescription": { + "text": "Reports code that overwrites a 'Map' key, a 'Set' element, or an array element in a sequence of 'add'/'put' calls or using a Java 9 factory method like 'Set.of' (which will result in runtime exception). This usually occurs due to a copy-paste error. Example: 'map.put(\"A\", 1);\n map.put(\"B\", 2);\n map.put(\"C\", 3);\n map.put(\"D\", 4);\n map.put(\"A\", 5); // duplicating key \"A\", overwrites the previously written entry' Inspection ID: OverwrittenKey New in 2017.3", + "markdown": "Reports code that overwrites a `Map` key, a `Set` element, or an array element in a sequence of `add`/`put` calls or using a Java 9 factory method like `Set.of` (which will result in runtime exception).\n\nThis usually occurs due to a copy-paste error.\n\n**Example:**\n\n\n map.put(\"A\", 1);\n map.put(\"B\", 2);\n map.put(\"C\", 3);\n map.put(\"D\", 4);\n map.put(\"A\", 5); // duplicating key \"A\", overwrites the previously written entry\n\nInspection ID: OverwrittenKey\n\nNew in 2017.3" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "OverwrittenKey", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnonymousClassMethodCount", + "shortDescription": { + "text": "Anonymous class with too many methods" + }, + "fullDescription": { + "text": "Reports anonymous inner classes whose method count exceeds the specified maximum. Anonymous classes with numerous methods may be difficult to understand and should be promoted to become named inner classes. Use the Method count limit field to specify the maximum allowed number of methods in an anonymous inner class. Inspection ID: AnonymousClassMethodCount", + "markdown": "Reports anonymous inner classes whose method count exceeds the specified maximum.\n\nAnonymous classes with numerous methods may be\ndifficult to understand and should be promoted to become named inner classes.\n\nUse the **Method count limit** field to specify the maximum allowed number of methods in an anonymous inner class.\n\nInspection ID: AnonymousClassMethodCount" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AnonymousInnerClassWithTooManyMethods", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class metrics", + "index": 90, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EnumSwitchStatementWhichMissesCases", + "shortDescription": { + "text": "Enum 'switch' statement that misses case" + }, + "fullDescription": { + "text": "Reports 'switch' statements over enumerated types that are not exhaustive. Example: 'enum AlphaBetaGamma {\n A, B, C;\n\n void x(AlphaBetaGamma e) {\n switch (e) {\n\n }\n }\n }' After the quick-fix is applied: 'enum AlphaBetaGamma {\n A, B, C;\n\n void x(AlphaBetaGamma e) {\n switch (e) {\n case A -> {}\n case B -> {}\n case C -> {}\n }\n }\n }' Use the Ignore switch statements with a default branch option to ignore 'switch' statements that have a 'default' branch. This inspection depends on the Java feature 'Enums', which is available since Java 5. Inspection ID: EnumSwitchStatementWhichMissesCases", + "markdown": "Reports `switch` statements over enumerated types that are not exhaustive.\n\n**Example:**\n\n\n enum AlphaBetaGamma {\n A, B, C;\n\n void x(AlphaBetaGamma e) {\n switch (e) {\n\n }\n }\n }\n\nAfter the quick-fix is applied:\n\n\n enum AlphaBetaGamma {\n A, B, C;\n\n void x(AlphaBetaGamma e) {\n switch (e) {\n case A -> {}\n case B -> {}\n case C -> {}\n }\n }\n }\n\n\nUse the **Ignore switch statements with a default branch** option to ignore `switch`\nstatements that have a `default` branch.\n\n\nThis inspection depends on the Java feature 'Enums', which is available since Java 5.\n\nInspection ID: EnumSwitchStatementWhichMissesCases" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EnumSwitchStatementWhichMissesCases", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousIntegerDivAssignment", + "shortDescription": { + "text": "Suspicious integer division assignment" + }, + "fullDescription": { + "text": "Reports assignments whose right side is a division that shouldn't be truncated to integer. While occasionally intended, this construction is often buggy. Example: 'int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result' This code should be replaced with: 'int x = 18;\n x *= 3.0/2;' In the inspection options, you can disable warnings for suspicious but possibly correct divisions, for example, when the dividend can't be calculated statically. 'void calc(int d) {\n int x = 18;\n x *= d/2;\n }' New in 2019.2 Inspection ID: SuspiciousIntegerDivAssignment", + "markdown": "Reports assignments whose right side is a division that shouldn't be truncated to integer.\n\nWhile occasionally intended, this construction is often buggy.\n\n**Example:**\n\n\n int x = 18;\n x *= 3/2; // doesn't change x because of the integer division result\n\n\nThis code should be replaced with:\n\n\n int x = 18;\n x *= 3.0/2;\n\n\nIn the inspection options, you can disable warnings for suspicious but possibly correct divisions,\nfor example, when the dividend can't be calculated statically.\n\n\n void calc(int d) {\n int x = 18;\n x *= d/2;\n }\n\n\nNew in 2019.2\n\nInspection ID: SuspiciousIntegerDivAssignment" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousIntegerDivAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodWithMultipleLoops", + "shortDescription": { + "text": "Method with multiple loops" + }, + "fullDescription": { + "text": "Reports methods that contain more than one loop statement. Example: The method below will be reported because it contains two loops: 'void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }' The following method will also be reported because it contains a nested loop: 'void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }' Inspection ID: MethodWithMultipleLoops", + "markdown": "Reports methods that contain more than one loop statement.\n\n**Example:**\n\nThe method below will be reported because it contains two loops:\n\n\n void methodWithTwoLoops(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n System.out.println(i);\n }\n\n int j = 0;\n while (j < n2) {\n System.out.println(j);\n j++;\n }\n }\n\nThe following method will also be reported because it contains a nested loop:\n\n\n void methodWithNestedLoop(int n1, int n2) {\n for (int i = 0; i < n1; i++) {\n for (int j = 0; j < n2; j++) {\n System.out.println(i + j);\n }\n }\n }\n\nInspection ID: MethodWithMultipleLoops" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodWithMultipleLoops", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NegativelyNamedBooleanVariable", + "shortDescription": { + "text": "Negatively named boolean variable" + }, + "fullDescription": { + "text": "Reports negatively named variables, for example: 'disabled', 'hidden', or 'isNotChanged'. Usually, inverting the 'boolean' value and removing the negation from the name makes the code easier to understand. Example: 'boolean disabled = false;' Inspection ID: NegativelyNamedBooleanVariable", + "markdown": "Reports negatively named variables, for example: `disabled`, `hidden`, or `isNotChanged`.\n\nUsually, inverting the `boolean` value and removing the negation from the name makes the code easier to understand.\n\nExample:\n\n\n boolean disabled = false;\n\n\nInspection ID: NegativelyNamedBooleanVariable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NegativelyNamedBooleanVariable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Data flow", + "index": 22, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SleepWhileHoldingLock", + "shortDescription": { + "text": "Call to 'Thread.sleep()' while synchronized" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.Thread.sleep()' methods that occur within a 'synchronized' block or method. 'sleep()' within a 'synchronized' block may result in decreased performance, poor scalability, and possibly even deadlocking. Consider using 'wait()' instead, as it will release the lock held. Example: 'synchronized (lock) {\n Thread.sleep(100);\n }' Inspection ID: SleepWhileHoldingLock", + "markdown": "Reports calls to `java.lang.Thread.sleep()` methods that occur within a `synchronized` block or method.\n\n\n`sleep()` within a\n`synchronized` block may result in decreased performance, poor scalability, and possibly\neven deadlocking. Consider using `wait()` instead,\nas it will release the lock held.\n\n**Example:**\n\n\n synchronized (lock) {\n Thread.sleep(100);\n }\n\nInspection ID: SleepWhileHoldingLock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SleepWhileHoldingLock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Threading issues", + "index": 8, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DeprecatedClassUsageInspection", + "shortDescription": { + "text": "Deprecated API usage in XML" + }, + "fullDescription": { + "text": "Reports usages of deprecated classes and methods in XML files. Inspection ID: DeprecatedClassUsageInspection", + "markdown": "Reports usages of deprecated classes and methods in XML files.\n\nInspection ID: DeprecatedClassUsageInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DeprecatedClassUsageInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OptionalOfNullableMisuse", + "shortDescription": { + "text": "Use of Optional.ofNullable with null or not-null argument" + }, + "fullDescription": { + "text": "Reports uses of 'Optional.ofNullable()' where always null or always not-null argument is passed. There's no point in using 'Optional.ofNullable()' in this case: either 'Optional.empty()' or 'Optional.of()' should be used to explicitly state the intent of creating an always-empty or always non-empty optional respectively. It's also possible that there's a mistake in 'Optional.ofNullable()' argument, so it should be examined. Example: 'Optional empty = Optional.ofNullable(null); // should be Optional.empty();\nOptional present = Optional.ofNullable(\"value\"); // should be Optional.of(\"value\");' This inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8. Inspection ID: OptionalOfNullableMisuse", + "markdown": "Reports uses of `Optional.ofNullable()` where always null or always not-null argument is passed. There's no point in using `Optional.ofNullable()` in this case: either `Optional.empty()` or `Optional.of()` should be used to explicitly state the intent of creating an always-empty or always non-empty optional respectively. It's also possible that there's a mistake in `Optional.ofNullable()` argument, so it should be examined.\n\n\nExample:\n\n\n Optional empty = Optional.ofNullable(null); // should be Optional.empty();\n Optional present = Optional.ofNullable(\"value\"); // should be Optional.of(\"value\"); \n\nThis inspection depends on the Java feature 'Stream and Optional API', which is available since Java 8.\n\nInspection ID: OptionalOfNullableMisuse" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "OptionalOfNullableMisuse", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CastToIncompatibleInterface", + "shortDescription": { + "text": "Cast to incompatible type" + }, + "fullDescription": { + "text": "Reports type cast expressions where the casted expression has a class/interface type that neither extends/implements the cast class/interface type, nor has subclasses that do. Such a construct is likely erroneous, and will throw a 'java.lang.ClassCastException' at runtime. Example: 'interface A {}\n interface Z {}\n static class C {}\n\n void x(C c) {\n if (c instanceof Z) {\n A a = ((A)c); // cast to incompatible interface 'A'\n }\n }' Inspection ID: CastToIncompatibleInterface", + "markdown": "Reports type cast expressions where the casted expression has a class/interface type that neither extends/implements the cast class/interface type, nor has subclasses that do.\n\n\nSuch a construct is likely erroneous, and will\nthrow a `java.lang.ClassCastException` at runtime.\n\n**Example:**\n\n\n interface A {}\n interface Z {}\n static class C {}\n\n void x(C c) {\n if (c instanceof Z) {\n A a = ((A)c); // cast to incompatible interface 'A'\n }\n }\n\nInspection ID: CastToIncompatibleInterface" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CastToIncompatibleInterface", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MethodReturnAlwaysConstant", + "shortDescription": { + "text": "Method returns per-class constant" + }, + "fullDescription": { + "text": "Reports methods that only return a constant, which may differ for various inheritors. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Inspection ID: MethodReturnAlwaysConstant", + "markdown": "Reports methods that only return a constant, which may differ for various inheritors.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nInspection ID: MethodReturnAlwaysConstant" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodReturnAlwaysConstant", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicateBranchesInSwitch", + "shortDescription": { + "text": "Duplicate branches in 'switch'" + }, + "fullDescription": { + "text": "Reports 'switch' statements or expressions that contain the same code in different branches and suggests merging the duplicate branches. Example: 'switch (n) {\n case 1:\n System.out.println(n);\n break;\n case 2:\n System.out.println(n);\n break;\n default:\n System.out.println(\"default\");\n }' After the quick-fix is applied: 'switch (n) {\n case 1:\n case 2:\n System.out.println(n);\n break;\n default:\n System.out.println(\"default\");\n }' Inspection ID: DuplicateBranchesInSwitch New in 2019.1", + "markdown": "Reports `switch` statements or expressions that contain the same code in different branches and suggests merging the duplicate branches.\n\nExample:\n\n\n switch (n) {\n case 1:\n System.out.println(n);\n break;\n case 2:\n System.out.println(n);\n break;\n default:\n System.out.println(\"default\");\n }\n\nAfter the quick-fix is applied:\n\n\n switch (n) {\n case 1:\n case 2:\n System.out.println(n);\n break;\n default:\n System.out.println(\"default\");\n }\n\nInspection ID: DuplicateBranchesInSwitch\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "DuplicateBranchesInSwitch", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SingleElementAnnotation", + "shortDescription": { + "text": "Non-normalized annotation" + }, + "fullDescription": { + "text": "Reports annotations in a shorthand form and suggests rewriting them in a normal form with an attribute name. Example: '@SuppressWarnings(\"foo\")' After the quick-fix is applied: '@SuppressWarnings(value = \"foo\")' Inspection ID: SingleElementAnnotation", + "markdown": "Reports annotations in a shorthand form and suggests rewriting them in a normal form with an attribute name.\n\nExample:\n\n\n @SuppressWarnings(\"foo\")\n\nAfter the quick-fix is applied:\n\n\n @SuppressWarnings(value = \"foo\")\n\nInspection ID: SingleElementAnnotation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SingleElementAnnotation", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MigrateFromJavaLangIo", + "shortDescription": { + "text": "Method from 'System.out' can be used instead of 'java.lang.IO'" + }, + "fullDescription": { + "text": "Reports 'IO.println()' and 'IO.print()' calls and suggests replacing them with 'System.out' methods. This inspection helps migrate code from 'java.lang.IO' class back to traditional 'System.out' calls. Example: 'IO.println(\"Hello, World!\");' After the quick-fix is applied: 'System.out.println(\"Hello, World!\");' This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: MigrateFromJavaLangIo New in 2025.2", + "markdown": "Reports `IO.println()` and `IO.print()` calls and suggests replacing them with `System.out` methods.\n\n\nThis inspection helps migrate code from `java.lang.IO` class back to traditional `System.out` calls.\n\n\n**Example:**\n\n IO.println(\"Hello, World!\");\n\nAfter the quick-fix is applied:\n\n System.out.println(\"Hello, World!\");\n\n\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: MigrateFromJavaLangIo\n\nNew in 2025.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "MigrateFromJavaLangIo", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 25", + "index": 92, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ManualMinMaxCalculation", + "shortDescription": { + "text": "Manual min/max calculation" + }, + "fullDescription": { + "text": "Reports cases where the minimum or the maximum of two numbers can be calculated using a 'Math.max()' or 'Math.min()' call, instead of doing it manually. Example: 'public int min(int a, int b) {\n return b < a ? b : a;\n }' After the quick-fix is applied: 'public int min(int a, int b) {\n return Math.min(a, b);\n }' Use the Disable for float and double option to disable this inspection for 'double' and 'float' types. This is useful because the quick-fix may slightly change the semantics for 'float'/ 'double' types when handling 'NaN'. Nevertheless, in most cases this will actually fix a subtle bug where 'NaN' is not taken into account. Inspection ID: ManualMinMaxCalculation New in 2019.2", + "markdown": "Reports cases where the minimum or the maximum of two numbers can be calculated using a `Math.max()` or `Math.min()` call, instead of doing it manually.\n\n**Example:**\n\n\n public int min(int a, int b) {\n return b < a ? b : a;\n }\n\nAfter the quick-fix is applied:\n\n\n public int min(int a, int b) {\n return Math.min(a, b);\n }\n\n\nUse the **Disable for float and double** option to disable this inspection for `double` and `float` types.\nThis is useful because the quick-fix may slightly change the semantics for `float`/\n`double` types when handling `NaN`. Nevertheless, in most cases this will actually fix\na subtle bug where `NaN` is not taken into account.\n\nInspection ID: ManualMinMaxCalculation\n\nNew in 2019.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ManualMinMaxCalculation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifiableConditionalExpression", + "shortDescription": { + "text": "Simplifiable conditional expression" + }, + "fullDescription": { + "text": "Reports conditional expressions and suggests simplifying them. Examples: 'condition ? true : foo → condition || foo' 'condition ? false : foo → !condition && foo' 'condition ? foo : !foo → condition == foo' 'condition ? true : false → condition' 'a == b ? b : a → a' 'result != null ? result : null → result' Inspection ID: SimplifiableConditionalExpression", + "markdown": "Reports conditional expressions and suggests simplifying them.\n\nExamples:\n\n condition ? true : foo → condition || foo\n\n condition ? false : foo → !condition && foo\n\n condition ? foo : !foo → condition == foo\n\n condition ? true : false → condition\n\n a == b ? b : a → a\n\n result != null ? result : null → result\n\nInspection ID: SimplifiableConditionalExpression" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SimplifiableConditionalExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SillyAssignment", + "shortDescription": { + "text": "Variable is assigned to itself" + }, + "fullDescription": { + "text": "Reports assignments of a variable to itself. Example: 'a = a;' The quick-fix removes the assigment. Inspection ID: SillyAssignment", + "markdown": "Reports assignments of a variable to itself.\n\n**Example:**\n\n\n a = a;\n\nThe quick-fix removes the assigment.\n\nInspection ID: SillyAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SillyAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BoundedWildcard", + "shortDescription": { + "text": "Can use bounded wildcard" + }, + "fullDescription": { + "text": "Reports generic method parameters that can make use of bounded wildcards. Example: 'void process(Consumer consumer);' should be replaced with: 'void process(Consumer consumer);' This method signature is more flexible because it accepts more types: not only 'Consumer', but also 'Consumer'. Likewise, type parameters in covariant position: 'T produce(Producer p);' should be replaced with: 'T produce(Producer p);' To quote Joshua Bloch in Effective Java third Edition: Item 31: Use bounded wildcards to increase API flexibility Using wildcard types in your APIs, while tricky, makes the APIs far more flexible. If you write a library that will be widely used, the proper use of wildcard types should be considered mandatory. Remember the basic rule: producer-extends, consumer-super (PECS). Also remember that all Comparables and Comparators are consumers. Use the inspection options to toggle the reporting for: invariant classes. An example of an invariant class is 'java.util.List' because it both accepts values (via the 'List.add(T)' method) and produces values (via the 'T List.get()' method). On the other hand, 'contravariant' classes only receive values, for example, 'java.util.function.Consumer' with the only method 'accept(T)'. Similarly, 'covariant' classes only produce values, for example, 'java.util.function.Supplier' with the only method 'T get()'. People often use bounded wildcards in covariant/contravariant classes but avoid wildcards in invariant classes, for example, 'void process(List l)'. Disable this option to ignore such invariant classes and leave them rigidly typed, for example, 'void process(List l)'. 'private' methods, which can be considered as not a part of the public API instance methods Inspection ID: BoundedWildcard", + "markdown": "Reports generic method parameters that can make use of [bounded wildcards](https://en.wikipedia.org/wiki/Wildcard_(Java)).\n\n**Example:**\n\n\n void process(Consumer consumer);\n\nshould be replaced with:\n\n\n void process(Consumer consumer);\n\n\nThis method signature is more flexible because it accepts more types: not only\n`Consumer`, but also `Consumer`.\n\nLikewise, type parameters in covariant position:\n\n\n T produce(Producer p);\n\nshould be replaced with:\n\n\n T produce(Producer p);\n\n\nTo quote [Joshua Bloch](https://en.wikipedia.org/wiki/Joshua_Bloch#Effective_Java) in *Effective Java* third Edition:\n>\n> #### Item 31: Use bounded wildcards to increase API flexibility\n>\n> Using wildcard types in your APIs, while tricky, makes the APIs far more flexible. If you write a library that will be widely used, the proper use of wildcard types should be considered mandatory. Remember the basic rule: producer-extends, consumer-super (PECS). Also remember that all Comparables and Comparators are consumers.\n\n\nUse the inspection options to toggle the reporting for:\n\n*\n invariant classes. An example of an invariant class is `java.util.List` because it both accepts values\n (via the `List.add(T)` method)\n and produces values (via the `T List.get()` method).\n\n\n On the\n other hand, `contravariant` classes only receive values, for example, `java.util.function.Consumer`\n with the only method `accept(T)`. Similarly, `covariant` classes\n only produce values, for example, `java.util.function.Supplier`\n with the only method `T get()`.\n\n\n People often use bounded wildcards in covariant/contravariant\n classes but avoid wildcards in invariant classes, for example, `void process(List l)`.\n Disable this option to ignore such invariant classes and leave them rigidly typed, for example, `void\n process(List l)`.\n*\n `private` methods, which can be considered as not a part of the public API\n\n*\n instance methods\n\nInspection ID: BoundedWildcard" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BoundedWildcard", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnqualifiedMethodAccess", + "shortDescription": { + "text": "Instance method call not qualified with 'this'" + }, + "fullDescription": { + "text": "Reports calls to non-'static' methods on the same instance that are not qualified with 'this'. Example: 'class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }' After the quick-fix is applied: 'class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }' Inspection ID: UnqualifiedMethodAccess", + "markdown": "Reports calls to non-`static` methods on the same instance that are not qualified with `this`.\n\n**Example:**\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n bar();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n void bar() {}\n\n void foo() {\n this.bar();\n }\n }\n\nInspection ID: UnqualifiedMethodAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnqualifiedMethodAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InstanceofIncompatibleInterface", + "shortDescription": { + "text": "'instanceof' with incompatible type" + }, + "fullDescription": { + "text": "Reports 'instanceof' expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the 'instanceof' expression, nor has subclasses that do. Although it could be intended for e.g. library code, such a construct is likely erroneous, because no instance of any class declared in the project could pass this 'instanceof' test. Example: 'class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }' Inspection ID: InstanceofIncompatibleInterface", + "markdown": "Reports `instanceof` expressions where the expression that is checked has a class/interface type that neither extends/implements the class/interface type on the right-side of the `instanceof` expression, nor has subclasses that do.\n\n\nAlthough it could be intended for e.g. library code, such a construct is likely erroneous,\nbecause no instance of any class declared in the project could pass this `instanceof` test.\n\n**Example:**\n\n\n class Foo { }\n\n interface Bar { }\n \n class Main {\n void test(Foo f, Bar b) {\n if (f instanceof Bar) { // problem\n System.out.println(\"fail\");\n }\n if (b instanceof Foo) { // problem\n System.out.println(\"fail\");\n }\n }\n }\n\nInspection ID: InstanceofIncompatibleInterface" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InstanceofIncompatibleInterface", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FunctionalExpressionCanBeFolded", + "shortDescription": { + "text": "Functional expression can be folded" + }, + "fullDescription": { + "text": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation. Example: 'SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());' After the quick-fix is applied: 'SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);' This inspection reports only if the language level of the project or module is 8 or higher. Inspection ID: FunctionalExpressionCanBeFolded", + "markdown": "Reports method references or lambda expressions that point to a method of their own functional interface type and hence can be replaced with their qualifiers removing unnecessary object allocation.\n\nExample:\n\n\n SwingUtilities.invokeLater(r::run);\n SwingUtilities.invokeAndWait(() -> r.run());\n\nAfter the quick-fix is applied:\n\n\n SwingUtilities.invokeLater(r);\n SwingUtilities.invokeAndWait(r);\n\nThis inspection reports only if the language level of the project or module is 8 or higher.\n\nInspection ID: FunctionalExpressionCanBeFolded" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FunctionalExpressionCanBeFolded", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Declaration redundancy", + "index": 14, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InstanceVariableInitialization", + "shortDescription": { + "text": "Instance field may not be initialized" + }, + "fullDescription": { + "text": "Reports instance variables that may be uninitialized upon object initialization. Example: 'class Foo {\n public int bar;\n\n static { }\n }' Note that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables reported as initialized will always be initialized. Use the Ignore primitive fields option to ignore uninitialized primitive fields. Inspection ID: InstanceVariableInitialization", + "markdown": "Reports instance variables that may be uninitialized upon object initialization.\n\n**Example:**\n\n\n class Foo {\n public int bar;\n\n static { }\n }\n\nNote that this inspection uses a very conservative dataflow algorithm and may incorrectly report instance variables as uninitialized. Variables\nreported as initialized will always be initialized.\n\nUse the **Ignore primitive fields** option to ignore uninitialized primitive fields.\n\nInspection ID: InstanceVariableInitialization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InstanceVariableMayNotBeInitialized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CustomClassloader", + "shortDescription": { + "text": "Custom 'ClassLoader' is declared" + }, + "fullDescription": { + "text": "Reports user-defined subclasses of 'java.lang.ClassLoader'. While not necessarily representing a security hole, such classes should be thoroughly inspected for possible security issues. Inspection ID: CustomClassloader", + "markdown": "Reports user-defined subclasses of `java.lang.ClassLoader`.\n\n\nWhile not necessarily representing a security hole, such classes should be thoroughly\ninspected for possible security issues.\n\n\nInspection ID: CustomClassloader" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CustomClassloader", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Security", + "index": 31, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IfStatementWithTooManyBranches", + "shortDescription": { + "text": "'if' statement with too many branches" + }, + "fullDescription": { + "text": "Reports 'if' statements with too many branches. Such statements may be confusing and are often a sign of inadequate levels of design abstraction. Use the Maximum number of branches field to specify the maximum number of branches an 'if' statement is allowed to have. Inspection ID: IfStatementWithTooManyBranches", + "markdown": "Reports `if` statements with too many branches.\n\nSuch statements may be confusing and are often a sign of inadequate levels of design\nabstraction.\n\n\nUse the **Maximum number of branches** field to specify the maximum number of branches an `if` statement is allowed to have.\n\n\nInspection ID: IfStatementWithTooManyBranches" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IfStatementWithTooManyBranches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessarySuperConstructor", + "shortDescription": { + "text": "Unnecessary call to 'super()'" + }, + "fullDescription": { + "text": "Reports calls to no-arg superclass constructors during object construction. Such calls are unnecessary and may be removed. Example: 'class Foo {\n Foo() {\n super();\n }\n }' After the quick-fix is applied: 'class Foo {\n Foo() {\n }\n }' Inspection ID: UnnecessarySuperConstructor", + "markdown": "Reports calls to no-arg superclass constructors during object construction.\n\nSuch calls are unnecessary and may be removed.\n\n**Example:**\n\n\n class Foo {\n Foo() {\n super();\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n Foo() {\n }\n }\n\nInspection ID: UnnecessarySuperConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryCallToSuper", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThisEscapedInConstructor", + "shortDescription": { + "text": "'this' reference escaped in object construction" + }, + "fullDescription": { + "text": "Reports possible escapes of 'this' during the object initialization. The escapes occur when 'this' is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized. Example: 'class Foo {\n {\n System.out.println(this);\n }\n }' Inspection ID: ThisEscapedInConstructor", + "markdown": "Reports possible escapes of `this` during the object initialization. The escapes occur when `this` is used as a method argument or an object of assignment in a constructor or initializer. Such escapes may result in subtle bugs, as the object is now available in the context where it is not guaranteed to be initialized.\n\n**Example:**\n\n\n class Foo {\n {\n System.out.println(this);\n }\n }\n\nInspection ID: ThisEscapedInConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ThisEscapedInObjectConstruction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Initialization", + "index": 29, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonSerializableObjectPassedToObjectStream", + "shortDescription": { + "text": "Non-serializable object passed to 'ObjectOutputStream'" + }, + "fullDescription": { + "text": "Reports non-'Serializable' objects used as arguments to 'java.io.ObjectOutputStream.write()'. Such calls will result in runtime exceptions. This inspection assumes objects of the types 'java.util.Collection' and 'java.util.Map' to be 'Serializable', unless the types they are declared in are non-'Serializable'. Example: 'public class IWantToSerializeThis {\n public static void main(String[] args) throws IOException {\n try(var stream = new ObjectOutputStream(Files.newOutputStream(Paths.get(\"output\")))) {\n // Warning -- will fail with NotSerializableException\n stream.writeObject(new IWantToSerializeThis());\n }\n }\n }' Inspection ID: NonSerializableObjectPassedToObjectStream", + "markdown": "Reports non-`Serializable` objects used as arguments to `java.io.ObjectOutputStream.write()`. Such calls will result in runtime exceptions.\n\n\nThis inspection assumes objects of the types `java.util.Collection` and\n`java.util.Map` to be `Serializable`, unless the types\nthey are declared in are non-`Serializable`.\n\n**Example:**\n\n\n public class IWantToSerializeThis {\n public static void main(String[] args) throws IOException {\n try(var stream = new ObjectOutputStream(Files.newOutputStream(Paths.get(\"output\")))) {\n // Warning -- will fail with NotSerializableException\n stream.writeObject(new IWantToSerializeThis());\n }\n }\n }\n\nInspection ID: NonSerializableObjectPassedToObjectStream" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonSerializableObjectPassedToObjectStream", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Serialization issues", + "index": 17, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IfCanBeSwitch", + "shortDescription": { + "text": "'if' can be replaced with 'switch'" + }, + "fullDescription": { + "text": "Reports 'if' statements that can be replaced with 'switch' statements. The replacement result is usually shorter and clearer. Example: 'void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }' After the quick-fix is applied: 'void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }' This inspection only reports if the language level of the project or module is 7 or higher. Use the Minimum number of 'if' condition branches field to specify the minimum number of 'if' condition branches for an 'if' statement to have to be reported. Note that the terminal 'else' branch (without 'if') is not counted. Use the Suggest switch on numbers option to enable the suggestion of 'switch' statements on primitive and boxed numbers and characters. Use the Suggest switch on enums option to enable the suggestion of 'switch' statements on 'enum' constants. Use the Only suggest on null-safe expressions option to suggest 'switch' statements that can't introduce a 'NullPointerException' only. Inspection ID: IfCanBeSwitch", + "markdown": "Reports `if` statements that can be replaced with `switch` statements.\n\nThe replacement result is usually shorter and clearer.\n\n**Example:**\n\n\n void test(String str) {\n if (str.equals(\"1\")) {\n System.out.println(1);\n } else if (str.equals(\"2\")) {\n System.out.println(2);\n } else if (str.equals(\"3\")) {\n System.out.println(3);\n } else {\n System.out.println(4);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n void test(String str) {\n switch (str) {\n case \"1\" -> System.out.println(1);\n case \"2\" -> System.out.println(2);\n case \"3\" -> System.out.println(3);\n default -> System.out.println(4);\n }\n }\n \nThis inspection only reports if the language level of the project or module is 7 or higher.\n\nUse the **Minimum number of 'if' condition branches** field to specify the minimum number of `if` condition branches\nfor an `if` statement to have to be reported. Note that the terminal `else` branch (without `if`) is not counted.\n\n\nUse the **Suggest switch on numbers** option to enable the suggestion of `switch` statements on\nprimitive and boxed numbers and characters.\n\n\nUse the **Suggest switch on enums** option to enable the suggestion of `switch` statements on\n`enum` constants.\n\n\nUse the **Only suggest on null-safe expressions** option to suggest `switch` statements that can't introduce a `NullPointerException` only.\n\nInspection ID: IfCanBeSwitch" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IfCanBeSwitch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids", + "index": 52, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonPublicClone", + "shortDescription": { + "text": "'clone()' method not 'public'" + }, + "fullDescription": { + "text": "Reports 'clone()' methods that are 'protected' and not 'public'. When overriding the 'clone()' method from 'java.lang.Object', it is expected to make the method 'public', so that it is accessible from non-subclasses outside the package. Inspection ID: NonPublicClone", + "markdown": "Reports `clone()` methods that are `protected` and not `public`.\n\nWhen overriding the `clone()` method from `java.lang.Object`, it is expected to make the method `public`,\nso that it is accessible from non-subclasses outside the package.\n\nInspection ID: NonPublicClone" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonPublicClone", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Cloning issues", + "index": 82, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ModuleWithTooFewClasses", + "shortDescription": { + "text": "Module with too few classes" + }, + "fullDescription": { + "text": "Reports modules that contain too few classes. Overly small modules may indicate a too fragmented design. Java, Kotlin and Groovy classes are counted. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Minimum number of classes field to specify the minimum number of classes a module may have. Inspection ID: ModuleWithTooFewClasses", + "markdown": "Reports modules that contain too few classes. Overly small modules may indicate a too fragmented design. Java, Kotlin and Groovy classes are counted.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Minimum number of classes** field to specify the minimum number of classes a module may have.\n\n\nInspection ID: ModuleWithTooFewClasses" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ModuleWithTooFewClasses", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Modularization issues", + "index": 66, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NullArgumentToVariableArgMethod", + "shortDescription": { + "text": "Confusing argument to varargs method" + }, + "fullDescription": { + "text": "Reports calls to variable arity methods that have a single argument in the vararg parameter position, which is either a 'null' or an array of a subtype of the vararg parameter. Such an argument may be confusing as it is unclear if a varargs or non-varargs call is desired. Example: 'String[] ss = new String[]{\"foo\", \"bar\"};\n System.out.printf(\"%s\", ss);' In this example only the first element of the array will be printed, not the entire array. This inspection depends on the Java feature 'Variable arity methods', which is available since Java 5. Inspection ID: NullArgumentToVariableArgMethod", + "markdown": "Reports calls to variable arity methods that have a single argument in the vararg parameter position, which is either a `null` or an array of a subtype of the vararg parameter. Such an argument may be confusing as it is unclear if a varargs or non-varargs call is desired.\n\n**Example:**\n\n\n String[] ss = new String[]{\"foo\", \"bar\"};\n System.out.printf(\"%s\", ss);\n\nIn this example only the first element of the array will be printed, not the entire array.\n\nThis inspection depends on the Java feature 'Variable arity methods', which is available since Java 5.\n\nInspection ID: NullArgumentToVariableArgMethod" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ConfusingArgumentToVarargsMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InfiniteRecursion", + "shortDescription": { + "text": "Infinite recursion" + }, + "fullDescription": { + "text": "Reports methods that call themselves infinitely unless an exception is thrown. Methods reported by this inspection cannot return normally. While such behavior may be intended, in many cases this is just an oversight. Example: 'int baz() {\n return baz();\n }' Inspection ID: InfiniteRecursion", + "markdown": "Reports methods that call themselves infinitely unless an exception is thrown.\n\n\nMethods reported by this inspection cannot return normally.\nWhile such behavior may be intended, in many cases this is just an oversight.\n\n**Example:**\n\n int baz() {\n return baz();\n }\n\nInspection ID: InfiniteRecursion" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "InfiniteRecursion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfObsoleteDateTimeApi", + "shortDescription": { + "text": "Use of obsolete date-time API" + }, + "fullDescription": { + "text": "Reports usages of 'java.util.Date', 'java.util.Calendar', 'java.util.GregorianCalendar', 'java.util.TimeZone', and 'java.util.SimpleTimeZone'. While still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably not be used in new development. Inspection ID: UseOfObsoleteDateTimeApi", + "markdown": "Reports usages of `java.util.Date`, `java.util.Calendar`, `java.util.GregorianCalendar`, `java.util.TimeZone`, and `java.util.SimpleTimeZone`.\n\nWhile still supported, these classes were made obsolete by the JDK8 Date-Time API and should probably\nnot be used in new development.\n\nInspection ID: UseOfObsoleteDateTimeApi" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfObsoleteDateTimeApi", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OverloadedVarargsMethod", + "shortDescription": { + "text": "Overloaded varargs method" + }, + "fullDescription": { + "text": "Reports varargs methods with the same name as other methods in the class or in a superclass. Overloaded methods that take a variable number of arguments can be very confusing because it is often unclear which overload gets called. Example: 'public void execute(Runnable... r) {} // warning\n public void execute(Runnable r1, Runnable r2) {}' Use the option to ignore overloaded methods whose parameter types are definitely incompatible. Inspection ID: OverloadedVarargsMethod", + "markdown": "Reports varargs methods with the same name as other methods in the class or in a superclass. Overloaded methods that take a variable number of arguments can be very confusing because it is often unclear which overload gets called.\n\n**Example:**\n\n\n public void execute(Runnable... r) {} // warning\n public void execute(Runnable r1, Runnable r2) {}\n\n\nUse the option to ignore overloaded methods whose parameter types are definitely incompatible.\n\nInspection ID: OverloadedVarargsMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OverloadedVarargsMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Naming conventions/Method", + "index": 91, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AnonymousInnerClassMayBeStatic", + "shortDescription": { + "text": "Anonymous class may be a named 'static' inner class" + }, + "fullDescription": { + "text": "Reports anonymous classes that may be safely replaced with 'static' inner classes. An anonymous class may be a 'static' inner class if it doesn't explicitly reference its enclosing instance or local classes from its surrounding method. A 'static' inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per class instance. Since Java 18, only serializable anonymous classes keep an implicit reference to their enclosing instance, if this reference is not used. Therefore, when the module language level is Java 18 or higher, this inspection reports serializable classes only. The quick-fix extracts the anonymous class into a named 'static' inner class. Example: 'void sample() {\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n }\n });\n }' After the quick-fix is applied: 'void sample() {\n Thread thread = new Thread(new Task());\n }\n\n private static class Task implements Runnable {\n @Override\n public void run() {\n }\n }' Inspection ID: AnonymousInnerClassMayBeStatic", + "markdown": "Reports anonymous classes that may be safely replaced with `static` inner classes. An anonymous class may be a `static` inner class if it doesn't explicitly reference its enclosing instance or local classes from its surrounding method.\n\n\nA `static` inner class does not keep an implicit reference to its enclosing instance.\nThis prevents a common cause of memory leaks and uses less memory per class instance.\n\n\nSince Java 18, only serializable anonymous classes keep an implicit reference to their enclosing instance,\nif this reference is not used. Therefore, when the module language level is Java 18 or higher,\nthis inspection reports serializable classes only.\n\nThe quick-fix extracts the anonymous class into a named `static` inner class.\n\n**Example:**\n\n\n void sample() {\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n }\n });\n }\n\nAfter the quick-fix is applied:\n\n\n void sample() {\n Thread thread = new Thread(new Task());\n }\n\n private static class Task implements Runnable {\n @Override\n public void run() {\n }\n }\n\nInspection ID: AnonymousInnerClassMayBeStatic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AnonymousInnerClassMayBeStatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Memory", + "index": 69, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DeprecatedIsStillUsed", + "shortDescription": { + "text": "Deprecated member is still used" + }, + "fullDescription": { + "text": "Reports deprecated classes, methods, and fields that are used in your code nonetheless. Example: 'class MyCode {\n @Deprecated\n void oldMethod() {}// warning: \"Deprecated member is still used\"\n\n void newMethod() {\n oldMethod(); // forgotten usage\n }\n }' Usages within deprecated elements are ignored. NOTE: Due to performance reasons, a non-private member is checked only when its name rarely occurs in the project. Inspection ID: DeprecatedIsStillUsed", + "markdown": "Reports deprecated classes, methods, and fields that are used in your code nonetheless.\n\nExample:\n\n\n class MyCode {\n @Deprecated\n void oldMethod() {}// warning: \"Deprecated member is still used\"\n\n void newMethod() {\n oldMethod(); // forgotten usage\n }\n }\n\nUsages within deprecated elements are ignored.\n\n**NOTE:** Due to performance reasons, a non-private member is checked only when its name rarely occurs in the project.\n\nInspection ID: DeprecatedIsStillUsed" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DeprecatedIsStillUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code maturity", + "index": 50, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicConstructor", + "shortDescription": { + "text": "'public' constructor can be replaced with factory method" + }, + "fullDescription": { + "text": "Reports 'public' constructors. Some coding standards discourage the use of 'public' constructors and recommend 'static' factory methods instead. This way the implementation can be swapped out without affecting the call sites. Example: 'class Test {\n private String name;\n\n public Test(String name) {\n this.name = name;\n }\n\n public void test() {\n System.out.println(name);\n }\n\n public static void main(String[] args) {\n new Test(\"str\").test();\n }\n }' After quick-fix is applied: 'class Test {\n private String name;\n\n private Test(String name) {\n this.name = name;\n }\n\n public static Test getInstance(String name) {\n return new Test(name);\n }\n\n public void test() {\n System.out.println(name);\n }\n\n public static void main(String[] args) {\n getInstance(\"str\").test();\n }\n }' Inspection ID: PublicConstructor", + "markdown": "Reports `public` constructors.\n\nSome coding standards discourage the use of `public` constructors and recommend\n`static` factory methods instead.\nThis way the implementation can be swapped out without affecting the call sites.\n\n**Example:**\n\n\n class Test {\n private String name;\n\n public Test(String name) {\n this.name = name;\n }\n\n public void test() {\n System.out.println(name);\n }\n\n public static void main(String[] args) {\n new Test(\"str\").test();\n }\n }\n\nAfter quick-fix is applied:\n\n\n class Test {\n private String name;\n\n private Test(String name) {\n this.name = name;\n }\n\n public static Test getInstance(String name) {\n return new Test(name);\n }\n\n public void test() {\n System.out.println(name);\n }\n\n public static void main(String[] args) {\n getInstance(\"str\").test();\n }\n }\n\nInspection ID: PublicConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PublicConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantComparatorComparing", + "shortDescription": { + "text": "Comparator method can be simplified" + }, + "fullDescription": { + "text": "Reports 'Comparator' combinator constructs that can be simplified. Example: 'c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());' After the quick-fixes are applied: 'c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());' Inspection ID: RedundantComparatorComparing New in 2018.1", + "markdown": "Reports `Comparator` combinator constructs that can be simplified.\n\nExample:\n\n\n c.thenComparing(Comparator.comparing(function));\n\n Comparator.comparing(Map.Entry::getKey);\n\n Collections.max(list, Comparator.reverseOrder());\n\nAfter the quick-fixes are applied:\n\n\n c.thenComparing(function)\n\n Map.Entry.comparingByKey()\n\n Collections.min(list, Comparator.naturalOrder());\n\nInspection ID: RedundantComparatorComparing\n\nNew in 2018.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantComparatorComparing", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantEmbeddedExpression", + "shortDescription": { + "text": "Redundant embedded expression in string template" + }, + "fullDescription": { + "text": "Reports redundant embedded expressions in 'STR' templates, such as trivial literals or empty expressions. Example: 'System.out.println(STR.\"Hello \\{\"world\"}\");' After the quick-fix is applied: 'System.out.println(STR.\"Hello world\");' This inspection depends on the Java feature 'String templates', which is available since Java 21-preview. Inspection ID: RedundantEmbeddedExpression New in 2023.3", + "markdown": "Reports redundant embedded expressions in `STR` templates, such as trivial literals or empty expressions.\n\nExample:\n\n\n System.out.println(STR.\"Hello \\{\"world\"}\");\n\nAfter the quick-fix is applied:\n\n\n System.out.println(STR.\"Hello world\");\n\nThis inspection depends on the Java feature 'String templates', which is available since Java 21-preview.\n\nInspection ID: RedundantEmbeddedExpression\n\nNew in 2023.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantEmbeddedExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SwitchStatementWithTooFewBranches", + "shortDescription": { + "text": "Minimum 'switch' branches" + }, + "fullDescription": { + "text": "Reports 'switch' statements and expressions with too few 'case' labels, and suggests rewriting them as 'if' and 'else if' statements. Example (minimum branches == 3): 'switch (expression) {\n case \"foo\" -> foo();\n case \"bar\" -> bar();\n }' After the quick-fix is applied: 'if (\"foo\".equals(expression)) {\n foo();\n } else if (\"bar\".equals(expression)) {\n bar();\n }' Exhaustive switch expressions (Java 14+) or pattern switch statements (Java 17 preview) without the 'default' branch are not reported. That's because compile-time exhaustiveness check will be lost when the 'switch' is converted to 'if' which might be undesired. Configure the inspection: Use the Minimum number of branches field to specify the minimum expected number of 'case' labels. Use the Do not report pattern switch statements option to avoid reporting switch statements and expressions that have pattern branches. E.g.: 'String result = switch(obj) {\n case String str -> str.trim();\n default -> \"none\";\n };' It might be preferred to keep the switch even with a single pattern branch, rather than using the 'instanceof' statement. Inspection ID: SwitchStatementWithTooFewBranches", + "markdown": "Reports `switch` statements and expressions with too few `case` labels, and suggests rewriting them as `if` and `else if` statements.\n\nExample (minimum branches == 3):\n\n\n switch (expression) {\n case \"foo\" -> foo();\n case \"bar\" -> bar();\n }\n\nAfter the quick-fix is applied:\n\n\n if (\"foo\".equals(expression)) {\n foo();\n } else if (\"bar\".equals(expression)) {\n bar();\n }\n\nExhaustive switch expressions (Java 14+) or pattern switch statements (Java 17 preview) without the 'default' branch are not reported.\nThat's because compile-time exhaustiveness check will be lost when the `switch` is converted to `if`\nwhich might be undesired.\n\nConfigure the inspection:\n\nUse the **Minimum number of branches** field to specify the minimum expected number of `case` labels.\n\nUse the **Do not report pattern switch statements** option to avoid reporting switch statements and expressions that\nhave pattern branches. E.g.:\n\n\n String result = switch(obj) {\n case String str -> str.trim();\n default -> \"none\";\n };\n\nIt might be preferred to keep the switch even with a single pattern branch, rather than using the `instanceof` statement.\n\nInspection ID: SwitchStatementWithTooFewBranches" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SwitchStatementWithTooFewBranches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "VariableNotUsedInsideIf", + "shortDescription": { + "text": "Reference checked for 'null' is not used inside 'if'" + }, + "fullDescription": { + "text": "Reports references to variables that are checked for nullability in the condition of an 'if' statement or conditional expression but not used inside that 'if' statement. Usually this either means that the check is unnecessary or that the variable is not referenced inside the 'if' statement by mistake. Example: 'void test(Integer i) {\n if (i != null) { // here 'i' is not used inside 'if' statement\n System.out.println();\n }\n }' Inspection ID: VariableNotUsedInsideIf", + "markdown": "Reports references to variables that are checked for nullability in the condition of an `if` statement or conditional expression but not used inside that `if` statement.\n\n\nUsually this either means that\nthe check is unnecessary or that the variable is not referenced inside the\n`if` statement by mistake.\n\n**Example:**\n\n\n void test(Integer i) {\n if (i != null) { // here 'i' is not used inside 'if' statement\n System.out.println();\n }\n }\n\nInspection ID: VariableNotUsedInsideIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "VariableNotUsedInsideIf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CollectionAddAllCanBeReplacedWithConstructor", + "shortDescription": { + "text": "Redundant 'Collection.addAll()' call" + }, + "fullDescription": { + "text": "Reports 'Collection.addAll()' and 'Map.putAll()' calls immediately after an instantiation of a collection using a no-arg constructor. Such constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement might be more performant. Example: 'Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' After the quick-fix is applied: 'Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));' The JDK collection classes are supported by default. Additionally, you can specify other classes using the Classes to check panel. Inspection ID: CollectionAddAllCanBeReplacedWithConstructor", + "markdown": "Reports `Collection.addAll()` and `Map.putAll()` calls immediately after an instantiation of a collection using a no-arg constructor.\n\nSuch constructs can be replaced with a single call to a parametrized constructor, which simplifies the code. Also, for some collections the replacement\nmight be more performant.\n\n**Example:**\n\n\n Set set = new HashSet<>();\n set.addAll(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\nAfter the quick-fix is applied:\n\n\n Set set = new HashSet<>(Arrays.asList(\"alpha\", \"beta\", \"gamma\"));\n\n\nThe JDK collection classes are supported by default.\nAdditionally, you can specify other classes using the **Classes to check** panel.\n\nInspection ID: CollectionAddAllCanBeReplacedWithConstructor" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CollectionAddAllCanBeReplacedWithConstructor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Performance", + "index": 10, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UsagesOfObsoleteApi", + "shortDescription": { + "text": "Usages of ApiStatus.@Obsolete" + }, + "fullDescription": { + "text": "Reports declarations (classes, methods, fields) annotated as '@ApiStatus.Obsolete'. Sometimes it's impossible to delete the current API, though it might not work correctly, there is a newer, or better, or more generic API. This way, it's a weaker variant of '@Deprecated' annotation. The annotated API is not supposed to be used in the new code, but it's permitted to postpone the migration of the existing code, therefore the usage is not considered a warning. Inspection ID: UsagesOfObsoleteApi", + "markdown": "Reports declarations (classes, methods, fields) annotated as `@ApiStatus.Obsolete`.\n\n\nSometimes it's impossible to delete the current API, though it might not work correctly, there is a newer, or better, or more generic API.\nThis way, it's a weaker variant of `@Deprecated` annotation.\nThe annotated API is not supposed to be used in the new code, but it's permitted to postpone the migration of the existing code,\ntherefore the usage is not considered a warning.\n\nInspection ID: UsagesOfObsoleteApi" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "UsagesOfObsoleteApi", + "ideaSeverity": "TEXT ATTRIBUTES", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JVM languages", + "index": 4, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MultipleReturnPointsPerMethod", + "shortDescription": { + "text": "Method with multiple return points" + }, + "fullDescription": { + "text": "Reports methods whose number of 'return' points exceeds the specified maximum. Methods with too many 'return' points may be confusing and hard to refactor. A 'return' point is either a 'return' statement or a falling through the bottom of a 'void' method or constructor. Example: The method below is reported if only two 'return' statements are allowed: 'void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user)) {\n user.setId(getId());\n return;\n } else if (cond2(user)) {\n if (cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }\n }' Consider rewriting the method so it becomes easier to understand: 'void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user) || cond2(user) && cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }' Configure the inspection: Use the Return point limit field to specify the maximum allowed number of 'return' points for a method. Use the Ignore guard clauses option to ignore guard clauses. A guard clause is an 'if' statement that contains only a 'return' statement Use the Ignore for 'equals()' methods option to ignore 'return' points inside 'equals()' methods. Inspection ID: MultipleReturnPointsPerMethod", + "markdown": "Reports methods whose number of `return` points exceeds the specified maximum. Methods with too many `return` points may be confusing and hard to refactor.\n\nA `return` point is either a `return` statement or a falling through the bottom of a\n`void` method or constructor.\n\n**Example:**\n\nThe method below is reported if only two `return` statements are allowed:\n\n\n void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user)) {\n user.setId(getId());\n return;\n } else if (cond2(user)) {\n if (cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }\n }\n\nConsider rewriting the method so it becomes easier to understand:\n\n\n void doSmth(User[] users) {\n for (User user : users) {\n if (cond1(user) || cond2(user) && cond3(user)) {\n user.setId(getId());\n return;\n }\n }\n }\n\nConfigure the inspection:\n\n* Use the **Return point limit** field to specify the maximum allowed number of `return` points for a method.\n* Use the **Ignore guard clauses** option to ignore guard clauses. A guard clause is an `if` statement that contains only a `return` statement\n* Use the **Ignore for 'equals()' methods** option to ignore `return` points inside `equals()` methods.\n\nInspection ID: MultipleReturnPointsPerMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MethodWithMultipleReturnPoints", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Method metrics", + "index": 101, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousMethodCalls", + "shortDescription": { + "text": "Suspicious collection method call" + }, + "fullDescription": { + "text": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type. Example: 'List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted' In the inspection settings, you can disable warnings for potentially correct code like the following: 'public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }' Inspection ID: SuspiciousMethodCalls", + "markdown": "Reports method calls on parameterized collections, where the actual argument type does not correspond to the collection's elements type.\n\n**Example:**\n\n\n List list = getListOfElements();\n list.remove(\"\"); // remove is highlighted\n\n\nIn the inspection settings, you can disable warnings for potentially correct code like the following:\n\n\n public boolean accept(Map map, Object key) {\n return map.containsKey(key);\n }\n\nInspection ID: SuspiciousMethodCalls" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousMethodCalls", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Probable bugs", + "index": 13, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantDeclaredInInterface", + "shortDescription": { + "text": "Constant declared in interface" + }, + "fullDescription": { + "text": "Reports constants ('public static final' fields) declared in interfaces. Some coding standards require declaring constants in abstract classes instead. Inspection ID: ConstantDeclaredInInterface", + "markdown": "Reports constants (`public static final` fields) declared in interfaces.\n\nSome coding standards require declaring constants in abstract classes instead.\n\nInspection ID: ConstantDeclaredInInterface" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantDeclaredInInterface", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class structure", + "index": 12, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForwardCompatibility", + "shortDescription": { + "text": "Forward compatibility" + }, + "fullDescription": { + "text": "Reports Java code constructs that may fail to compile in future Java versions. The following problems are reported: Uses of 'assert', 'enum' or '_' as an identifier Uses of the 'var', 'yield', or 'record' restricted identifier as a type name Unqualified calls to methods named 'yield' Modifiers on the 'requires java.base' statement inside of 'module-info.java' Redundant semicolons between import statements Example: '// This previously legal class does not compile with Java 14,\n // as 'yield' became a restricted identifier.\n public class yield {}' Fixing these issues timely may simplify migration to future Java versions. Inspection ID: ForwardCompatibility", + "markdown": "Reports Java code constructs that may fail to compile in future Java versions.\n\nThe following problems are reported:\n\n* Uses of `assert`, `enum` or `_` as an identifier\n* Uses of the `var`, `yield`, or `record` restricted identifier as a type name\n* Unqualified calls to methods named `yield`\n* Modifiers on the `requires java.base` statement inside of `module-info.java`\n* Redundant semicolons between import statements\n\n**Example:**\n\n\n // This previously legal class does not compile with Java 14,\n // as 'yield' became a restricted identifier.\n public class yield {} \n\nFixing these issues timely may simplify migration to future Java versions.\n\nInspection ID: ForwardCompatibility" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "ForwardCompatibility", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level issues", + "index": 62, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DiamondCanBeReplacedWithExplicitTypeArguments", + "shortDescription": { + "text": "Diamond can be replaced with explicit type arguments" + }, + "fullDescription": { + "text": "Reports instantiation of generic classes in which the <> symbol (diamond) is used instead of type parameters. The quick-fix replaces <> (diamond) with explicit type parameters. Example: 'List list = new ArrayList<>()' After the quick-fix is applied: 'List list = new ArrayList()' Diamond operation appeared in Java 7. This inspection can help to downgrade for backward compatibility with earlier Java versions. Inspection ID: DiamondCanBeReplacedWithExplicitTypeArguments", + "markdown": "Reports instantiation of generic classes in which the **\\<\\>** symbol (diamond) is used instead of type parameters.\n\nThe quick-fix replaces **\\<\\>** (diamond) with explicit type parameters.\n\nExample:\n\n List list = new ArrayList<>()\n\nAfter the quick-fix is applied:\n\n List list = new ArrayList()\n\n\n*Diamond operation* appeared in Java 7.\nThis inspection can help to downgrade for backward compatibility with earlier Java versions.\n\nInspection ID: DiamondCanBeReplacedWithExplicitTypeArguments" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "DiamondCanBeReplacedWithExplicitTypeArguments", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Code style issues", + "index": 11, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfProcessBuilder", + "shortDescription": { + "text": "Use of 'java.lang.ProcessBuilder' class" + }, + "fullDescription": { + "text": "Reports uses of 'java.lang.ProcessBuilder', which might be unportable between operating systems because paths to executables, environment variables, command-line arguments and their escaping might vary depending on the OS. Inspection ID: UseOfProcessBuilder", + "markdown": "Reports uses of `java.lang.ProcessBuilder`, which might be unportable between operating systems because paths to executables, environment variables, command-line arguments and their escaping might vary depending on the OS.\n\nInspection ID: UseOfProcessBuilder" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfProcessBuilder", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Portability", + "index": 7, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaRequiresAutoModule", + "shortDescription": { + "text": "Dependencies on automatic modules" + }, + "fullDescription": { + "text": "Reports usages of automatic modules in a 'requires' directive. An automatic module is unreliable since it can depend on the types on the class path, and its name and exported packages can change if it's converted into an explicit module. Corresponds to '-Xlint:requires-automatic' and '-Xlint:requires-transitive-automatic' Javac options. The first option increases awareness of when automatic modules are used. The second warns the authors of a module that they're putting the users of that module at risk by establishing implied readability to an automatic module. Example: '//module-info.java\n module org.printer {\n requires transitive drivers.corp.org; // reported in case 'drivers.corp.org' is an automatic module\n }' Use the Highlight only transitive dependencies option to warn only about transitive dependencies. This inspection depends on the Java feature 'Modules', which is available since Java 9. Inspection ID: JavaRequiresAutoModule", + "markdown": "Reports usages of automatic modules in a `requires` directive.\n\nAn automatic\nmodule is unreliable since it can depend on the types on the class path,\nand its name and exported packages can change if it's\nconverted into an explicit module.\n\nCorresponds to `-Xlint:requires-automatic` and `-Xlint:requires-transitive-automatic` Javac options.\nThe first option increases awareness of when automatic modules are used.\nThe second warns the authors of a module that they're putting the users of that module at risk by establishing implied readability to an automatic module.\n\n**Example:**\n\n\n //module-info.java\n module org.printer {\n requires transitive drivers.corp.org; // reported in case 'drivers.corp.org' is an automatic module\n }\n\n\nUse the **Highlight only transitive dependencies** option to warn only about transitive dependencies.\n\nThis inspection depends on the Java feature 'Modules', which is available since Java 9.\n\nInspection ID: JavaRequiresAutoModule" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "requires-transitive-automatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 9", + "index": 78, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExcessiveRangeCheck", + "shortDescription": { + "text": "Excessive range check" + }, + "fullDescription": { + "text": "Reports condition chains in which a value range is checked and these condition chains can be simplified to a single check. The quick-fix replaces a condition chain with a simplified expression: Example: 'x > 2 && x < 4' After the quick-fix is applied: 'x == 3' Example: 'arr.length == 0 || arr.length > 1' After the quick-fix is applied: 'arr.length != 1' Inspection ID: ExcessiveRangeCheck New in 2019.1", + "markdown": "Reports condition chains in which a value range is checked and these condition chains can be simplified to a single check.\n\nThe quick-fix replaces a condition chain with a simplified expression:\n\nExample:\n\n\n x > 2 && x < 4\n\nAfter the quick-fix is applied:\n\n\n x == 3\n\nExample:\n\n\n arr.length == 0 || arr.length > 1\n\nAfter the quick-fix is applied:\n\n\n arr.length != 1\n\nInspection ID: ExcessiveRangeCheck\n\nNew in 2019.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExcessiveRangeCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticImport", + "shortDescription": { + "text": "Static import" + }, + "fullDescription": { + "text": "Reports 'import static' statements. Such 'import' statements are not supported under Java 1.4 or earlier JVMs. Configure the inspection: Use the table below to specify the classes that will be ignored by the inspection when used in an 'import static' statement. Use the Ignore single field static imports checkbox to ignore single-field 'import static' statements. Use the Ignore single method static imports checkbox to ignore single-method 'import static' statements. Inspection ID: StaticImport", + "markdown": "Reports `import static` statements.\n\nSuch `import` statements are not supported under Java 1.4 or earlier JVMs.\n\nConfigure the inspection:\n\n* Use the table below to specify the classes that will be ignored by the inspection when used in an `import static` statement.\n* Use the **Ignore single field static imports** checkbox to ignore single-field `import static` statements.\n* Use the **Ignore single method static imports** checkbox to ignore single-method `import static` statements.\n\nInspection ID: StaticImport" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticImport", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Imports", + "index": 21, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReplaceNullCheck", + "shortDescription": { + "text": "Null check can be replaced with method call" + }, + "fullDescription": { + "text": "Reports 'null' checks that can be replaced with a call to a static method from 'Objects' or 'Stream'. Example: 'if (message == null) {\n application.messageStorage().save(new EmptyMessage());\n } else {\n application.messageStorage().save(message);\n }' After the quick-fix is applied: 'application.messageStorage()\n .save(Objects.requireNonNullElseGet(message, () -> new EmptyMessage()));' Use the Don't warn if the replacement is longer than the original option to ignore the cases when the replacement is longer than the original code. Inspection ID: ReplaceNullCheck New in 2017.3", + "markdown": "Reports `null` checks that can be replaced with a call to a static method from `Objects` or `Stream`.\n\n**Example:**\n\n\n if (message == null) {\n application.messageStorage().save(new EmptyMessage());\n } else {\n application.messageStorage().save(message);\n }\n\nAfter the quick-fix is applied:\n\n\n application.messageStorage()\n .save(Objects.requireNonNullElseGet(message, () -> new EmptyMessage()));\n\n\nUse the **Don't warn if the replacement is longer than the original** option to ignore the cases when the replacement is longer than the\noriginal code.\n\nInspection ID: ReplaceNullCheck\n\nNew in 2017.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReplaceNullCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 9", + "index": 78, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NoExplicitFinalizeCalls", + "shortDescription": { + "text": "'finalize()' called explicitly" + }, + "fullDescription": { + "text": "Reports calls to 'Object.finalize()'. Calling 'Object.finalize()' explicitly may result in objects being placed in an inconsistent state. The garbage collector automatically calls this method on an object when it determines that there are no references to this object. The inspection doesn't report calls to 'super.finalize()' from within implementations of 'finalize()' as they're benign. Example: 'MyObject m = new MyObject();\n m.finalize();\n System.gc()' Inspection ID: NoExplicitFinalizeCalls", + "markdown": "Reports calls to `Object.finalize()`.\n\nCalling `Object.finalize()` explicitly may result in objects being placed in an\ninconsistent state.\nThe garbage collector automatically calls this method on an object when it determines that there are no references to this object.\n\nThe inspection doesn't report calls to `super.finalize()` from within implementations of `finalize()` as\nthey're benign.\n\n**Example:**\n\n\n MyObject m = new MyObject();\n m.finalize();\n System.gc()\n\nInspection ID: NoExplicitFinalizeCalls" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "FinalizeCalledExplicitly", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Finalization", + "index": 64, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NegatedIfElse", + "shortDescription": { + "text": "'if' statement with negated condition" + }, + "fullDescription": { + "text": "Reports 'if' statements that contain 'else' branches and whose conditions are negated. Flipping the order of the 'if' and 'else' branches usually increases the clarity of such statements. There is a fix that inverts the current 'if' statement. Example: 'void m(Object o1, Object o2) {\n if (o1 != o2) {\n System.out.println(1);\n }\n else {\n System.out.println(2);\n }\n }' After applying the quick-fix: 'void m(Object o1, Object o2) {\n if (o1 == o2) {\n System.out.println(2);\n } else {\n System.out.println(1);\n }\n }' Use the Ignore '!= null' comparisons option to ignore comparisons of the '!= null' form. Use the Ignore '!= 0' comparisons option to ignore comparisons of the '!= 0' form. Inspection ID: NegatedIfElse", + "markdown": "Reports `if` statements that contain `else` branches and whose conditions are negated.\n\nFlipping the order of the `if` and `else`\nbranches usually increases the clarity of such statements.\n\nThere is a fix that inverts the current `if` statement.\n\nExample:\n\n\n void m(Object o1, Object o2) {\n if (o1 != o2) {\n System.out.println(1);\n }\n else {\n System.out.println(2);\n }\n }\n\nAfter applying the quick-fix:\n\n\n void m(Object o1, Object o2) {\n if (o1 == o2) {\n System.out.println(2);\n } else {\n System.out.println(1);\n }\n }\n\nUse the **Ignore '!= null' comparisons** option to ignore comparisons of the `!= null` form.\n\nUse the **Ignore '!= 0' comparisons** option to ignore comparisons of the `!= 0` form.\n\nInspection ID: NegatedIfElse" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IfStatementWithNegatedCondition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Control flow issues", + "index": 26, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantJavaTimeOperations", + "shortDescription": { + "text": "Redundant operation on 'java.time' object" + }, + "fullDescription": { + "text": "Reports redundant operation on 'java.time' object redundant: creation of date/time objects from the JDK 'java.time' package when simpler method calls can be used or creation can be avoided. 'java.time' method calls with 'java.time.temporal.ChronoField' and 'java.time.temporal.ChronoUnit' as arguments when these calls can be replaced with calls of more specific methods. 'java.time' comparisons with 'compareTo()' calls that can be replaced with 'isAfter()', 'isBefore()' or 'isEqual()' calls. Examples: - Before: 'LocalDateTime now = LocalDateTime.now();\nreturn LocalDateTime.from(now);' After the quick-fix is applied: 'LocalDateTime now = LocalDateTime.now();\nreturn now;' - Before: 'LocalTime localTime = LocalTime.now();\nint minute = localTime.get(ChronoField.MINUTE_OF_HOUR);' After the quick-fix is applied: 'LocalTime localTime = LocalTime.now();\nint minute = localTime.getMinute();' - Before: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;' After the quick-fix is applied: 'LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);' Inspection ID: RedundantJavaTimeOperations New in 2024.3", + "markdown": "Reports redundant operation on 'java.time' object redundant:\n\n* creation of date/time objects from the JDK `java.time` package when simpler method calls can be used or creation can be avoided.\n* `java.time` method calls with `java.time.temporal.ChronoField` and `java.time.temporal.ChronoUnit` as arguments when these calls can be replaced with calls of more specific methods.\n* `java.time` comparisons with `compareTo()` calls that can be replaced with `isAfter()`, `isBefore()` or `isEqual()` calls.\n\nExamples:\n- Before:\n\n\n LocalDateTime now = LocalDateTime.now();\n return LocalDateTime.from(now);\n\nAfter the quick-fix is applied:\n\n\n LocalDateTime now = LocalDateTime.now();\n return now;\n\n- Before:\n\n\n LocalTime localTime = LocalTime.now();\n int minute = localTime.get(ChronoField.MINUTE_OF_HOUR);\n\nAfter the quick-fix is applied:\n\n\n LocalTime localTime = LocalTime.now();\n int minute = localTime.getMinute();\n\n- Before:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.compareTo(date2) > 0;\n\nAfter the quick-fix is applied:\n\n\n LocalDate date1 = LocalDate.now();\n LocalDate date2 = LocalDate.now();\n boolean t = date1.isAfter(date2);\n\nInspection ID: RedundantJavaTimeOperations\n\nNew in 2024.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantJavaTimeOperations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FieldCount", + "shortDescription": { + "text": "Class with too many fields" + }, + "fullDescription": { + "text": "Reports classes whose number of fields exceeds the specified maximum. Classes with a large number of fields are often trying to do too much. Consider splitting such a class into multiple smaller classes. Configure the inspection: Use the Field count limit field to specify the maximum allowed number of fields in a class. Use the Include constant fields in count option to indicate whether constant fields should be counted. By default only immutable 'static final' objects are counted as constants. Use the 'static final' fields count as constant option to count any 'static final' field as constant. Use the Include enum constants in count option to specify whether 'enum' constants in 'enum' classes should be counted. Inspection ID: FieldCount", + "markdown": "Reports classes whose number of fields exceeds the specified maximum.\n\nClasses with a large number of fields are often trying to do too much. Consider splitting such a class into multiple smaller classes.\n\nConfigure the inspection:\n\n* Use the **Field count limit** field to specify the maximum allowed number of fields in a class.\n* Use the **Include constant fields in count** option to indicate whether constant fields should be counted.\n* By default only immutable `static final` objects are counted as constants. Use the **'static final' fields count as constant** option to count any `static final` field as constant.\n* Use the **Include enum constants in count** option to specify whether `enum` constants in `enum` classes should be counted.\n\nInspection ID: FieldCount" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClassWithTooManyFields", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Class metrics", + "index": 90, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StringConcatenation", + "shortDescription": { + "text": "String concatenation" + }, + "fullDescription": { + "text": "Reports 'String' concatenations. Concatenation might be incorrect in an internationalized environment and could be replaced by usages of 'java.text.MessageFormat' or similar classes. Example: 'String getMessage(String string, int number) {\n return string + number;\n }' Inspection ID: StringConcatenation", + "markdown": "Reports `String` concatenations. Concatenation might be incorrect in an internationalized environment and could be replaced by usages of `java.text.MessageFormat` or similar classes.\n\n**Example:**\n\n\n String getMessage(String string, int number) {\n return string + number;\n }\n\nInspection ID: StringConcatenation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StringConcatenation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClassCanBeRecord", + "shortDescription": { + "text": "Class can be record class" + }, + "fullDescription": { + "text": "Reports classes that can be converted to record classes. Record classes focus on modeling immutable data rather than extensible behavior. Automatic implicit implementation of data-driven methods, such as 'equals()' and accessors, helps to reduce boilerplate code. Note that not every class can be a record class. Here are some restrictions: The class must have no subclasses. All non-static fields in the class must be final. Initializers, generic constructors, and native methods must not be present. For a full description of record classes, refer to the Java Language Specification. Example: 'class Point {\n private final double x;\n private final double y;\n\n Point(double x, double y) {\n this.x = x;\n this.y = y;\n }\n\n double getX() {\n return x;\n }\n\n double getY() {\n return y;\n }\n }' After the quick-fix is applied: 'record Point(int x, int y) {\n }' Enable the Suggest renaming accessor methods option to rename 'getX()'/'isX()' accessors to 'x()' automatically. Use the Disable highlighting if members become more accessible option to exclude classes whose members' accessibility would be weakened by conversion. Quick-fix will stay available as an intention, and triggering it will show the affected members and ask for confirmation. In batch mode conversion will not be suggested. Use the Suppress conversion if the class is annotated by list to exclude classes from conversion when annotated by annotations matching the specified patterns. This inspection depends on the Java feature 'Records', which is available since Java 16. Inspection ID: ClassCanBeRecord New in 2020.3", + "markdown": "Reports classes that can be converted to record classes.\n\nRecord classes focus on modeling immutable data rather than extensible behavior.\nAutomatic implicit implementation of data-driven methods, such as `equals()` and accessors, helps to reduce boilerplate code.\n\n\nNote that not every class can be a record class. Here are some restrictions:\n\n* The class must have no subclasses.\n* All non-static fields in the class must be final.\n* Initializers, generic constructors, and native methods must not be present.\n\nFor a full description of record classes, refer to the\n[Java Language Specification](https://docs.oracle.com/javase/specs/jls/se21/html/jls-8.html#jls-8.10).\n\nExample:\n\n\n class Point {\n private final double x;\n private final double y;\n\n Point(double x, double y) {\n this.x = x;\n this.y = y;\n }\n\n double getX() {\n return x;\n }\n\n double getY() {\n return y;\n }\n }\n\nAfter the quick-fix is applied:\n\n\n record Point(int x, int y) {\n }\n\nEnable the **Suggest renaming accessor methods** option to rename `getX()`/`isX()` accessors to `x()` automatically.\n\n\nUse the **Disable highlighting if members become more accessible** option to exclude classes whose members'\naccessibility would be weakened by conversion.\nQuick-fix will stay available as an intention, and triggering it will show the affected members and ask for confirmation.\nIn batch mode conversion will not be suggested.\n\nUse the **Suppress conversion if the class is annotated by** list to exclude classes from conversion when annotated by annotations matching the specified patterns.\n\nThis inspection depends on the Java feature 'Records', which is available since Java 16.\n\nInspection ID: ClassCanBeRecord\n\nNew in 2020.3" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ClassCanBeRecord", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Java language level migration aids/Java 16", + "index": 117, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConstantAssertArgument", + "shortDescription": { + "text": "Constant assert argument" + }, + "fullDescription": { + "text": "Reports constant arguments in 'assertTrue()', 'assertFalse()', 'assertNull()', and 'assertNotNull()' calls. Calls to these methods with constant arguments will either always succeed or always fail. Such statements can easily be left over after refactoring and are probably not intended. Example: 'assertNotNull(\"foo\");' Inspection ID: ConstantAssertArgument", + "markdown": "Reports constant arguments in `assertTrue()`, `assertFalse()`, `assertNull()`, and `assertNotNull()` calls.\n\n\nCalls to these methods with\nconstant arguments will either always succeed or always fail.\nSuch statements can easily be left over after refactoring and are probably not intended.\n\n**Example:**\n\n\n assertNotNull(\"foo\");\n\nInspection ID: ConstantAssertArgument" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConstantAssertArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Test frameworks", + "index": 102, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.intellij.groovy", + "version": "252.28459.0", + "rules": [ + { + "id": "GroovyListSetCanBeKeyedAccess", + "shortDescription": { + "text": "Call to List.set can be keyed access" + }, + "fullDescription": { + "text": "Reports calls to 'java.util.List.set()' methods. Such calls could be replaced by the shorter and clearer keyed access form. Example: 'def list = [\"foo\"]\nlist.set(0, \"bar\") // list.set(0, \"bar\") could be replaced with list[0] = \"bar\"'\n After the quick-fix is applied: 'def list = [\"foo\"]\nlist[0] = \"bar\"'\n Inspection ID: GroovyListSetCanBeKeyedAccess", + "markdown": "Reports calls to `java.util.List.set()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def list = [\"foo\"]\n list.set(0, \"bar\") // list.set(0, \"bar\") could be replaced with list[0] = \"bar\"\n\nAfter the quick-fix is applied:\n\n\n def list = [\"foo\"]\n list[0] = \"bar\"\n\nInspection ID: GroovyListSetCanBeKeyedAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyListSetCanBeKeyedAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/GPath", + "index": 20, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyConstantNamingConvention", + "shortDescription": { + "text": "Constant naming convention" + }, + "fullDescription": { + "text": "Reports constant with names which don't match the specified convention. Constants are fields of immutable type declared with 'static' and 'final' modifiers. Reports constants whose names are either too short, too long, or do not follow the specified regular expression pattern. Configure the inspection: Use the Pattern field to specify 'java.util.regex.Pattern' which a constant name is expected to match. Use the Min length field to specify the minimum length of a constant name. Use the Max length field to specify the maximum length of a constant name. Inspection ID: GroovyConstantNamingConvention", + "markdown": "Reports constant with names which don't match the specified convention.\n\nConstants are fields of immutable type declared with `static` and `final` modifiers.\nReports constants whose names are either too short, too long, or do not follow the specified regular expression pattern.\n\nConfigure the inspection:\n\n* Use the **Pattern** field to specify `java.util.regex.Pattern` which a constant name is expected to match.\n* Use the **Min length** field to specify the minimum length of a constant name.\n* Use the **Max length** field to specify the maximum length of a constant name.\n\nInspection ID: GroovyConstantNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyConstantNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Naming conventions", + "index": 37, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyThreadStopSuspendResume", + "shortDescription": { + "text": "Call to Thread.stop(), Thread.suspend(), or Thread.resume()" + }, + "fullDescription": { + "text": "Reports calls to 'Thread.stop()','Thread.suspend()', or 'Thread.resume()'. These calls are inherently prone to data corruption and deadlock, and their use is strongly discouraged. Inspection ID: GroovyThreadStopSuspendResume", + "markdown": "Reports calls to `Thread.stop()`,`Thread.suspend()`, or `Thread.resume()`.\n\n\nThese calls are inherently prone to data corruption and deadlock, and their use is strongly\ndiscouraged.\n\nInspection ID: GroovyThreadStopSuspendResume" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyThreadStopSuspendResume", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyContinueOrBreakFromFinallyBlock", + "shortDescription": { + "text": "'continue' or 'break' from 'finally' block" + }, + "fullDescription": { + "text": "Reports 'break' and 'continue' statements inside of 'finally' blocks. While occasionally intended, such statements are very confusing, may mask thrown exceptions, and tremendously complicate debugging. Inspection ID: GroovyContinueOrBreakFromFinallyBlock", + "markdown": "Reports `break` and `continue` statements inside of `finally` blocks.\n\nWhile occasionally intended, such statements are very confusing, may mask thrown exceptions, and tremendously complicate debugging.\n\nInspection ID: GroovyContinueOrBreakFromFinallyBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyContinueOrBreakFromFinallyBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Error handling", + "index": 43, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyInArgumentCheck", + "shortDescription": { + "text": "Incompatible 'in' argument types" + }, + "fullDescription": { + "text": "Reports usages of membership operator 'in' with items and containers of incompatible types. Example: 'def list = [1, 2]\nif (\"foo\" in list) {} // list of Integers can't contain String'\n Inspection ID: GroovyInArgumentCheck", + "markdown": "Reports usages of membership operator `in` with items and containers of incompatible types.\n\n**Example:**\n\n\n def list = [1, 2]\n if (\"foo\" in list) {} // list of Integers can't contain String\n\nInspection ID: GroovyInArgumentCheck" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyInArgumentCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyMapPutCanBeKeyedAccess", + "shortDescription": { + "text": "Call to Map.put can be keyed access" + }, + "fullDescription": { + "text": "Reports calls to 'java.util.Map.put()' methods. Such calls could be replaced by the shorter and clearer keyed access form. Example: 'def map = [\"foo\": \"bar\"]\nmap.put(\"foo\", \"baz\") // map.put(\"foo\", \"baz\") could be replaced with map[\"foo\"] = \"baz\"'\n After the quick-fix is applied: 'def map = [\"foo\": \"bar\"]\nmap[\"foo\"] = \"baz\"'\n Inspection ID: GroovyMapPutCanBeKeyedAccess", + "markdown": "Reports calls to `java.util.Map.put()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def map = [\"foo\": \"bar\"]\n map.put(\"foo\", \"baz\") // map.put(\"foo\", \"baz\") could be replaced with map[\"foo\"] = \"baz\"\n\nAfter the quick-fix is applied:\n\n\n def map = [\"foo\": \"bar\"]\n map[\"foo\"] = \"baz\"\n\nInspection ID: GroovyMapPutCanBeKeyedAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyMapPutCanBeKeyedAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/GPath", + "index": 20, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyAssignmentToMethodParameter", + "shortDescription": { + "text": "Assignment to method parameter" + }, + "fullDescription": { + "text": "Reports assignment to method parameters. While occasionally intended, this construct can be extremely confusing, and is often the result of a typo. Example: 'def m(a, b, c) {\n a = [] // warning\n }' Inspection ID: GroovyAssignmentToMethodParameter", + "markdown": "Reports assignment to method parameters.\n\nWhile occasionally intended, this construct can be extremely confusing, and is often the result of a typo.\n\n**Example:**\n\n\n def m(a, b, c) {\n a = [] // warning\n }\n\nInspection ID: GroovyAssignmentToMethodParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyAssignmentToMethodParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Assignment issues", + "index": 65, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyStaticMethodNamingConvention", + "shortDescription": { + "text": "Static method naming convention" + }, + "fullDescription": { + "text": "Reports static methods whose names are too short, too long, or do not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length and regular expression expected for static method names. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: GroovyStaticMethodNamingConvention", + "markdown": "Reports static methods whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length and regular expression expected for static method names.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: GroovyStaticMethodNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyStaticMethodNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Naming conventions", + "index": 37, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyTrivialIf", + "shortDescription": { + "text": "Redundant 'if' statement" + }, + "fullDescription": { + "text": "Reports 'if' statements which can be simplified to single assignment or 'return' statements. Example: 'if (foo())\n return true;\n else\n return false;' After the quick-fix is applied: 'return foo();' Inspection ID: GroovyTrivialIf", + "markdown": "Reports `if` statements which can be simplified to single assignment or `return` statements.\n\n**Example:**\n\n\n if (foo())\n return true;\n else\n return false;\n\nAfter the quick-fix is applied:\n\n\n return foo();\n\nInspection ID: GroovyTrivialIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyTrivialIf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyPointlessArithmetic", + "shortDescription": { + "text": "Pointless arithmetic expression" + }, + "fullDescription": { + "text": "Reports pointless arithmetic expressions. Such expressions include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero. Such expressions may be the result of automated refactorings not completely followed through to completion, and in any case are unlikely to be what the developer intended to do. Example: 'a + 0' After the quick-fix is applied: 'a' Inspection ID: GroovyPointlessArithmetic", + "markdown": "Reports pointless arithmetic expressions.\n\n\nSuch expressions include adding or subtracting zero, multiplying by zero or one,\ndivision by one, and shift by zero. Such expressions may be the result of automated refactorings\nnot completely followed through to completion, and in any case are unlikely to be what the developer\nintended to do.\n\n**Example:**\n\n\n a + 0\n\nAfter the quick-fix is applied:\n\n\n a\n\nInspection ID: GroovyPointlessArithmetic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyPointlessArithmetic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyAccessibility", + "shortDescription": { + "text": "Inaccessible element" + }, + "fullDescription": { + "text": "Reports references which exceed access rights. Access to private members breaks encapsulation. Inspection ID: GroovyAccessibility", + "markdown": "Reports references which exceed access rights.\n\nAccess to private members breaks encapsulation.\n\nInspection ID: GroovyAccessibility" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyAccessibility", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyDoubleCheckedLocking", + "shortDescription": { + "text": "Double-checked locking" + }, + "fullDescription": { + "text": "Reports double-checked locking. Double-checked locking tries to initialize a field on demand and in a thread-safe manner, while avoiding the cost of synchronization. Unfortunately it is not thread-safe when used on a field that is not declared 'volatile'. When using Java 1.4 or earlier, double-checked locking doesn't work even with a 'volatile' field. Read the article linked above for a detailed explanation of the problem. Example: 'class Foo {\n private Helper helper = null\n\n Helper getHelper() {\n if (helper == null)\n synchronized(this) {\n if (helper == null) {\n helper = new Helper()\n }\n }\n }\n return helper;\n }\n }' Inspection ID: GroovyDoubleCheckedLocking", + "markdown": "Reports [double-checked locking](https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html).\n\n\nDouble-checked locking tries to initialize a field on demand and in a thread-safe manner, while avoiding the cost of synchronization.\nUnfortunately it is not thread-safe when used on a field that is not declared `volatile`.\nWhen using Java 1.4 or earlier, double-checked locking doesn't work even with a `volatile` field.\nRead the article linked above for a detailed explanation of the problem.\n\n**Example:**\n\n\n class Foo {\n private Helper helper = null\n\n Helper getHelper() {\n if (helper == null)\n synchronized(this) {\n if (helper == null) {\n helper = new Helper()\n }\n }\n }\n return helper;\n }\n }\n\nInspection ID: GroovyDoubleCheckedLocking" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyDoubleCheckedLocking", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyFallthrough", + "shortDescription": { + "text": "Fallthrough in 'switch' statement" + }, + "fullDescription": { + "text": "Reports fallthrough in switch statements. While occasionally useful, fallthrough is often unintended, and may lead to surprising bugs. Example: 'switch(n) {\n case 1:\n print 1\n case 2: // \"case 1\" fallthrough to \"case 2\". Statements from \"case 2\" will be executed immediately after \"case 1\".\n print 2\n break\n default:\n print \"Default\"\n}'\n Inspection ID: GroovyFallthrough", + "markdown": "Reports *fallthrough* in switch statements. While occasionally useful, fallthrough is often unintended, and may lead to surprising bugs.\n\n**Example:**\n\n\n switch(n) {\n case 1:\n print 1\n case 2: // \"case 1\" fallthrough to \"case 2\". Statements from \"case 2\" will be executed immediately after \"case 1\".\n print 2\n break\n default:\n print \"Default\"\n }\n\nInspection ID: GroovyFallthrough" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyFallthrough", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyLocalVariableNamingConvention", + "shortDescription": { + "text": "Local variable naming convention" + }, + "fullDescription": { + "text": "Reports local variables whose names are too short, too long, or do not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length and regular expression expected for local variables names. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: GroovyLocalVariableNamingConvention", + "markdown": "Reports local variables whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length and regular expression expected for local variables names.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: GroovyLocalVariableNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyLocalVariableNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Naming conventions", + "index": 37, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyIfStatementWithIdenticalBranches", + "shortDescription": { + "text": "If statement with identical branches" + }, + "fullDescription": { + "text": "Reports 'if' statements with identical \"then\" and 'else' branches. Such statements are almost certainly programmer error. Example: 'if (condition) {\n print \"foo\"\n} else {\n print \"foo\"\n}'\n After the quick-fix is applied: 'print \"foo\"'\n Inspection ID: GroovyIfStatementWithIdenticalBranches", + "markdown": "Reports `if` statements with identical \"then\" and `else` branches. Such statements are almost certainly programmer error.\n\n**Example:**\n\n\n if (condition) {\n print \"foo\"\n } else {\n print \"foo\"\n }\n\nAfter the quick-fix is applied:\n\n\n print \"foo\"\n\nInspection ID: GroovyIfStatementWithIdenticalBranches" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyIfStatementWithIdenticalBranches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUncheckedAssignmentOfMemberOfRawType", + "shortDescription": { + "text": "Unchecked assignment from members of raw type" + }, + "fullDescription": { + "text": "Reports unchecked assignments from members of raw type. Example: 'List list = new ArrayList()\n List a = list.get(0)' Inspection ID: GroovyUncheckedAssignmentOfMemberOfRawType", + "markdown": "Reports unchecked assignments from members of raw type.\n\n**Example:**\n\n\n List list = new ArrayList()\n List a = list.get(0)\n\nInspection ID: GroovyUncheckedAssignmentOfMemberOfRawType" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUncheckedAssignmentOfMemberOfRawType", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Assignment issues", + "index": 65, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyNonShortCircuitBoolean", + "shortDescription": { + "text": "Non short-circuit boolean" + }, + "fullDescription": { + "text": "Reports the non-short-circuit forms of boolean operators 'and' and 'or' ( '&' and '|' ). The non-short-circuit versions are occasionally useful, but their presence is often due to typos of the short-circuit forms ( '&&' and '||' ), and may lead to subtle bugs. Example: 'if (a & b) {}' After the quick-fix is applied: 'if (a && b) {}' Inspection ID: GroovyNonShortCircuitBoolean", + "markdown": "Reports the non-short-circuit forms of boolean operators 'and' and 'or' ( `&` and `|` ).\n\n\nThe non-short-circuit versions are occasionally useful, but\ntheir presence is often due to typos of the short-circuit forms ( `&&`\nand `||` ), and may lead to subtle bugs.\n\n**Example:**\n\n\n if (a & b) {}\n\nAfter the quick-fix is applied:\n\n\n if (a && b) {}\n\nInspection ID: GroovyNonShortCircuitBoolean" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyNonShortCircuitBoolean", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrMethodMayBeStatic", + "shortDescription": { + "text": "Method can be made 'static'" + }, + "fullDescription": { + "text": "Reports methods which may safely be made 'static'. A method may be 'static' if it is not 'synchronized', it does not reference any of its class' instance methods and instance fields, and it is not overridden in a subclass. Inspection ID: GrMethodMayBeStatic", + "markdown": "Reports methods which may safely be made `static`.\n\n\nA method may be `static` if it is not `synchronized`,\nit does not reference any of its class' instance methods and instance fields,\nand it is not overridden in a subclass.\n\nInspection ID: GrMethodMayBeStatic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrMethodMayBeStatic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Other", + "index": 81, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyDivideByZero", + "shortDescription": { + "text": "Division by zero" + }, + "fullDescription": { + "text": "Reports divisions by zero or remainders by zero. Example: 'def a = 42\n a / 0 // warning\n a % 0.0 // warning' Inspection ID: GroovyDivideByZero", + "markdown": "Reports divisions by zero or remainders by zero.\n\n**Example:**\n\n\n def a = 42\n a / 0 // warning\n a % 0.0 // warning\n\nInspection ID: GroovyDivideByZero" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyDivideByZero", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaStylePropertiesInvocation", + "shortDescription": { + "text": "Java-style property access" + }, + "fullDescription": { + "text": "Reports properties accessed via method calls. Example: 'class Foo {\n int foo\n }\n\n def bar = new Foo()\n print(bar.getFoo())' After the quick-fix is applied: 'class Foo {\n int foo\n }\n\n def bar = new Foo()\n print(bar.foo)' Inspection ID: JavaStylePropertiesInvocation", + "markdown": "Reports properties accessed via method calls.\n\n**Example:**\n\n\n class Foo {\n int foo\n }\n\n def bar = new Foo()\n print(bar.getFoo())\n\nAfter the quick-fix is applied:\n\n\n class Foo {\n int foo\n }\n\n def bar = new Foo()\n print(bar.foo)\n\nInspection ID: JavaStylePropertiesInvocation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JavaStylePropertiesInvocation", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyTrivialConditional", + "shortDescription": { + "text": "Redundant conditional expression" + }, + "fullDescription": { + "text": "Reports ternary conditional operators of the form 'x ? true : false' or similar, which can be trivially simplified. Example: 'foo() ? true : false' After the quick-fix is applied: 'foo()' Inspection ID: GroovyTrivialConditional", + "markdown": "Reports ternary conditional operators of the form `x ? true : false` or similar, which can be trivially simplified.\n\n**Example:**\n\n\n foo() ? true : false\n\nAfter the quick-fix is applied:\n\n\n foo()\n\nInspection ID: GroovyTrivialConditional" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyTrivialConditional", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrUnnecessarySemicolon", + "shortDescription": { + "text": "Unnecessary semicolon" + }, + "fullDescription": { + "text": "Reports unnecessary semicolons. Example: 'print 2; print 3 // semicolon is required\n print 2; // semicolon is unnecessary' Inspection ID: GrUnnecessarySemicolon", + "markdown": "Reports unnecessary semicolons.\n\n**Example:**\n\n\n print 2; print 3 // semicolon is required\n print 2; // semicolon is unnecessary\n\nInspection ID: GrUnnecessarySemicolon" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrUnnecessarySemicolon", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrFinalVariableAccess", + "shortDescription": { + "text": "Final variable access" + }, + "fullDescription": { + "text": "Reports uninitialized final fields, invalid assignments to final variables, and parameters and fields. Inspection ID: GrFinalVariableAccess", + "markdown": "Reports uninitialized final fields, invalid assignments to final variables, and parameters and fields.\n\nInspection ID: GrFinalVariableAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrFinalVariableAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnnecessaryQualifiedReference", + "shortDescription": { + "text": "Unnecessary qualified reference" + }, + "fullDescription": { + "text": "Reports fully qualified references, which can be replaced with import. Example: 'def swingBuilder = new groovy.swing.SwingBuilder()' After the quick-fix is applied: 'import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()' Inspection ID: UnnecessaryQualifiedReference", + "markdown": "Reports fully qualified references, which can be replaced with import.\n\n**Example:**\n\n\n def swingBuilder = new groovy.swing.SwingBuilder()\n\nAfter the quick-fix is applied:\n\n\n import groovy.swing.SwingBuilder\n \n def swingBuilder = new SwingBuilder()\n\nInspection ID: UnnecessaryQualifiedReference" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnnecessaryQualifiedReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ChangeToMethod", + "shortDescription": { + "text": "Operator invocation can be replaced with method call" + }, + "fullDescription": { + "text": "Reports operator invocations that can be replaced with method calls. Example: 'a + b' After the quick-fix is applied: 'a.plus(b)' Inspection ID: ChangeToMethod", + "markdown": "Reports operator invocations that can be replaced with method calls.\n\n**Example:**\n\n\n a + b\n\nAfter the quick-fix is applied:\n\n\n a.plus(b)\n\nInspection ID: ChangeToMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ChangeToMethod", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyBreak", + "shortDescription": { + "text": "'break' statement" + }, + "fullDescription": { + "text": "Reports 'break' statements outside of 'switch' statements. Inspection ID: GroovyBreak", + "markdown": "Reports `break` statements outside of `switch` statements.\n\nInspection ID: GroovyBreak" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyBreak", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DelegatesTo", + "shortDescription": { + "text": "@DelegatesTo" + }, + "fullDescription": { + "text": "Reports unused '@DelegatesTo.Target' annotations and unresolved '@DelegatedTo.target' annotation attribute values. Example: '// unused target 't1' and unresolved target 't2'\n def m(\n @DelegatesTo.Target('t1') target,\n @DelegatesTo(target = 't2') Closure c\n ) {}' Inspection ID: DelegatesTo", + "markdown": "Reports unused `@DelegatesTo.Target` annotations and unresolved `@DelegatedTo.target` annotation attribute values.\n\n**Example:**\n\n\n // unused target 't1' and unresolved target 't2'\n def m(\n @DelegatesTo.Target('t1') target,\n @DelegatesTo(target = 't2') Closure c\n ) {}\n\nInspection ID: DelegatesTo" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DelegatesTo", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Annotations", + "index": 95, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyConstantConditional", + "shortDescription": { + "text": "Constant conditional expression" + }, + "fullDescription": { + "text": "Reports conditional expressions with boolean constant as a condition. Example: 'true ? result1 : result2\n false ? result1 : result2' Inspection ID: GroovyConstantConditional", + "markdown": "Reports conditional expressions with boolean constant as a condition.\n\n**Example:**\n\n\n true ? result1 : result2\n false ? result1 : result2\n\nInspection ID: GroovyConstantConditional" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyConstantConditional", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyOverlyComplexArithmeticExpression", + "shortDescription": { + "text": "Overly complex arithmetic expression" + }, + "fullDescription": { + "text": "Reports arithmetic expressions with too many terms. Such expressions may be confusing and bug-prone. Use the Maximum number of terms field to specify the maximum number of terms allowed in an arithmetic expression. Inspection ID: GroovyOverlyComplexArithmeticExpression", + "markdown": "Reports arithmetic expressions with too many terms.\n\n\nSuch expressions may be confusing and bug-prone.\n\n\nUse the **Maximum number of terms** field to specify the maximum number of terms allowed in an arithmetic expression.\n\nInspection ID: GroovyOverlyComplexArithmeticExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyOverlyComplexArithmeticExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrSwitchExhaustivenessCheck", + "shortDescription": { + "text": "Exhaustiveness check for switch expressions" + }, + "fullDescription": { + "text": "Reports switch expressions that do not cover all possible outcomes of the matched expression. Groovy does not require that switch expression must be exhaustive. It acts as if an implicit 'default -> null' branch is inserted. It may cause unexpected nulls if a developer forgets to insert necessary 'case' branches. Example: 'enum A { X, Y }\n\n def foo(A a) {\n def x = switch (a) { // reports switch\n case A.X -> ...\n }\n }' Inspection ID: GrSwitchExhaustivenessCheck", + "markdown": "Reports switch expressions that do not cover all possible outcomes of the matched expression.\n\nGroovy does not require that switch expression must be exhaustive. It acts as if an implicit `default -> null` branch is inserted.\nIt may cause unexpected nulls if a developer forgets to insert necessary `case` branches.\n\n**Example:**\n\n\n enum A { X, Y }\n\n def foo(A a) {\n def x = switch (a) { // reports switch\n case A.X -> ...\n }\n }\n\nInspection ID: GrSwitchExhaustivenessCheck" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GrSwitchExhaustivenessCheck", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyThrowFromFinallyBlock", + "shortDescription": { + "text": "'throw' inside 'finally' block" + }, + "fullDescription": { + "text": "Reports 'throw' statements inside of 'finally' blocks. While occasionally intended, such 'throw' statements may mask exceptions thrown and tremendously complicate debugging. Inspection ID: GroovyThrowFromFinallyBlock", + "markdown": "Reports `throw` statements inside of `finally` blocks.\n\n\nWhile occasionally intended, such `throw` statements may mask exceptions thrown and\ntremendously complicate debugging.\n\nInspection ID: GroovyThrowFromFinallyBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyThrowFromFinallyBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Error handling", + "index": 43, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyAssignabilityCheck", + "shortDescription": { + "text": "Incompatible type assignments" + }, + "fullDescription": { + "text": "Reports assignments with incompatible types. Such assignments might result in various runtime exceptions. Example: 'class A {}\n class B {}\n\n // incompatible assignment\n A a = new B()' Inspection ID: GroovyAssignabilityCheck", + "markdown": "Reports assignments with incompatible types.\n\nSuch assignments might result in various runtime exceptions.\n\n**Example:**\n\n\n class A {}\n class B {}\n\n // incompatible assignment\n A a = new B()\n\nInspection ID: GroovyAssignabilityCheck" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyAssignabilityCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Assignment issues", + "index": 65, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ChangeToOperator", + "shortDescription": { + "text": "Method call can be replaced with operator invocation" + }, + "fullDescription": { + "text": "Reports method calls that can be replaced with operator invocations. Example: 'a.plus(b)' After the quick-fix is applied: 'a + b' Inspection ID: ChangeToOperator", + "markdown": "Reports method calls that can be replaced with operator invocations.\n\n**Example:**\n\n\n a.plus(b)\n\nAfter the quick-fix is applied:\n\n\n a + b\n\nInspection ID: ChangeToOperator" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ChangeToOperator", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyMapGetCanBeKeyedAccess", + "shortDescription": { + "text": "Call to Map.get can be keyed access" + }, + "fullDescription": { + "text": "Reports calls to 'java.util.Map.get()' methods. Such calls could be replaced by the shorter and clearer keyed access form. Example: 'def map = [\"foo\": \"bar\"]\ndef str = map.get(\"foo\") // map.get(\"foo\") could be replaced with map[\"foo\"]'\n After the quick-fix is applied: 'def map = [\"foo\": \"bar\"]\ndef str = map[\"foo\"]'\n Inspection ID: GroovyMapGetCanBeKeyedAccess", + "markdown": "Reports calls to `java.util.Map.get()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def map = [\"foo\": \"bar\"]\n def str = map.get(\"foo\") // map.get(\"foo\") could be replaced with map[\"foo\"]\n\nAfter the quick-fix is applied:\n\n\n def map = [\"foo\": \"bar\"]\n def str = map[\"foo\"]\n\nInspection ID: GroovyMapGetCanBeKeyedAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyMapGetCanBeKeyedAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/GPath", + "index": 20, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyResultOfAssignmentUsed", + "shortDescription": { + "text": "Result of assignment used" + }, + "fullDescription": { + "text": "Reports assignment expressions nested inside other expressions to use the assigned value immediately. Such expressions may be confusing and violating the general design principle that a given construct should do precisely one thing. Inspection ID: GroovyResultOfAssignmentUsed", + "markdown": "Reports assignment expressions nested inside other expressions to use the assigned value immediately.\n\n\nSuch expressions may be confusing and violating the general design principle that a\ngiven construct should do precisely one thing.\n\nInspection ID: GroovyResultOfAssignmentUsed" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyResultOfAssignmentUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Assignment issues", + "index": 65, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUntypedAccess", + "shortDescription": { + "text": "Untyped reference expression" + }, + "fullDescription": { + "text": "Reports reference expressions whose type can't be determined. Inspection ID: GroovyUntypedAccess", + "markdown": "Reports reference expressions whose type can't be determined.\n\nInspection ID: GroovyUntypedAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUntypedAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyResultOfObjectAllocationIgnored", + "shortDescription": { + "text": "Result of object allocation ignored" + }, + "fullDescription": { + "text": "Reports object allocation where the result of this operation is ignored. Such allocation expressions are legal Groovy, but are usually either inadvertent, or evidence of a complicated object initialization strategy. Inspection ID: GroovyResultOfObjectAllocationIgnored", + "markdown": "Reports object allocation where the result of this operation is ignored.\n\n\nSuch allocation expressions are legal Groovy, but are usually either inadvertent, or\nevidence of a complicated object initialization strategy.\n\nInspection ID: GroovyResultOfObjectAllocationIgnored" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyResultOfObjectAllocationIgnored", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyNestedAssignment", + "shortDescription": { + "text": "Nested assignment" + }, + "fullDescription": { + "text": "Reports assignment expressions nested inside other expressions. While admirably terse, such expressions may be confusing, and violate the general design principle that a given construct should do precisely one thing. Example: 'a = b = 1'\n Inspection ID: GroovyNestedAssignment", + "markdown": "Reports assignment expressions nested inside other expressions. While admirably terse, such expressions may be confusing, and violate the general design principle that a given construct should do precisely one thing.\n\n**Example:**\n\n\n a = b = 1\n\nInspection ID: GroovyNestedAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyNestedAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Assignment issues", + "index": 65, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyDocCheck", + "shortDescription": { + "text": "Unresolved GroovyDoc reference" + }, + "fullDescription": { + "text": "Reports unresolved references inside GroovyDoc comments. Inspection ID: GroovyDocCheck", + "markdown": "Reports unresolved references inside GroovyDoc comments.\n\nInspection ID: GroovyDocCheck" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "GroovyDocCheck", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUnusedCatchParameter", + "shortDescription": { + "text": "Unused 'catch' parameter" + }, + "fullDescription": { + "text": "Reports catch parameters that are unused in their corresponding blocks. This inspection will not report any catch parameters named \"ignore\" or \"ignored\". Example: 'try {\n def arr = new int[3]\n arr[5] = 5\n } catch(Exception ex) {\n println('Catching the exception')\n }' Here the parameter ex is never used in catch block. After the quick-fix is applied: 'try {\n def arr = new int[3]\n arr[5] = 5\n } catch(Exception ignored) {\n println('Catching the exception')\n }' Inspection ID: GroovyUnusedCatchParameter", + "markdown": "Reports **catch** parameters that are unused in their\ncorresponding blocks. This inspection will not report any **catch** parameters\nnamed \"ignore\" or \"ignored\".\n\n**Example:**\n\n\n try {\n def arr = new int[3]\n arr[5] = 5\n } catch(Exception ex) {\n println('Catching the exception')\n }\n\nHere the parameter **ex** is never used in **catch** block.\n\nAfter the quick-fix is applied:\n\n\n try {\n def arr = new int[3]\n arr[5] = 5\n } catch(Exception ignored) {\n println('Catching the exception')\n }\n\nInspection ID: GroovyUnusedCatchParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUnusedCatchParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Error handling", + "index": 43, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyInstanceMethodNamingConvention", + "shortDescription": { + "text": "Instance method naming convention" + }, + "fullDescription": { + "text": "Reports instance methods whose names are too short, too long, or do not follow the specified regular expression pattern. Instance methods that override library methods are ignored by this inspection. Use the fields provided below to specify minimum length, maximum length and regular expression expected for instance method names. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: GroovyInstanceMethodNamingConvention", + "markdown": "Reports instance methods whose names are too short, too long, or do not follow the specified regular expression pattern. Instance methods that override library methods are ignored by this inspection.\n\n\nUse the fields provided below to specify minimum length, maximum length and regular expression expected for instance method names.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: GroovyInstanceMethodNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyInstanceMethodNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Naming conventions", + "index": 37, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovySynchronizedMethod", + "shortDescription": { + "text": "Synchronized method" + }, + "fullDescription": { + "text": "Reports the 'synchronized' modifier on methods. Some coding standards prohibit the use of the 'synchronized' modifier, in favor of 'synchronized' statements. Inspection ID: GroovySynchronizedMethod", + "markdown": "Reports the `synchronized` modifier on methods.\n\n\nSome coding standards\nprohibit the use of the `synchronized` modifier, in favor of `synchronized` statements.\n\nInspection ID: GroovySynchronizedMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovySynchronizedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUnconditionalWait", + "shortDescription": { + "text": "Unconditional 'wait' call" + }, + "fullDescription": { + "text": "Reports wait() being called unconditionally within a synchronized context. Normally, wait() is used to block a thread until some condition is true. If wait() is called unconditionally, that often indicates that the condition was checked before a lock was acquired. In that case, a data race may occur, with the condition becoming true between the time it was checked and the time the lock was acquired. While constructs found by this inspection are not necessarily incorrect, they are certainly worth examining. Inspection ID: GroovyUnconditionalWait", + "markdown": "Reports **wait()**\nbeing called unconditionally within a synchronized context.\nNormally, **wait()** is\nused to block a thread until some condition is true. If **wait()**\nis called unconditionally, that often indicates that the condition was checked before a lock was\nacquired. In that case, a data race may occur, with the condition becoming true between the time\nit was checked and the time the lock was acquired. While constructs found by this inspection\nare not necessarily incorrect, they are certainly worth examining.\n\nInspection ID: GroovyUnconditionalWait" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUnconditionalWait", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyContinue", + "shortDescription": { + "text": "'continue' statement" + }, + "fullDescription": { + "text": "Reports 'continue' statements. Inspection ID: GroovyContinue", + "markdown": "Reports `continue` statements.\n\nInspection ID: GroovyContinue" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyContinue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUnsynchronizedMethodOverridesSynchronizedMethod", + "shortDescription": { + "text": "Unsynchronized method overrides synchronized method" + }, + "fullDescription": { + "text": "Reports non-synchronized methods overriding synchronized methods. Example: 'abstract class Base {\n synchronized void foo() {\n // ...\n }\n }\n class Derived extends Base {\n @Override\n void foo() {\n super.foo()\n // ...\n }\n }' Here the non-synchronized method 'foo()' in class 'Bar' overrides synchronized method. Inspection ID: GroovyUnsynchronizedMethodOverridesSynchronizedMethod", + "markdown": "Reports non-**synchronized** methods overriding **synchronized** methods.\n\n**Example:**\n\n\n abstract class Base {\n synchronized void foo() {\n // ...\n }\n }\n class Derived extends Base {\n @Override\n void foo() {\n super.foo()\n // ...\n }\n }\n\nHere the non-synchronized method `foo()` in class `Bar` overrides synchronized method.\n\nInspection ID: GroovyUnsynchronizedMethodOverridesSynchronizedMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUnsynchronizedMethodOverridesSynchronizedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyNegatedIf", + "shortDescription": { + "text": "Negated if condition expression" + }, + "fullDescription": { + "text": "Reports 'if' statements which contain 'else' branches and whose conditions are negated. Flipping the order of the 'if' and 'else' branches will usually increase the clarity of such statements. Example: 'if (!condition) {\n return \"1\"\n} else {\n return \"2\"\n}'\n Inspection ID: GroovyNegatedIf", + "markdown": "Reports `if` statements which contain `else` branches and whose conditions are negated. Flipping the order of the `if` and `else` branches will usually increase the clarity of such statements.\n\n**Example:**\n\n\n if (!condition) {\n return \"1\"\n } else {\n return \"2\"\n }\n\nInspection ID: GroovyNegatedIf" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyNegatedIf", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NewGroovyClassNamingConvention", + "shortDescription": { + "text": "Class naming convention" + }, + "fullDescription": { + "text": "Reports classes whose names are too short, too long, or do not follow the specified regular expression pattern. For each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the provided input fields. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: NewGroovyClassNamingConvention", + "markdown": "Reports classes whose names are too short, too long, or do not follow\nthe specified regular expression pattern.\n\nFor each class type, specify the minimum length, maximum length, and the regular expression expected for class names using the\nprovided input fields.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: NewGroovyClassNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NewGroovyClassNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Naming conventions", + "index": 37, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClashingGetters", + "shortDescription": { + "text": "Clashing getters" + }, + "fullDescription": { + "text": "Reports boolean methods which can be accessed via the same property name. The result of accessing such property might be unexpected. Example: 'class X {\n boolean isFoo() { true }\n boolean getFoo() { false }\n }\n\n // getFoo() will be called\n new X().foo' Inspection ID: ClashingGetters", + "markdown": "Reports boolean methods which can be accessed via the same property name.\n\nThe result of accessing such property might be unexpected.\n\n**Example:**\n\n\n class X {\n boolean isFoo() { true }\n boolean getFoo() { false }\n }\n\n // getFoo() will be called\n new X().foo\n\nInspection ID: ClashingGetters" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClashingGetters", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyDuplicateSwitchBranch", + "shortDescription": { + "text": "Duplicate switch case" + }, + "fullDescription": { + "text": "Reports duplicated expressions in 'case' labels for 'switch' statements. Example: 'switch (n) {\n case 1: //duplicate\n break\n case 1: //duplicate\n System.out.println(\"2\")\n break\n default:\n System.out.println(\"default\");\n}'\n Inspection ID: GroovyDuplicateSwitchBranch", + "markdown": "Reports duplicated expressions in `case` labels for `switch` statements.\n\n**Example:**\n\n\n switch (n) {\n case 1: //duplicate\n break\n case 1: //duplicate\n System.out.println(\"2\")\n break\n default:\n System.out.println(\"default\");\n }\n\nInspection ID: GroovyDuplicateSwitchBranch" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyDuplicateSwitchBranch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Validity issues", + "index": 107, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovySwitchStatementWithNoDefault", + "shortDescription": { + "text": "Switch statement with no default case" + }, + "fullDescription": { + "text": "Reports 'switch' statements that do not contain 'default' labels. Some coding practices may insist on adding this label to all 'switch' statements. Inspection ID: GroovySwitchStatementWithNoDefault", + "markdown": "Reports `switch` statements that do not contain `default` labels.\n\n\nSome coding practices may insist on adding this label to all `switch` statements.\n\nInspection ID: GroovySwitchStatementWithNoDefault" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovySwitchStatementWithNoDefault", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyListGetCanBeKeyedAccess", + "shortDescription": { + "text": "Call to List.get can be keyed access" + }, + "fullDescription": { + "text": "Reports calls to 'java.util.List.get()' methods. Such calls could be replaced by the shorter and clearer keyed access form. Example: 'def list = [\"foo\"]\ndef str = list.get(0) // list.get(0) could be replaced with list[0]'\n After the quick-fix is applied: 'def list = [\"foo\"]\ndef str = list[0]'\n Inspection ID: GroovyListGetCanBeKeyedAccess", + "markdown": "Reports calls to `java.util.List.get()` methods. Such calls could be replaced by the shorter and clearer keyed access form.\n\n**Example:**\n\n\n def list = [\"foo\"]\n def str = list.get(0) // list.get(0) could be replaced with list[0]\n\nAfter the quick-fix is applied:\n\n\n def list = [\"foo\"]\n def str = list[0]\n\nInspection ID: GroovyListGetCanBeKeyedAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyListGetCanBeKeyedAccess", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/GPath", + "index": 20, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovySynchronizationOnThis", + "shortDescription": { + "text": "Synchronization on 'this'" + }, + "fullDescription": { + "text": "Reports synchronization which uses 'this' as its lock expression. Constructs reported include 'synchronized' blocks which lock 'this', and calls to 'wait()' 'notify()' or 'notifyAll()' which target 'wait()'. Such constructs, like synchronized methods, make it hard to track just who is locking on a given object, and make possible \"denial of service\" attacks on objects. As an alternative, consider locking on a private instance variable, access to which can be completely controlled. Inspection ID: GroovySynchronizationOnThis", + "markdown": "Reports synchronization which uses `this` as its lock expression.\n\n\nConstructs reported include `synchronized`\nblocks which lock `this`, and calls to `wait()`\n`notify()` or `notifyAll()` which target `wait()`.\nSuch constructs, like synchronized methods, make it hard to track just who is locking on a given\nobject, and make possible \"denial of service\" attacks on objects. As an alternative, consider\nlocking on a private instance variable, access to which can be completely controlled.\n\nInspection ID: GroovySynchronizationOnThis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovySynchronizationOnThis", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyNestedSynchronizedStatement", + "shortDescription": { + "text": "Nested 'synchronized' statement" + }, + "fullDescription": { + "text": "Reports nested 'synchronized' statements. Nested 'synchronized' statements are either redundant (if the lock objects are identical) or prone to deadlock. Inspection ID: GroovyNestedSynchronizedStatement", + "markdown": "Reports nested `synchronized` statements.\n\n\nNested `synchronized` statements\nare either redundant (if the lock objects are identical) or prone to deadlock.\n\nInspection ID: GroovyNestedSynchronizedStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyNestedSynchronizedStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyGStringKey", + "shortDescription": { + "text": "GString map key" + }, + "fullDescription": { + "text": "Reports statements which use a 'groovy.lang.GString' object as a key to map. In general 'GString' objects are mutable and probably should not be used as keys. Also, a 'GString' entry cannot be accessed with a 'java.lang.String' object with same value. Example: 'def map = [:]\ndef key = 'foo'\nmap << [\"${key}\": 'bar']\nassert map[key] == null // confusing 'true' result of comparison'\n Inspection ID: GroovyGStringKey New in 2017.1", + "markdown": "Reports statements which use a `groovy.lang.GString` object as a key to map. In general `GString` objects are mutable and probably should not be used as keys. Also, a `GString` entry cannot be accessed with a `java.lang.String` object with same value.\n\n**Example:**\n\n\n def map = [:]\n def key = 'foo'\n map << [\"${key}\": 'bar']\n assert map[key] == null // confusing 'true' result of comparison\n\nInspection ID: GroovyGStringKey\n\nNew in 2017.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyGStringKey", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NewInstanceOfSingleton", + "shortDescription": { + "text": "New instance of class annotated with @groovy.lang.Singleton" + }, + "fullDescription": { + "text": "Reports new instance creation of classes annotated with '@groovy.lang.Singleton'. Such constructions can lead to runtime exception Can't instantiate singleton. Example: '@Singleton\n class Foo{\n }\n \n Foo foo = new Foo()' After the quick-fix is applied: '@Singleton\n class Foo{\n }\n \n Foo foo = Foo.instance' Inspection ID: NewInstanceOfSingleton", + "markdown": "Reports new instance creation of classes annotated with `@groovy.lang.Singleton`.\nSuch constructions can lead to runtime exception **Can't instantiate singleton**.\n\n**Example:**\n\n\n @Singleton\n class Foo{\n }\n \n Foo foo = new Foo()\n\nAfter the quick-fix is applied:\n\n\n @Singleton\n class Foo{\n }\n \n Foo foo = Foo.instance\n\nInspection ID: NewInstanceOfSingleton" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NewInstanceOfSingleton", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyVariableCanBeFinal", + "shortDescription": { + "text": "Variable can be final" + }, + "fullDescription": { + "text": "Reports parameters or local variables that may have a final modifier added. Example: 'def list = [1,2,3]\n return list' After the quick-fix is applied: 'final def list = [1,2,3]\n return list' For more information, see the same inspection in Java. Inspection ID: GroovyVariableCanBeFinal", + "markdown": "Reports parameters or local variables that may have a final modifier added.\n\n**Example:**\n\n\n def list = [1,2,3]\n return list\n\nAfter the quick-fix is applied:\n\n\n final def list = [1,2,3]\n return list\n\nFor more information, see the same inspection in Java.\n\nInspection ID: GroovyVariableCanBeFinal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyVariableCanBeFinal", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Data flow", + "index": 112, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyWaitCallNotInLoop", + "shortDescription": { + "text": "'wait()' not in loop" + }, + "fullDescription": { + "text": "Reports calls to 'wait()' not made inside a loop. 'wait()' is normally used to suspend a thread until a condition is true, and that condition should be checked after the 'wait()' returns. A loop is the clearest way to achieve this. Inspection ID: GroovyWaitCallNotInLoop", + "markdown": "Reports calls to `wait()` not made inside a loop.\n\n`wait()` is normally used to suspend a thread until a condition is true, and that condition should be checked after the `wait()`\nreturns. A loop is the clearest way to achieve this.\n\nInspection ID: GroovyWaitCallNotInLoop" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyWaitCallNotInLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUnnecessaryReturn", + "shortDescription": { + "text": "Unnecessary 'return' statement" + }, + "fullDescription": { + "text": "Reports 'return' statements at the end of constructors and methods returning 'void'. These are unnecessary and may be safely removed. Example: 'void foo (String s){\n print(s)\n return\n }' After the quick-fix is applied: 'void foo (String s){\n print(s)\n }' For more information, see the same inspection in Java. Inspection ID: GroovyUnnecessaryReturn", + "markdown": "Reports `return` statements at the end of constructors and methods returning\n`void`. These are unnecessary and may be safely removed.\n\n**Example:**\n\n\n void foo (String s){\n print(s)\n return\n }\n\nAfter the quick-fix is applied:\n\n\n void foo (String s){\n print(s)\n }\n\nFor more information, see the same inspection in Java.\n\nInspection ID: GroovyUnnecessaryReturn" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUnnecessaryReturn", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrReassignedInClosureLocalVar", + "shortDescription": { + "text": "Local variable is reassigned in closure or anonymous class" + }, + "fullDescription": { + "text": "Reports local variables assigned to expression with different type inside of closure or anonymous class. Example: 'int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)' As a result, the 'integer' variable sum is reassigned to a 'String' expression. Inspection ID: GrReassignedInClosureLocalVar", + "markdown": "Reports local variables assigned to expression with different type inside of closure or anonymous class.\n\n**Example:**\n\n\n int sum = 0\n [1, 2, 3].each { sum += 'as' }\n println(sum)\n\nAs a result, the `integer` variable **sum** is reassigned to a `String` expression.\n\nInspection ID: GrReassignedInClosureLocalVar" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrReassignedInClosureLocalVar", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyMethodParameterCount", + "shortDescription": { + "text": "Method with too many parameters" + }, + "fullDescription": { + "text": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection. Use the Maximum number of parameters: field to specify the maximum acceptable number of parameters a method might have. Inspection ID: GroovyMethodParameterCount", + "markdown": "Reports methods with too many parameters. Method with too many parameters is a good sign that refactoring is necessary. Methods whose signatures are inherited from library classes are ignored by this inspection.\n\n\nUse the **Maximum number of parameters:** field to specify the maximum acceptable number of parameters a method might have.\n\nInspection ID: GroovyMethodParameterCount" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyMethodParameterCount", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Method metrics", + "index": 113, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyConditional", + "shortDescription": { + "text": "Ternary expression" + }, + "fullDescription": { + "text": "Reports ternary expressions. Some coding standards prohibit the use of the condition operator in favor of 'if' statements. Inspection ID: GroovyConditional", + "markdown": "Reports ternary expressions.\n\nSome coding standards prohibit the use of the condition operator in favor of `if` statements.\n\nInspection ID: GroovyConditional" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyConditional", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyAccessToStaticFieldLockedOnInstance", + "shortDescription": { + "text": "Access to static field locked on instance data" + }, + "fullDescription": { + "text": "Reports accesses to a non-constant static field which is locked on either 'this' or an instance field of 'this'. Locking a static field on instance data does not prevent the field from being modified by other instances, and thus may result in surprising race conditions. Example: 'static String s;\n def foo() {\n synchronized (this) {\n System.out.println(s); // warning\n }\n }' Inspection ID: GroovyAccessToStaticFieldLockedOnInstance", + "markdown": "Reports accesses to a non-constant static field which is locked on either `this` or an instance field of `this`.\n\n\nLocking a static field on instance data does not prevent the field from being\nmodified by other instances, and thus may result in surprising race conditions.\n\n**Example:**\n\n\n static String s;\n def foo() {\n synchronized (this) {\n System.out.println(s); // warning\n }\n }\n\nInspection ID: GroovyAccessToStaticFieldLockedOnInstance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyAccessToStaticFieldLockedOnInstance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyNestedConditional", + "shortDescription": { + "text": "Nested conditional expression" + }, + "fullDescription": { + "text": "Reports ternary conditional expressions that are nested inside other conditional expressions. Such nested conditionals may be very confusing. \"Elvis\" expressions are counted as conditionals for purpose of this inspection. Example: 'return (condition ? \"result\" : null) ?: \"fail\"'\n Inspection ID: GroovyNestedConditional", + "markdown": "Reports ternary conditional expressions that are nested inside other conditional expressions. Such nested conditionals may be very confusing. \"Elvis\" expressions are counted as conditionals for purpose of this inspection.\n\n**Example:**\n\n\n return (condition ? \"result\" : null) ?: \"fail\"\n\nInspection ID: GroovyNestedConditional" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyNestedConditional", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyEmptyStatementBody", + "shortDescription": { + "text": "Statement with empty body" + }, + "fullDescription": { + "text": "Reports 'if', 'while', 'do' or 'for' statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo. Example: 'if (condition) {}\nwhile(true){}'\n Inspection ID: GroovyEmptyStatementBody", + "markdown": "Reports `if`, `while`, `do` or `for` statements with empty bodies. While occasionally intended, this construction is confusing, and often the result of a typo.\n\n**Example:**\n\n\n if (condition) {}\n while(true){}\n\nInspection ID: GroovyEmptyStatementBody" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyEmptyStatementBody", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyLabeledStatement", + "shortDescription": { + "text": "Labeled statement inspection" + }, + "fullDescription": { + "text": "Reports labels already used in parent workflow. Example: 'def list = [\"foo\"]\ncycle:\nfor (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n}'\n Inspection ID: GroovyLabeledStatement", + "markdown": "Reports labels already used in parent workflow.\n\n**Example:**\n\n\n def list = [\"foo\"]\n cycle:\n for (element in list) {\n cycle: // confusing label repeat\n element.chars().forEach {\n }\n }\n\nInspection ID: GroovyLabeledStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyLabeledStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyAssignmentToForLoopParameter", + "shortDescription": { + "text": "Assignment to 'for' loop parameter" + }, + "fullDescription": { + "text": "Reports assignments to for loop parameters inside the for loop body. While occasionally intended, this construct can be extremely confusing, and is often the result of a typo. Example: 'for (value in [1, 2, 3]) {\n value = 4 // warning\n }' Inspection ID: GroovyAssignmentToForLoopParameter", + "markdown": "Reports assignments to **for** loop parameters inside the **for** loop body.\n\nWhile occasionally intended, this construct can be extremely confusing, and is often the result of a typo.\n\n**Example:**\n\n\n for (value in [1, 2, 3]) {\n value = 4 // warning\n }\n\nInspection ID: GroovyAssignmentToForLoopParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyAssignmentToForLoopParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Assignment issues", + "index": 65, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrUnnecessaryAlias", + "shortDescription": { + "text": "Unnecessary import alias" + }, + "fullDescription": { + "text": "Reports unnecessary import aliases. Example: 'import com.foo.Bar as Bar' After the quick-fix is applied: 'import com.foo.Bar' Inspection ID: GrUnnecessaryAlias", + "markdown": "Reports unnecessary import aliases.\n\n**Example:**\n\n\n import com.foo.Bar as Bar\n\nAfter the quick-fix is applied:\n\n\n import com.foo.Bar\n\nInspection ID: GrUnnecessaryAlias" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GrUnnecessaryAlias", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyAssignmentCanBeOperatorAssignment", + "shortDescription": { + "text": "Assignment can be replaced with operator assignment" + }, + "fullDescription": { + "text": "Reports assignments which can be replaced by an operator assignment. Example: 'a = a + b' After the quick-fix is applied: 'a += b' Configure the inspection: Use the Ignore conditional operators option to ignore '&&' and '||' operators. Use the Ignore obscure operators option to ignore '^' and '%' operators. Inspection ID: GroovyAssignmentCanBeOperatorAssignment", + "markdown": "Reports assignments which can be replaced by an operator assignment.\n\n**Example:**\n\n\n a = a + b\n\nAfter the quick-fix is applied:\n\n\n a += b\n\nConfigure the inspection:\n\n* Use the **Ignore conditional operators** option to ignore `&&` and `||` operators.\n* Use the **Ignore obscure operators** option to ignore `^` and `%` operators.\n\nInspection ID: GroovyAssignmentCanBeOperatorAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GroovyAssignmentCanBeOperatorAssignment", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Assignment issues", + "index": 65, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyImplicitNullArgumentCall", + "shortDescription": { + "text": "Implicit null argument" + }, + "fullDescription": { + "text": "Reports calls with no arguments to method that has exactly one parameter. This is equivalent to call with 'null', and that behavior is often confusing and unintended. Example: 'def foo(String s){}\nfoo() // this call is actually 'foo(null)' call'\n Inspection ID: GroovyImplicitNullArgumentCall", + "markdown": "Reports calls with no arguments to method that has exactly one parameter. This is equivalent to call with `null`, and that behavior is often confusing and unintended.\n\n**Example:**\n\n\n def foo(String s){}\n foo() // this call is actually 'foo(null)' call\n\nInspection ID: GroovyImplicitNullArgumentCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GroovyImplicitNullArgumentCall", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyReturnFromFinallyBlock", + "shortDescription": { + "text": "'return' inside 'finally' block" + }, + "fullDescription": { + "text": "Reports 'return' statements inside of 'finally' blocks. While occasionally intended, such 'return' statements may mask exceptions thrown, and complicate debugging. Inspection ID: GroovyReturnFromFinallyBlock", + "markdown": "Reports `return` statements inside of `finally` blocks.\n\n\nWhile occasionally intended, such `return` statements may mask exceptions thrown, and\ncomplicate debugging.\n\nInspection ID: GroovyReturnFromFinallyBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyReturnFromFinallyBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Error handling", + "index": 43, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyConstructorNamedArguments", + "shortDescription": { + "text": "Named arguments of constructor call" + }, + "fullDescription": { + "text": "Reports named arguments of a default class constructor call which don't correspond to properties of this class. Example: 'class Person {\n def name\n def age\n }\n\n // 'firstName' property doesn't exist\n new Person(firstName: \"John\")' Inspection ID: GroovyConstructorNamedArguments", + "markdown": "Reports named arguments of a default class constructor call which don't correspond to properties of this class.\n\n**Example:**\n\n\n class Person {\n def name\n def age\n }\n\n // 'firstName' property doesn't exist\n new Person(firstName: \"John\")\n\nInspection ID: GroovyConstructorNamedArguments" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyConstructorNamedArguments", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyConditionalWithIdenticalBranches", + "shortDescription": { + "text": "Ternary expression with identical branches" + }, + "fullDescription": { + "text": "Reports ternary expressions with identical \"then\" and \"else\" branches. Such expressions are almost certainly a programmer error. The quick-fix replaces the expression with its \"then\" branch. Example: 'condition ? a.foo() : a.foo()' After the quick-fix is applied: 'a.foo()' Inspection ID: GroovyConditionalWithIdenticalBranches", + "markdown": "Reports ternary expressions with identical \"then\" and \"else\" branches. Such expressions are almost certainly a programmer error.\n\nThe quick-fix replaces the expression with its \"then\" branch.\n\n**Example:**\n\n\n condition ? a.foo() : a.foo()\n\nAfter the quick-fix is applied:\n\n\n a.foo()\n\nInspection ID: GroovyConditionalWithIdenticalBranches" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyConditionalWithIdenticalBranches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrUnnecessaryNonSealedModifier", + "shortDescription": { + "text": "Unnecessary 'non-sealed' modifier" + }, + "fullDescription": { + "text": "Reports unnecessary 'non-sealed' modifiers which used on methods, fields, or variables. This modifier has effect only on classes, interfaces and traits. Example: 'non-sealed boolean foo() {} // modifier is unnecessary\n non-sealed Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n non-sealed class A {}' Inspection ID: GrUnnecessaryNonSealedModifier", + "markdown": "Reports unnecessary `non-sealed` modifiers which used on methods, fields, or variables.\n\nThis modifier has effect only on classes, interfaces and traits.\n\n**Example:**\n\n\n non-sealed boolean foo() {} // modifier is unnecessary\n non-sealed Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n non-sealed class A {}\n\nInspection ID: GrUnnecessaryNonSealedModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrUnnecessaryNonSealedModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrAnnotationReferencingUnknownIdentifiers", + "shortDescription": { + "text": "@TupleConstructor and @MapConstructor" + }, + "fullDescription": { + "text": "Reports unresolved identifiers in '@TupleConstructor' and '@MapConstructor' 'includes' and 'excludes' annotation attribute values. Example: '// unresolved 'c'\n @TupleConstructor(includes = ['a', 'b', 'c'])\n class X {\n def a\n def b\n }' Inspection ID: GrAnnotationReferencingUnknownIdentifiers", + "markdown": "Reports unresolved identifiers in `@TupleConstructor` and `@MapConstructor` `includes` and `excludes` annotation attribute values.\n\n**Example:**\n\n\n // unresolved 'c'\n @TupleConstructor(includes = ['a', 'b', 'c'])\n class X {\n def a\n def b\n }\n\nInspection ID: GrAnnotationReferencingUnknownIdentifiers" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrAnnotationReferencingUnknownIdentifiers", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Annotations", + "index": 95, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrUnnecessaryDefModifier", + "shortDescription": { + "text": "Unnecessary 'def'" + }, + "fullDescription": { + "text": "Reports unnecessary 'def' modifiers when used with explicit type declaration. Example: 'def boolean foo() {} // modifier is unnecessary\n def Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n def (int a, String b) = []' Inspection ID: GrUnnecessaryDefModifier", + "markdown": "Reports unnecessary `def` modifiers when used with explicit type declaration.\n\n**Example:**\n\n\n def boolean foo() {} // modifier is unnecessary\n def Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n def (int a, String b) = []\n\nInspection ID: GrUnnecessaryDefModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrUnnecessaryDefModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrUnresolvedAccess", + "shortDescription": { + "text": "Unresolved reference expression" + }, + "fullDescription": { + "text": "Reports reference expressions which cannot be resolved. Inspection ID: GrUnresolvedAccess", + "markdown": "Reports reference expressions which cannot be resolved.\n\nInspection ID: GrUnresolvedAccess" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GrUnresolvedAccess", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrPOJO", + "shortDescription": { + "text": "@POJO without @CompileStatic" + }, + "fullDescription": { + "text": "Reports annotation '@groovy.transform.stc.POJO' applied without '@groovy.transform.CompileStatic'. Annotation '@POJO' changes compilation process of Groovy classes to bytecode. It has no effect without explicitly enabled static compilation (which is done via '@CompileStatic' annotation). Example: '@POJO // reports @POJO\n class A {}' Inspection ID: GrPOJO", + "markdown": "Reports annotation `@groovy.transform.stc.POJO` applied without `@groovy.transform.CompileStatic`.\n\nAnnotation `@POJO` changes compilation process of Groovy classes to bytecode. It has no effect without explicitly enabled static compilation (which is done via `@CompileStatic` annotation).\n\n**Example:**\n\n\n @POJO // reports @POJO\n class A {}\n\nInspection ID: GrPOJO" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrPOJO", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Annotations", + "index": 95, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyWaitWhileNotSynchronized", + "shortDescription": { + "text": "'wait()' while not synced" + }, + "fullDescription": { + "text": "Reports calls to 'wait()' not made inside a corresponding synchronized statement or synchronized method. Calling 'wait()' on an object without holding a lock on that object will result in an 'IllegalMonitorStateException' being thrown. Such a construct is not necessarily an error, as the necessary lock may be acquired before the containing method is called, but its worth looking at. Inspection ID: GroovyWaitWhileNotSynchronized", + "markdown": "Reports calls to `wait()` not made inside a corresponding synchronized\nstatement or synchronized method.\n\nCalling `wait()` on an object\nwithout holding a lock on that object will result in an `IllegalMonitorStateException` being thrown.\nSuch a construct is not necessarily an error, as the necessary lock may be acquired before\nthe containing method is called, but its worth looking at.\n\nInspection ID: GroovyWaitWhileNotSynchronized" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyWaitWhileNotSynchronized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyMultipleReturnPointsPerMethod", + "shortDescription": { + "text": "Method with multiple return points" + }, + "fullDescription": { + "text": "Reports methods with too many return points. Methods with too many return points may be confusing, and hard to refactor. Example: 'int foo(int a) {\n if (a > 0) {\n return a\n }\n if (a < 0) return -a\n return 0\n }'\n Use the field provided below to specify the maximum acceptable number of return points a method might have. Inspection ID: GroovyMultipleReturnPointsPerMethod", + "markdown": "Reports methods with too many return points. Methods with too many return points may be confusing, and hard to refactor.\n\n**Example:**\n\n\n int foo(int a) {\n if (a > 0) {\n return a\n }\n if (a < 0) return -a\n return 0\n }\n\n\nUse the field provided below to specify the maximum acceptable number of return points a method\nmight have.\n\nInspection ID: GroovyMultipleReturnPointsPerMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyMultipleReturnPointsPerMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Method metrics", + "index": 113, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyConditionalCanBeElvis", + "shortDescription": { + "text": "Ternary expression can be replaced with elvis expression" + }, + "fullDescription": { + "text": "Reports ternary expressions which can be replaced by an elvis expression. Example: 'def notNull(o, defaultValue) {\n o != null ? o : defaultValue\n }' After the quick-fix is applied: 'def notNull(o, defaultValue) {\n o ?: defaultValue\n }' Inspection ID: GroovyConditionalCanBeElvis", + "markdown": "Reports ternary expressions which can be replaced by an elvis expression.\n\n**Example:**\n\n\n def notNull(o, defaultValue) {\n o != null ? o : defaultValue\n }\n\nAfter the quick-fix is applied:\n\n\n def notNull(o, defaultValue) {\n o ?: defaultValue\n }\n\nInspection ID: GroovyConditionalCanBeElvis" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GroovyConditionalCanBeElvis", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrUnnecessaryFinalModifier", + "shortDescription": { + "text": "Unnecessary 'final'" + }, + "fullDescription": { + "text": "Reports unnecessary 'final' modifiers when used with the record definition. Example: 'final record R(int a) {} // modifier is unnecessary' Inspection ID: GrUnnecessaryFinalModifier", + "markdown": "Reports unnecessary `final` modifiers when used with the record definition.\n\n**Example:**\n\n\n final record R(int a) {} // modifier is unnecessary\n\nInspection ID: GrUnnecessaryFinalModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrUnnecessaryFinalModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyOverlyLongMethod", + "shortDescription": { + "text": "Overly long method" + }, + "fullDescription": { + "text": "Reports methods that are too long. Methods that are too long may be confusing, and are a good sign that refactoring is necessary. Use the Maximum statements per method field to specify the maximum acceptable number of non-comment source statements a method might have. Inspection ID: GroovyOverlyLongMethod", + "markdown": "Reports methods that are too long.\n\n\nMethods that are too long\nmay be confusing, and are a good sign that refactoring is necessary.\n\n\nUse the **Maximum statements per method** field to specify the maximum acceptable number of non-comment source\nstatements a method might have.\n\nInspection ID: GroovyOverlyLongMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyOverlyLongMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Method metrics", + "index": 113, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SecondUnsafeCall", + "shortDescription": { + "text": "Second unsafe call" + }, + "fullDescription": { + "text": "Reports possible NullPointerException during chain methods or properties call. Example: 'domain?.getZone().getName()' After the quick-fix is applied: 'domain?.getZone()?.getName()' Inspection ID: SecondUnsafeCall", + "markdown": "Reports possible **NullPointerException** during chain methods or properties call.\n\n**Example:**\n\n\n domain?.getZone().getName()\n\nAfter the quick-fix is applied:\n\n\n domain?.getZone()?.getName()\n\nInspection ID: SecondUnsafeCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SecondUnsafeCall", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrPackage", + "shortDescription": { + "text": "Package mismatch" + }, + "fullDescription": { + "text": "Reports files with a declared package that does not match the package expected. Also, reports files without 'package' statements if the class is not located directly in the source root directory. Inspection ID: GrPackage", + "markdown": "Reports files with a declared package that does not match the package expected. Also, reports files without `package` statements if the class is not located directly in the source root directory.\n\nInspection ID: GrPackage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrPackage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyOverlyComplexBooleanExpression", + "shortDescription": { + "text": "Overly complex boolean expression" + }, + "fullDescription": { + "text": "Reports boolean expressions with too many terms. Such expressions may be confusing and bug-prone. Use the Maximum number of terms field to specify the maximum number of terms allowed in a boolean expression. Inspection ID: GroovyOverlyComplexBooleanExpression", + "markdown": "Reports boolean expressions with too many terms.\n\n\nSuch expressions may be confusing and bug-prone.\n\n\nUse the **Maximum number of terms** field to specify the maximum number of terms allowed in a boolean expression.\n\nInspection ID: GroovyOverlyComplexBooleanExpression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyOverlyComplexBooleanExpression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUnreachableStatement", + "shortDescription": { + "text": "Unreachable statement" + }, + "fullDescription": { + "text": "Reports statements that are unreachable. This can occur if the statement is after an infinite loop, 'return', 'break', or 'continue' statement. Example: 'void foo (int n) {\n if (n < 1) {\n return\n print('This statement is unreachable')\n }\n while (true){\n print ('Hello, world!')\n }\n print('This statement is unreachable too')\n }' Inspection ID: GroovyUnreachableStatement", + "markdown": "Reports statements that are unreachable. This can occur if the statement is after an infinite loop,\n`return`, `break`, or `continue` statement.\n\n**Example:**\n\n\n void foo (int n) {\n if (n < 1) {\n return\n print('This statement is unreachable')\n }\n while (true){\n print ('Hello, world!')\n }\n print('This statement is unreachable too')\n }\n\nInspection ID: GroovyUnreachableStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUnreachableStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Validity issues", + "index": 107, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovySystemRunFinalizersOnExit", + "shortDescription": { + "text": "Call to System.runFinalizersOnExit()" + }, + "fullDescription": { + "text": "Reports calls to 'System.runFinalizersOnExit()'. This call is one of the most dangerous in the Java language. It is inherently non-thread-safe, may result in data corruption, deadlock, and may affect parts of the program far removed from its call point. It is deprecated, and its use is strongly discouraged. Inspection ID: GroovySystemRunFinalizersOnExit", + "markdown": "Reports calls to `System.runFinalizersOnExit()`.\n\n\nThis call is one of the most dangerous in the Java language. It is inherently non-thread-safe,\nmay result in data corruption, deadlock, and may affect parts of the program far removed from its call point.\nIt is deprecated, and its use is strongly discouraged.\n\nInspection ID: GroovySystemRunFinalizersOnExit" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovySystemRunFinalizersOnExit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyInstanceVariableNamingConvention", + "shortDescription": { + "text": "Instance variable naming convention" + }, + "fullDescription": { + "text": "Reports instance variables whose names are too short, too long, or do not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length and regular expression expected for instance variable names. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: GroovyInstanceVariableNamingConvention", + "markdown": "Reports instance variables whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length and regular expression expected for\ninstance variable names.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: GroovyInstanceVariableNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyInstanceVariableNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Naming conventions", + "index": 37, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyConstantIfStatement", + "shortDescription": { + "text": "Constant if statement" + }, + "fullDescription": { + "text": "Reports 'if' statements with boolean constant as a condition. Example: 'if (true) {\n // ...\n }\n if (false) {\n // ...\n }' Inspection ID: GroovyConstantIfStatement", + "markdown": "Reports `if` statements with boolean constant as a condition.\n\n**Example:**\n\n\n if (true) {\n // ...\n }\n if (false) {\n // ...\n }\n\nInspection ID: GroovyConstantIfStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyConstantIfStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyParameterNamingConvention", + "shortDescription": { + "text": "Method parameter naming convention" + }, + "fullDescription": { + "text": "Reports method parameters whose names are either too short, too long, or do not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length and regular expression expected for method parameter names. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: GroovyParameterNamingConvention", + "markdown": "Reports method parameters whose names are either too short, too long, or do not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length and regular expression\nexpected for method parameter names.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: GroovyParameterNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyParameterNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Naming conventions", + "index": 37, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrUnnecessaryPublicModifier", + "shortDescription": { + "text": "Unnecessary 'public'" + }, + "fullDescription": { + "text": "Reports unnecessary 'public' modifiers as Groovy classes and methods are 'public' by default. Example: 'public class Foo{\n public void bar(){\n }\n }' After the quick-fix is applied: 'class Foo{\n void bar(){\n }\n }' Inspection ID: GrUnnecessaryPublicModifier", + "markdown": "Reports unnecessary `public` modifiers as Groovy classes and methods are `public` by default.\n\n**Example:**\n\n\n public class Foo{\n public void bar(){\n }\n }\n\nAfter the quick-fix is applied:\n\n\n class Foo{\n void bar(){\n }\n }\n\nInspection ID: GrUnnecessaryPublicModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrUnnecessaryPublicModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrStringStyleViolation", + "shortDescription": { + "text": "String style violation" + }, + "fullDescription": { + "text": "Reports strings with quotation that doesn't match code style. Example: 'def hw = \"Hello, world!\"' After the quick-fix is applied: 'def hw = 'Hello, world!'' Use the fields provided below to specify code style for different kinds of strings. Inspection ID: GrStringStyleViolation", + "markdown": "Reports strings with quotation that doesn't match code style.\n\n**Example:**\n\n\n def hw = \"Hello, world!\"\n\nAfter the quick-fix is applied:\n\n\n def hw = 'Hello, world!'\n\nUse the fields provided below to specify code style for different kinds of strings.\n\nInspection ID: GrStringStyleViolation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GrStringStyleViolation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyPointlessBoolean", + "shortDescription": { + "text": "Pointless boolean expression" + }, + "fullDescription": { + "text": "Reports pointless or pointlessly complicated boolean expressions. Such expressions include conjunction with true, disjunction with false, equality comparison with a boolean literal, or negation of a boolean literal. Such expressions may be the result of automated refactorings not completely followed through to completion, and in any case are unlikely to be what the developer intended to do. Example: 'if (someBool && true) {}' After the quick-fix is applied: 'if (someBool) {}' Inspection ID: GroovyPointlessBoolean", + "markdown": "Reports pointless or pointlessly complicated boolean expressions.\n\n\nSuch expressions include conjunction with true,\ndisjunction with false,\nequality comparison with a boolean literal, or negation of a boolean literal. Such expressions may be\nthe result of automated refactorings\nnot completely followed through to completion, and in any case are unlikely to be what the developer\nintended to do.\n\n**Example:**\n\n\n if (someBool && true) {}\n\nAfter the quick-fix is applied:\n\n\n if (someBool) {}\n\nInspection ID: GroovyPointlessBoolean" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyPointlessBoolean", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SingletonConstructor", + "shortDescription": { + "text": "@Singleton constructors" + }, + "fullDescription": { + "text": "Reports constructors of classes annotated by '@Singleton' unless it is declared non-strict. Example: '@Singleton\n class Foo{\n Foo(){\n }\n }' There are two possible quick-fixes: either to remove the constructor or to declare '@Singleton' non-strict. After the quick-fix is applied: '@Singleton\n class Foo{\n }' or: '@Singleton(strict = false)\n class Foo{\n Foo(){\n }\n }' Inspection ID: SingletonConstructor", + "markdown": "Reports constructors of classes annotated by `@Singleton` unless it is declared non-strict.\n\n**Example:**\n\n\n @Singleton\n class Foo{\n Foo(){\n }\n }\n\nThere are two possible quick-fixes: either to remove the constructor or to declare `@Singleton` non-strict.\n\nAfter the quick-fix is applied:\n\n\n @Singleton\n class Foo{\n }\n\nor:\n\n\n @Singleton(strict = false)\n class Foo{\n Foo(){\n }\n }\n\nInspection ID: SingletonConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "SingletonConstructor", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Annotations", + "index": 95, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyStaticVariableNamingConvention", + "shortDescription": { + "text": "Static variable naming convention" + }, + "fullDescription": { + "text": "Reports 'static' variables whose names are too short, too long, or do not follow the specified regular expression pattern. Constants, i.e. variables of immutable type declared 'static final', are not checked by this inspection Use the fields provided below to specify minimum length, maximum length and regular expression expected for static variable names. Regular expressions should be specified in the standard 'java.util.regex' format. Inspection ID: GroovyStaticVariableNamingConvention", + "markdown": "Reports `static` variables whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n\nConstants, i.e. variables of immutable type declared\n`static final`, are not checked by this inspection\n\n\nUse the fields provided below to specify minimum length, maximum length and regular expression expected for static variable names.\n\nRegular expressions should be specified in the standard `java.util.regex` format.\n\nInspection ID: GroovyStaticVariableNamingConvention" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyStaticVariableNamingConvention", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Naming conventions", + "index": 37, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyInfiniteLoopStatement", + "shortDescription": { + "text": "Infinite loop statement" + }, + "fullDescription": { + "text": "Reports 'for', 'while', or 'do' statements which can only exit by throwing an exception. While such statements may be correct, they usually happen by mistake. Example: 'while(true) {\n Thread.sleep(1000)\n}'\n Inspection ID: GroovyInfiniteLoopStatement", + "markdown": "Reports `for`, `while`, or `do` statements which can only exit by throwing an exception. While such statements may be correct, they usually happen by mistake.\n\n**Example:**\n\n\n while(true) {\n Thread.sleep(1000)\n }\n\nInspection ID: GroovyInfiniteLoopStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyInfiniteLoopStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyEmptyTryBlock", + "shortDescription": { + "text": "Empty 'try' block" + }, + "fullDescription": { + "text": "Reports empty 'try' blocks. Empty 'try' blocks usually indicate coding errors. Example: 'try {\n}\nfinally {\n close()\n}'\n Inspection ID: GroovyEmptyTryBlock", + "markdown": "Reports empty `try` blocks. Empty `try` blocks usually indicate coding errors.\n\n**Example:**\n\n\n try {\n }\n finally {\n close()\n }\n\nInspection ID: GroovyEmptyTryBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyEmptyTryBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Error handling", + "index": 43, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrPermitsClause", + "shortDescription": { + "text": "Non-extending permitted subclasses" + }, + "fullDescription": { + "text": "Reports permitted classes that do not extend the sealed base class. Groovy does not require that all permitted classes should be available in compile-time and compiled along with base class. Compiler will not warn the user on dealing with non-extending permitted subclass, but it contradicts the nature of sealed classes. Example: 'class A permits B {} // reports B\n class B {}' Inspection ID: GrPermitsClause", + "markdown": "Reports permitted classes that do not extend the sealed base class.\n\nGroovy does not require that all permitted classes should be available in compile-time and compiled along with base class. Compiler will not warn the user on dealing with non-extending permitted subclass, but it contradicts the nature of sealed classes.\n\n**Example:**\n\n\n class A permits B {} // reports B\n class B {}\n\nInspection ID: GrPermitsClause" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "GrPermitsClause", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUnusedIncOrDec", + "shortDescription": { + "text": "Unused incrementing or decrementing" + }, + "fullDescription": { + "text": "Reports unused incrementing and decrementing expressions. Inspection ID: GroovyUnusedIncOrDec", + "markdown": "Reports unused incrementing and decrementing expressions.\n\nInspection ID: GroovyUnusedIncOrDec" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUnusedIncOrDec", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Data flow", + "index": 112, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyEmptyCatchBlock", + "shortDescription": { + "text": "Empty 'catch' block" + }, + "fullDescription": { + "text": "Reports empty 'catch' blocks. While occasionally intended, empty 'catch' blocks can make debugging extremely difficult. Example: 'try {\n throw new Exception()\n}\ncatch (Exception e) {\n}'\n After the quick-fix is applied: 'try {\n throw new Exception()\n}\ncatch (Exception ignored) {\n}'\n Inspection ID: GroovyEmptyCatchBlock", + "markdown": "Reports empty `catch` blocks. While occasionally intended, empty `catch` blocks can make debugging extremely difficult.\n\n**Example:**\n\n\n try {\n throw new Exception()\n }\n catch (Exception e) {\n }\n\nAfter the quick-fix is applied:\n\n\n try {\n throw new Exception()\n }\n catch (Exception ignored) {\n }\n\nInspection ID: GroovyEmptyCatchBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyEmptyCatchBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Error handling", + "index": 43, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ClashingTraitMethods", + "shortDescription": { + "text": "Clashing trait methods" + }, + "fullDescription": { + "text": "Reports classes which implement two or more traits that contain methods with same signatures. The result of calling such methods might be unexpected. The quick-fix adds an explicit overriding method. Example: 'trait T1 {\n def foo() {}\n }\n\n trait T2 {\n def foo() {}\n }\n\n class X implements T1, T2 {}\n\n // T2.foo() will be called\n new X().foo()' After the quick-fix is applied: 'class X implements T1, T2 {\n @Override\n Object foo() {\n return T2.super.foo()\n }\n }' Inspection ID: ClashingTraitMethods", + "markdown": "Reports classes which implement two or more traits that contain methods with same signatures.\n\nThe result of calling such methods might be unexpected.\n\nThe quick-fix adds an explicit overriding method.\n\n**Example:**\n\n\n trait T1 {\n def foo() {}\n }\n\n trait T2 {\n def foo() {}\n }\n\n class X implements T1, T2 {}\n\n // T2.foo() will be called\n new X().foo()\n\nAfter the quick-fix is applied:\n\n\n class X implements T1, T2 {\n @Override\n Object foo() {\n return T2.super.foo()\n }\n }\n\nInspection ID: ClashingTraitMethods" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ClashingTraitMethods", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyOverlyComplexMethod", + "shortDescription": { + "text": "Overly complex method" + }, + "fullDescription": { + "text": "Reports methods that have too high a cyclomatic complexity. Cyclomatic complexity is basically a measurement of the number of branching points in a method. Methods with too high a cyclomatic complexity may be confusing and difficult to test. Use the Method complexity limit field to specify the maximum acceptable cyclomatic complexity a method might have. Inspection ID: GroovyOverlyComplexMethod", + "markdown": "Reports methods that have too high a cyclomatic complexity.\n\n\nCyclomatic\ncomplexity is basically a measurement of the number of branching points in a method. Methods with too high\na cyclomatic complexity may be confusing and difficult to test.\n\n\nUse the **Method complexity limit** field to specify the maximum acceptable cyclomatic complexity a method might have.\n\nInspection ID: GroovyOverlyComplexMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyOverlyComplexMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Method metrics", + "index": 113, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TypeCustomizer", + "shortDescription": { + "text": "Type customizer inspection" + }, + "fullDescription": { + "text": "Reports files which can be custom type checkers and are not added to compiler resources yet. Inspection ID: TypeCustomizer", + "markdown": "Reports files which can be custom type checkers and are not added to compiler resources yet.\n\nInspection ID: TypeCustomizer" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TypeCustomizer", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Other", + "index": 81, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyOverlyNestedMethod", + "shortDescription": { + "text": "Overly nested method" + }, + "fullDescription": { + "text": "Reports methods whose bodies are too deeply nested. Methods with too much statement nesting may be confusing, and are a good sign that refactoring may be necessary. Use the Maximum nesting depth field to specify the maximum acceptable nesting depth a method might have. Inspection ID: GroovyOverlyNestedMethod", + "markdown": "Reports methods whose bodies are too deeply nested.\n\n\nMethods with too much statement\nnesting may be confusing, and are a good sign that refactoring may be necessary.\n\n\nUse the **Maximum nesting depth** field to specify the maximum acceptable nesting depth a method might have.\n\nInspection ID: GroovyOverlyNestedMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyOverlyNestedMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Method metrics", + "index": 113, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyVariableNotAssigned", + "shortDescription": { + "text": "Variable not assigned" + }, + "fullDescription": { + "text": "Reports variables that might not have been initialized. Inspection ID: GroovyVariableNotAssigned", + "markdown": "Reports variables that might not have been initialized.\n\nInspection ID: GroovyVariableNotAssigned" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyVariableNotAssigned", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Data flow", + "index": 112, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyMethodWithMoreThanThreeNegations", + "shortDescription": { + "text": "Method with more than three negations" + }, + "fullDescription": { + "text": "Reports methods with three or more negation operations ('!' or '!='). Such methods may be unnecessarily confusing. Inspection ID: GroovyMethodWithMoreThanThreeNegations", + "markdown": "Reports methods with three or more negation operations (`!` or `!=`). Such methods may be unnecessarily confusing.\n\nInspection ID: GroovyMethodWithMoreThanThreeNegations" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyMethodWithMoreThanThreeNegations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Method metrics", + "index": 113, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyDoubleNegation", + "shortDescription": { + "text": "Double negation" + }, + "fullDescription": { + "text": "Reports double negation that can be simplified. Example: 'if (!!functionCall()) {} // double negation\nif (!(a != b)) {} // double negation'\n After the quick-fix is applied: 'if (functionCall()) {}\nif (a == b) {}'\n Inspection ID: GroovyDoubleNegation", + "markdown": "Reports double negation that can be simplified.\n\n**Example:**\n\n\n if (!!functionCall()) {} // double negation\n if (!(a != b)) {} // double negation\n\nAfter the quick-fix is applied:\n\n\n if (functionCall()) {}\n if (a == b) {}\n\nInspection ID: GroovyDoubleNegation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyDoubleNegation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrNamedVariantLabels", + "shortDescription": { + "text": "@NamedVariant/@NamedParam/@NamedDelegate unresolved label" + }, + "fullDescription": { + "text": "Reports unresolved argument labels in calls of methods annotated by '@NamedVariant'/'@NamedParam'/'@NamedDelegate'. Example: '@groovy.transform.NamedVariant\n def foo(a, b) {}\n\n // unresolved label 'c'\n foo(a: 1, b: 2, c: 3)' Inspection ID: GrNamedVariantLabels", + "markdown": "Reports unresolved argument labels in calls of methods annotated by `@NamedVariant`/`@NamedParam`/`@NamedDelegate`.\n\n**Example:**\n\n\n @groovy.transform.NamedVariant\n def foo(a, b) {}\n\n // unresolved label 'c'\n foo(a: 1, b: 2, c: 3)\n\nInspection ID: GrNamedVariantLabels" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrNamedVariantLabels", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Annotations", + "index": 95, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyIfStatementWithTooManyBranches", + "shortDescription": { + "text": "If statement with too many branches" + }, + "fullDescription": { + "text": "Reports 'if' statements with too many branches. Such statements may be confusing, and are often the sign of inadequate levels of design abstraction. Example: 'if (a) {\n print \"foo\"\n} else if (b) {\n print \"bar\"\n} else if (c) {\n print \"baz\"\n} else if (d) {\n print \"Too many branches\"\n}'\n Use the Maximum number of branches field to specify the maximum number of branches expected. Inspection ID: GroovyIfStatementWithTooManyBranches", + "markdown": "Reports `if` statements with too many branches. Such statements may be confusing, and are often the sign of inadequate levels of design abstraction.\n\n**Example:**\n\n\n if (a) {\n print \"foo\"\n } else if (b) {\n print \"bar\"\n } else if (c) {\n print \"baz\"\n } else if (d) {\n print \"Too many branches\"\n }\n\n\nUse the **Maximum number of branches** field to specify the maximum number of branches expected.\n\nInspection ID: GroovyIfStatementWithTooManyBranches" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyIfStatementWithTooManyBranches", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyNegatedConditional", + "shortDescription": { + "text": "Negated conditional expression" + }, + "fullDescription": { + "text": "Reports conditional expressions whose conditions are negated. Flipping the order of the conditional expression branches will usually increase the clarity of such statements. Example: '~condition ? \"1\" : \"2\"'\n Inspection ID: GroovyNegatedConditional", + "markdown": "Reports conditional expressions whose conditions are negated. Flipping the order of the conditional expression branches will usually increase the clarity of such statements.\n\n**Example:**\n\n\n ~condition ? \"1\" : \"2\"\n\nInspection ID: GroovyNegatedConditional" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyNegatedConditional", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyWhileLoopSpinsOnField", + "shortDescription": { + "text": "While loop spins on field" + }, + "fullDescription": { + "text": "Reports 'while' loops, which spin on the value of a non-'volatile' field, waiting for it to be changed by another thread. In addition to being potentially extremely CPU intensive when little work is done inside the loop, such loops likely have different semantics than intended. The Java Memory Model allows that loop to never complete even if another thread changes the field's value. Example: 'class SpinsOnField {\n boolean ready = false;\n\n void run() {\n // the loop may never complete even after\n // markAsReady call from the other thread\n while (!ready) {\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }' Additionally since Java 9, calling 'Thread.onSpinWait()' inside spin loop on a 'volatile' field is recommended, which may significantly improve performance on some hardware. Use the checkbox below to have this inspection report only empty 'while' loops. Inspection ID: GroovyWhileLoopSpinsOnField", + "markdown": "Reports `while` loops, which spin on the\nvalue of a non-`volatile` field, waiting for it to be changed by another thread.\n\n\nIn addition to being potentially extremely CPU intensive when little work is done inside the loop, such\nloops likely have different semantics than intended. The Java Memory Model allows that loop to never complete even\nif another thread changes the field's value.\n\n**Example:**\n\n\n class SpinsOnField {\n boolean ready = false;\n\n void run() {\n // the loop may never complete even after\n // markAsReady call from the other thread\n while (!ready) {\n }\n // do some work\n }\n\n void markAsReady() {\n ready = true;\n }\n }\n\n\nAdditionally since Java 9, calling `Thread.onSpinWait()` inside spin loop\non a `volatile` field is recommended, which may significantly improve performance on some hardware.\n\n\nUse the checkbox below to have this inspection report only empty `while` loops.\n\n\nInspection ID: GroovyWhileLoopSpinsOnField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyWhileLoopSpinsOnField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrEqualsBetweenInconvertibleTypes", + "shortDescription": { + "text": "'equals()' between objects of inconvertible types" + }, + "fullDescription": { + "text": "Reports calls to 'equals()' where the target and argument are of incompatible types. While such a call might theoretically be useful, most likely it represents a bug. Example: 'new HashSet() == new TreeSet())' Inspection ID: GrEqualsBetweenInconvertibleTypes", + "markdown": "Reports calls to `equals()` where the target and argument are of incompatible types.\n\nWhile such a call might theoretically be useful, most likely it represents a bug.\n\n**Example:**\n\n\n new HashSet() == new TreeSet())\n\nInspection ID: GrEqualsBetweenInconvertibleTypes" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrEqualsBetweenInconvertibleTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyEmptySyncBlock", + "shortDescription": { + "text": "Empty 'synchronized' block" + }, + "fullDescription": { + "text": "Reports 'synchronized' statements with empty bodies. While theoretically this may be the semantics intended, this construction is confusing, and often the result of a typo. Example: 'synchronized(lock) {\n}'\n Inspection ID: GroovyEmptySyncBlock", + "markdown": "Reports `synchronized` statements with empty bodies. While theoretically this may be the semantics intended, this construction is confusing, and often the result of a typo.\n\n**Example:**\n\n\n synchronized(lock) {\n }\n\nInspection ID: GroovyEmptySyncBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyEmptySyncBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovySillyAssignment", + "shortDescription": { + "text": "Silly assignment" + }, + "fullDescription": { + "text": "Reports assignments of a variable to itself. Inspection ID: GroovySillyAssignment", + "markdown": "Reports assignments of a variable to itself.\n\nInspection ID: GroovySillyAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovySillyAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Assignment issues", + "index": 65, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyConditionalCanBeConditionalCall", + "shortDescription": { + "text": "Ternary expression can be replaced with safe call" + }, + "fullDescription": { + "text": "Reports ternary expressions which can be replaced by a safe call. Example: 'def charArray(String s) {\n s == null ? null : s.toCharArray()\n }' After the quick-fix is applied: 'def charArray(String s) {\n s?.toCharArray()\n }' Inspection ID: GroovyConditionalCanBeConditionalCall", + "markdown": "Reports ternary expressions which can be replaced by a safe call.\n\n**Example:**\n\n\n def charArray(String s) {\n s == null ? null : s.toCharArray()\n }\n\nAfter the quick-fix is applied:\n\n\n def charArray(String s) {\n s?.toCharArray()\n }\n\nInspection ID: GroovyConditionalCanBeConditionalCall" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "GroovyConditionalCanBeConditionalCall", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyInfiniteRecursion", + "shortDescription": { + "text": "Infinite recursion" + }, + "fullDescription": { + "text": "Reports methods which must either recurse infinitely or throw an exception. Methods reported by this inspection could not be finished correct. Example: '// this function always dive deeper\ndef fibonacci(int n) {\n return fibonacci(n-1) + fibonacci(n-2)\n}'\n Inspection ID: GroovyInfiniteRecursion", + "markdown": "Reports methods which must either recurse infinitely or throw an exception. Methods reported by this inspection could not be finished correct.\n\n**Example:**\n\n\n // this function always dive deeper\n def fibonacci(int n) {\n return fibonacci(n-1) + fibonacci(n-2)\n }\n\nInspection ID: GroovyInfiniteRecursion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyInfiniteRecursion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyNestedSwitch", + "shortDescription": { + "text": "Nested switch statement" + }, + "fullDescription": { + "text": "Reports 'switch' statements that are nested inside other 'switch' statements. Such nested switch statements are confusing, and may result in unexpected behaviour. Example: 'switch (outer) {\n case 1:\n switch (inner) {\n case 1:\n print \"inner 1\"\n break\n default:\n print \"inner default\"\n }\n break\n default:\n print \"default\"\n}'\n Inspection ID: GroovyNestedSwitch", + "markdown": "Reports `switch` statements that are nested inside other `switch` statements. Such nested switch statements are confusing, and may result in unexpected behaviour.\n\n**Example:**\n\n\n switch (outer) {\n case 1:\n switch (inner) {\n case 1:\n print \"inner 1\"\n break\n default:\n print \"inner default\"\n }\n break\n default:\n print \"default\"\n }\n\nInspection ID: GroovyNestedSwitch" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyNestedSwitch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyRangeTypeCheck", + "shortDescription": { + "text": "Incorrect range arguments" + }, + "fullDescription": { + "text": "Reports types used in ranges that do not have a 'next()' or 'previous()' method or do not implement the 'java.lang.Comparable' interface. Inspection ID: GroovyRangeTypeCheck", + "markdown": "Reports types used in ranges that do not have a `next()` or `previous()` method or do not implement the `java.lang.Comparable` interface.\n\nInspection ID: GroovyRangeTypeCheck" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyRangeTypeCheck", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Probable bugs", + "index": 54, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrUnnecessarySealedModifier", + "shortDescription": { + "text": "Unnecessary 'sealed' modifier" + }, + "fullDescription": { + "text": "Reports unnecessary 'sealed' modifiers which used on methods, fields, or variables. This modifier has effect only on classes, interfaces and traits. Example: 'sealed boolean foo() {} // modifier is unnecessary\n sealed Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n sealed class A {}' Inspection ID: GrUnnecessarySealedModifier", + "markdown": "Reports unnecessary `sealed` modifiers which used on methods, fields, or variables.\n\nThis modifier has effect only on classes, interfaces and traits.\n\n**Example:**\n\n\n sealed boolean foo() {} // modifier is unnecessary\n sealed Object bar // modifier is unnecessary\n\n // modifier is required and therefore not highlighted\n sealed class A {}\n\nInspection ID: GrUnnecessarySealedModifier" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrUnnecessarySealedModifier", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Style", + "index": 83, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GrDeprecatedAPIUsage", + "shortDescription": { + "text": "Deprecated API usage" + }, + "fullDescription": { + "text": "Reports references to deprecated classes, fields, and methods. Inspection ID: GrDeprecatedAPIUsage", + "markdown": "Reports references to deprecated classes, fields, and methods.\n\nInspection ID: GrDeprecatedAPIUsage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GrDeprecatedAPIUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyMissingReturnStatement", + "shortDescription": { + "text": "Missing return statement" + }, + "fullDescription": { + "text": "Reports missing 'return' statements at the end of methods with a non-void return type. The end of method should be reachable by the method's execution flow. Example: 'String foo(int a) {\n if (a > 0) {\n return \"more than zero\"\n }\n} // foo(-1) will return 'null'\n\nint bar(int a) {\n if (a > 0) {\n return a\n }\n} // bar(-1) will fall with runtime exception'\n Inspection ID: GroovyMissingReturnStatement", + "markdown": "Reports missing `return` statements at the end of methods with a non-**void** return type. The end of method should be reachable by the method's execution flow.\n\n**Example:**\n\n\n String foo(int a) {\n if (a > 0) {\n return \"more than zero\"\n }\n } // foo(-1) will return 'null'\n\n int bar(int a) {\n if (a > 0) {\n return a\n }\n } // bar(-1) will fall with runtime exception\n\nInspection ID: GroovyMissingReturnStatement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyMissingReturnStatement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Data flow", + "index": 112, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyPublicFieldAccessedInSynchronizedContext", + "shortDescription": { + "text": "Non-private field accessed in synchronized context" + }, + "fullDescription": { + "text": "Reports non-'final', non-'private' fields which are accessed in a synchronized context. A non-private field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\" access may result in unexpectedly inconsistent data structures. Accesses in constructors an initializers are ignored for purposes of this inspection. Inspection ID: GroovyPublicFieldAccessedInSynchronizedContext", + "markdown": "Reports non-`final`, non-`private` fields which are accessed in a synchronized context.\n\n\nA non-private field cannot be guaranteed to always be accessed in a synchronized manner, and such \"partially synchronized\"\naccess may result in unexpectedly inconsistent data structures. Accesses in constructors an initializers are ignored\nfor purposes of this inspection.\n\nInspection ID: GroovyPublicFieldAccessedInSynchronizedContext" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyPublicFieldAccessedInSynchronizedContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUnnecessaryContinue", + "shortDescription": { + "text": "Unnecessary 'continue' statement" + }, + "fullDescription": { + "text": "Reports 'continue' statements if they are last reachable statements in the loop. These 'continue' statements are unnecessary and can be safely removed. Example: 'for(int i in array) {\n println(i)\n continue\n }' After the quick-fix is applied: 'for(int i in array) {\n println(i)\n }' For more information, see the same inspection in Java. Inspection ID: GroovyUnnecessaryContinue", + "markdown": "Reports `continue` statements if they are last reachable statements in the loop.\nThese `continue` statements are unnecessary and can be safely removed.\n\n**Example:**\n\n\n for(int i in array) {\n println(i)\n continue\n }\n\nAfter the quick-fix is applied:\n\n\n for(int i in array) {\n println(i)\n }\n\nFor more information, see the same inspection in Java.\n\nInspection ID: GroovyUnnecessaryContinue" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUnnecessaryContinue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUnusedAssignment", + "shortDescription": { + "text": "Unused assignment" + }, + "fullDescription": { + "text": "Reports the cases where a variable is redundant as its value is never used after its assignment. If the variable is unused, we recommend removing it to shorten the code and to avoid redundant allocations. The following cases are reported: the variable never gets read after assignment the value is always overwritten with another assignment before the next variable read the variable initializer is redundant (for one of the above two reasons) For more info see the same inspection in Java. Inspection ID: GroovyUnusedAssignment", + "markdown": "Reports the cases where a variable is redundant as its value is never used after its assignment.\n\nIf the variable is unused, we recommend removing it to shorten the code and to avoid redundant allocations.\n\nThe following cases are reported:\n\n* the variable never gets read after assignment\n* the value is always overwritten with another assignment before the next variable read\n* the variable initializer is redundant (for one of the above two reasons)\n\nFor more info see the same inspection in Java.\n\nInspection ID: GroovyUnusedAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUnusedAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Data flow", + "index": 112, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyNotifyWhileNotSynchronized", + "shortDescription": { + "text": "'notify()' or 'notifyAll()' while not synced" + }, + "fullDescription": { + "text": "Reports calls to 'notify()' and 'notifyAll()' not within a corresponding synchronized statement or synchronized method. Calling these methods on an object without holding a lock on that object will result in an 'IllegalMonitorStateException' being thrown. Such a construct is not necessarily an error, as the necessary lock may be acquired before the containing method is called, but it's worth looking at. Inspection ID: GroovyNotifyWhileNotSynchronized", + "markdown": "Reports calls to `notify()` and `notifyAll()` not within a corresponding synchronized statement or synchronized method.\n\n\nCalling these methods on an object\nwithout holding a lock on that object will result in an `IllegalMonitorStateException` being thrown.\nSuch a construct is not necessarily an error, as the necessary lock may be acquired before\nthe containing method is called, but it's worth looking at.\n\nInspection ID: GroovyNotifyWhileNotSynchronized" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyNotifyWhileNotSynchronized", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyBusyWait", + "shortDescription": { + "text": "Busy wait" + }, + "fullDescription": { + "text": "Reports calls to 'java.lang.Thread.sleep()' that occur inside loops. Such calls are indicative of \"busy-waiting\". Busy-waiting is often inefficient, and may result in unexpected deadlocks as busy-waiting threads do not release locked resources. Inspection ID: GroovyBusyWait", + "markdown": "Reports calls to `java.lang.Thread.sleep()` that occur inside loops.\n\n\nSuch calls are indicative of \"busy-waiting\". Busy-waiting is often inefficient, and may result in unexpected deadlocks\nas busy-waiting threads do not release locked resources.\n\nInspection ID: GroovyBusyWait" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyBusyWait", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyOctalInteger", + "shortDescription": { + "text": "Octal integer" + }, + "fullDescription": { + "text": "Reports octal integer literals. Some coding standards prohibit the use of octal literals, as they may be easily confused with decimal literals. Inspection ID: GroovyOctalInteger", + "markdown": "Reports octal integer literals.\n\n\nSome coding standards prohibit the\nuse of octal literals, as they may be easily confused with decimal literals.\n\nInspection ID: GroovyOctalInteger" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyOctalInteger", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyEmptyFinallyBlock", + "shortDescription": { + "text": "Empty 'finally' block" + }, + "fullDescription": { + "text": "Reports empty 'finally' blocks. Empty 'finally' blocks usually indicate coding errors. Example: 'try {\n throw new Exception()\n}\nfinally {\n}'\n Inspection ID: GroovyEmptyFinallyBlock", + "markdown": "Reports empty `finally` blocks. Empty `finally` blocks usually indicate coding errors.\n\n**Example:**\n\n\n try {\n throw new Exception()\n }\n finally {\n }\n\nInspection ID: GroovyEmptyFinallyBlock" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyEmptyFinallyBlock", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Error handling", + "index": 43, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovySynchronizationOnVariableInitializedWithLiteral", + "shortDescription": { + "text": "Synchronization on variable initialized with literal" + }, + "fullDescription": { + "text": "Reports synchronized blocks which lock on an object which is initialized with a literal. String literals are interned and 'Number' literals can be allocated from a cache. Because of this, it is possible that some other part of the system which uses an object initialized with the same literal, is actually holding a reference to the exact same object. This can create unexpected dead-lock situations, if the string was thought to be private. Inspection ID: GroovySynchronizationOnVariableInitializedWithLiteral", + "markdown": "Reports synchronized blocks which lock on an object which is initialized with a literal.\n\n\nString literals are interned and `Number` literals can be allocated from a cache. Because of\nthis, it is possible that some other part of the system which uses an object initialized with the same\nliteral, is actually holding a reference to the exact same object. This can create unexpected dead-lock\nsituations, if the string was thought to be private.\n\nInspection ID: GroovySynchronizationOnVariableInitializedWithLiteral" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovySynchronizationOnVariableInitializedWithLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyUnusedDeclaration", + "shortDescription": { + "text": "Unused declaration" + }, + "fullDescription": { + "text": "Reports unused classes, methods and fields. Example: 'public class Department {\n private Organization myOrganization;\n }' Here 'Department' explicitly references 'Organization' but if 'Department' class itself is unused, then inspection would report both classes. The inspection also reports parameters, which are not used by their methods and all method implementations/overriders, as well as local variables, which are declared but not used. For more information, see the same inspection in Java. Inspection ID: GroovyUnusedDeclaration", + "markdown": "Reports unused classes, methods and fields.\n\n**Example:**\n\n\n public class Department {\n private Organization myOrganization;\n }\n\nHere `Department` explicitly references `Organization` but if `Department` class itself is unused,\nthen inspection would report both classes.\n\n\nThe inspection also reports parameters, which are not used by their methods and all method implementations/overriders, as well as local\nvariables, which are declared but not used.\n\nFor more information, see the same inspection in Java.\n\nInspection ID: GroovyUnusedDeclaration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyUnusedDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Declaration redundancy", + "index": 129, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyLoopStatementThatDoesntLoop", + "shortDescription": { + "text": "Loop statement that doesn't loop" + }, + "fullDescription": { + "text": "Reports 'for' or 'while' statements whose bodies are guaranteed to execute at most once. While such statements could be written intentionally, they are usually a symptom of error. Example: 'for (int i in 0..<10) {\n return\n }'\n Inspection ID: GroovyLoopStatementThatDoesntLoop", + "markdown": "Reports `for` or `while` statements whose bodies are guaranteed to execute at most once. While such statements could be written intentionally, they are usually a symptom of error.\n\n**Example:**\n\n\n for (int i in 0..<10) {\n return\n }\n\nInspection ID: GroovyLoopStatementThatDoesntLoop" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyLoopStatementThatDoesntLoop", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyResultOfIncrementOrDecrementUsed", + "shortDescription": { + "text": "Result of increment or decrement used" + }, + "fullDescription": { + "text": "Reports increment or decrement expressions nested inside other expressions. Such expressions may be confusing, and violate the general design principle that a given construct should do precisely one thing. Inspection ID: GroovyResultOfIncrementOrDecrementUsed", + "markdown": "Reports increment or decrement expressions nested inside other expressions.\n\n\nSuch expressions may be confusing, and violate the general design principle that a\ngiven construct should do precisely one thing.\n\nInspection ID: GroovyResultOfIncrementOrDecrementUsed" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyResultOfIncrementOrDecrementUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Potentially confusing code constructs", + "index": 72, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovySynchronizationOnNonFinalField", + "shortDescription": { + "text": "Synchronization on non-final field" + }, + "fullDescription": { + "text": "Reports 'synchronized' statements where the lock expression is a non-'final' field. Such statements are unlikely to have useful semantics, as different threads may be locking on different objects even when operating on the same object. Inspection ID: GroovySynchronizationOnNonFinalField", + "markdown": "Reports `synchronized` statements where the lock expression is a non-`final` field.\n\n\nSuch statements are unlikely to have useful semantics, as different\nthreads may be locking on different objects even when operating on the same object.\n\nInspection ID: GroovySynchronizationOnNonFinalField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovySynchronizationOnNonFinalField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Threading issues", + "index": 40, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "GroovyReturnFromClosureCanBeImplicit", + "shortDescription": { + "text": "'return' statement can be implicit" + }, + "fullDescription": { + "text": "Reports return statements at the end of closures which can be made implicit. Groovy closures implicitly return the value of the last statement in them. Example: 'def foo = {\n return 1\n }' After the quick-fix is applied: 'def foo = {\n 1\n }' Inspection ID: GroovyReturnFromClosureCanBeImplicit", + "markdown": "Reports return statements at the end of closures which can be made implicit.\n\n\nGroovy closures implicitly return the value of the last statement in them.\n\n**Example:**\n\n\n def foo = {\n return 1\n }\n\nAfter the quick-fix is applied:\n\n\n def foo = {\n 1\n }\n\nInspection ID: GroovyReturnFromClosureCanBeImplicit" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "GroovyReturnFromClosureCanBeImplicit", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Groovy/Control flow issues", + "index": 70, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "DevKit", + "version": "252.28459.0", + "rules": [ + { + "id": "PluginXmlPluginLogo", + "shortDescription": { + "text": "Plugin Logo check" + }, + "fullDescription": { + "text": "Reports missing plugin logo. A plugin logo is intended to be a unique representation of a plugin's functionality, technology, or company. See Plugin Logo in IntelliJ Platform SDK documentation. Inspection ID: PluginXmlPluginLogo", + "markdown": "Reports missing plugin logo.\n\n\nA plugin logo is intended to be a unique representation of a plugin's functionality, technology, or company.\n\nSee [Plugin Logo](https://plugins.jetbrains.com/docs/intellij/plugin-icon-file.html?from=PluginXmlPluginLogoInspection)\nin IntelliJ Platform SDK documentation.\n\nInspection ID: PluginXmlPluginLogo" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "PluginXmlPluginLogo", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PathAnnotationInspection", + "shortDescription": { + "text": "Path annotation usage problems" + }, + "fullDescription": { + "text": "Reports incorrect usage of path annotations. This inspection detects cases where a string annotated with one path annotation is used in a context that expects a string with a different path annotation. It helps ensure proper usage of '@MultiRoutingFileSystemPath' and '@NativePath' annotations. The inspection highlights the following issues: When a string annotated with '@NativePath' is used in a Path constructor or factory method When a string annotated with '@NativePath' is passed to a method parameter annotated with '@MultiRoutingFileSystemPath' When a string annotated with '@MultiRoutingFileSystemPath' is passed to a method parameter annotated with '@NativePath' When a string literal is used in a context that expects either annotation Quick fixes are provided to add the appropriate annotation where needed. This inspection helps prevent runtime errors that can occur when paths with different formats are used incorrectly. The '@MultiRoutingFileSystemPath' annotation is used for paths that should work across different file systems, while the '@NativePath' annotation is used for paths that are specific to the native file system. Inspection ID: PathAnnotationInspection", + "markdown": "Reports incorrect usage of path annotations.\n\n\nThis inspection detects cases where a string annotated with one path annotation is used in a context that expects a string with a different path annotation.\nIt helps ensure proper usage of `@MultiRoutingFileSystemPath` and `@NativePath` annotations.\n\nThe inspection highlights the following issues:\n\n* When a string annotated with `@NativePath` is used in a Path constructor or factory method\n* When a string annotated with `@NativePath` is passed to a method parameter annotated with `@MultiRoutingFileSystemPath`\n* When a string annotated with `@MultiRoutingFileSystemPath` is passed to a method parameter annotated with `@NativePath`\n* When a string literal is used in a context that expects either annotation\n\n\nQuick fixes are provided to add the appropriate annotation where needed.\n\n\nThis inspection helps prevent runtime errors that can occur when paths with different formats are used incorrectly.\nThe `@MultiRoutingFileSystemPath` annotation is used for paths that should work across different file systems,\nwhile the `@NativePath` annotation is used for paths that are specific to the native file system.\n\nInspection ID: PathAnnotationInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PathAnnotationInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExtensionClassShouldBeFinalAndNonPublic", + "shortDescription": { + "text": "Extension class should be final and non-public" + }, + "fullDescription": { + "text": "Reports extension classes that are non-final or public. New in 2023.2 Inspection ID: ExtensionClassShouldBeFinalAndNonPublic", + "markdown": "Reports extension classes that are non-final or public.\n\nNew in 2023.2\n\nInspection ID: ExtensionClassShouldBeFinalAndNonPublic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExtensionClassShouldBeFinalAndNonPublic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WorkspaceEntityMutableField", + "shortDescription": { + "text": "Unsupported 'var' field in entity" + }, + "fullDescription": { + "text": "Detects unsupported 'var' fields in the inheritors of 'WorkspaceEntity' interface Interface implementing 'WorkspaceEntity' have to have only 'val' fields because it's immutable. Implementation of 'WorkspaceEntity.Builder' will be generated for the mutation Inspection ID: WorkspaceEntityMutableField", + "markdown": "Detects unsupported `var` fields in the inheritors of `WorkspaceEntity` interface\n\n\nInterface implementing `WorkspaceEntity` have to have only `val` fields because it's immutable.\nImplementation of `WorkspaceEntity.Builder` will be generated for the mutation\n\nInspection ID: WorkspaceEntityMutableField" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WorkspaceEntityMutableField", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Workspace model", + "index": 55, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MigrateToOptControl", + "shortDescription": { + "text": "Migrate to getOptionPane()" + }, + "fullDescription": { + "text": "Reports 'createOptionsPanel()' methods in inspection implementation, which can be automatically converted to 'getOptionsPane()'. Creating inspection options control via 'createOptionsPanel()' is deprecated, in favor of declarative control description 'getOptionsPane()'. The inspection checks 'createOptionsPanel()' implementations and if they use InspectionOptionsPanel or its descendants and are simple enough, then it suggests to convert to the new API automatically. This inspection currently supports Java and Kotlin only. It cannot convert the code that uses Kotlin methods like 'apply' or 'also'. Try to inline them. Inspection ID: MigrateToOptControl New in 2023.1", + "markdown": "Reports `createOptionsPanel()` methods in inspection implementation, which can be automatically converted to `getOptionsPane()`.\n\n\nCreating inspection options control via `createOptionsPanel()` is deprecated,\nin favor of declarative control description `getOptionsPane()`.\nThe inspection checks `createOptionsPanel()` implementations and if they use\nInspectionOptionsPanel or its descendants and are simple enough, then it suggests to convert to\nthe new API automatically.\n\n\nThis inspection currently supports Java and Kotlin only.\nIt cannot convert the code that uses Kotlin methods like `apply` or `also`. Try to inline them.\n\nInspection ID: MigrateToOptControl\n\nNew in 2023.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MigrateToOptControl", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "checkReturnValue", + "shortDescription": { + "text": "Return value must be checked" + }, + "fullDescription": { + "text": "Reports about calls to methods annotated with '@CheckReturnValue', whose result is not checked. '@CheckReturnValue' can be used by methods that may fail but don't throw an exception. If the returned error is not checked, the caller may not be aware of the failure. It is a valid case when it is not necessary if some call succeeded or failed. Nevertheless, it's a rare case, and it's better to ignore the inspection in such cases explicitly. Inspection ID: checkReturnValue", + "markdown": "Reports about calls to methods annotated with `@CheckReturnValue`, whose result is not checked.\n\n\n`@CheckReturnValue` can be used by methods that may fail but don't throw an exception.\nIf the returned error is not checked, the caller may not be aware of the failure.\n\n\nIt is a valid case when it is not necessary if some call succeeded or failed.\nNevertheless, it's a rare case, and it's better to ignore the inspection in such cases explicitly.\n\nInspection ID: checkReturnValue" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "checkReturnValue", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Code", + "index": 71, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PluginXmlCapitalization", + "shortDescription": { + "text": "Plugin.xml text capitalization" + }, + "fullDescription": { + "text": "Reports text capitalization problems in 'plugin.xml'. The following elements are checked: '' ', ' ', ' extension point properties annotated with 'org.jetbrains.annotations.Nls' specifying required 'capitalization' Please see Capitalization in IntelliJ Platform UI Guidelines for more information. Inspection ID: PluginXmlCapitalization", + "markdown": "Reports text capitalization problems in `plugin.xml`.\n\n\nThe following elements are checked:\n\n* ``\n* `, `\n* `, `\n* extension point properties annotated with `org.jetbrains.annotations.Nls` specifying required `capitalization`\n\n\nPlease see [Capitalization](https://plugins.jetbrains.com/docs/intellij/capitalization.html) in IntelliJ Platform UI Guidelines for more\ninformation.\n\nInspection ID: PluginXmlCapitalization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PluginXmlCapitalization", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JComponentDataProvider", + "shortDescription": { + "text": "JComponent must use UiDataProvider" + }, + "fullDescription": { + "text": "Reports JComponent classes implementing incorrect data provider interface. 'javax.swing.JComponent' must use 'com.intellij.openapi.actionSystem.UiDataProvider' instead of obsolete 'com.intellij.openapi.actionSystem.DataProvider' API. New in 2024.3 Inspection ID: JComponentDataProvider", + "markdown": "Reports JComponent classes implementing incorrect data provider interface.\n\n\n`javax.swing.JComponent` must use `com.intellij.openapi.actionSystem.UiDataProvider` instead of\nobsolete `com.intellij.openapi.actionSystem.DataProvider` API.\n\nNew in 2024.3\n\nInspection ID: JComponentDataProvider" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JComponentDataProvider", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WorkspaceImplObsolete", + "shortDescription": { + "text": "Obsolete version of entity implementation" + }, + "fullDescription": { + "text": "Reports existence of the obsolete implementation for the entity. Verifies that existing implementation for entities has the same API version as described at 'com.intellij.platform.workspace.storage.CodeGeneratorVersions' from dependencies. Suggests regenerating implementation for the whole entities in the current module. Inspection ID: WorkspaceImplObsolete", + "markdown": "Reports existence of the obsolete implementation for the entity.\n\n\nVerifies that existing implementation for entities has the same API version as described at `com.intellij.platform.workspace.storage.CodeGeneratorVersions` from dependencies.\n\n\nSuggests regenerating implementation for the whole entities in the current module.\n\nInspection ID: WorkspaceImplObsolete" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WorkspaceImplObsolete", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Workspace model", + "index": 55, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseDPIAwareBorders", + "shortDescription": { + "text": "Use DPI-aware borders" + }, + "fullDescription": { + "text": "Reports usages of 'javax.swing.border.EmptyBorder' and 'JBUI.Borders.emptyXyz()' that can be simplified. The 'EmptyBorder' instances are not DPI-aware and can result in UI layout problems. Quick fix performs replacement with 'JBUI.Borders.empty()' or simplifies the expression. Example: '// bad:\nBorder border1 = new EmptyBorder(1, 2, 3, 4);\nBorder border2 = new EmptyBorder(1, 2, 1, 2);\nBorder border3 = new EmptyBorder(1, 0, 0, 0);\n\n// good:\nBorder border1 = JBUI.Borders.empty(1, 2, 3, 4);\nBorder border2 = JBUI.Borders.empty(1, 2);\nBorder border3 = JBUI.Borders.emptyTop(1);' Inspection ID: UseDPIAwareBorders", + "markdown": "Reports usages of `javax.swing.border.EmptyBorder` and `JBUI.Borders.emptyXyz()` that can be simplified.\n\n\nThe `EmptyBorder` instances are not DPI-aware and can result in UI layout problems.\n\n\nQuick fix performs replacement with `JBUI.Borders.empty()` or simplifies the expression.\n\nExample:\n\n\n // bad:\n Border border1 = new EmptyBorder(1, 2, 3, 4);\n Border border2 = new EmptyBorder(1, 2, 1, 2);\n Border border3 = new EmptyBorder(1, 0, 0, 0);\n\n // good:\n Border border1 = JBUI.Borders.empty(1, 2, 3, 4);\n Border border2 = JBUI.Borders.empty(1, 2);\n Border border3 = JBUI.Borders.emptyTop(1);\n\nInspection ID: UseDPIAwareBorders" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseDPIAwareBorders", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExtensionRegisteredAsServiceOrComponent", + "shortDescription": { + "text": "Extension registered as service/component" + }, + "fullDescription": { + "text": "Reports extension implementation being additionally registered as a service/component. While there can be multiple extension instances, the IntelliJ Platform ensures that only one instance of a service/component is loaded, thus registering the same class as both an extension and a service/component may cause issues. New in 2023.2 Inspection ID: ExtensionRegisteredAsServiceOrComponent", + "markdown": "Reports extension implementation being additionally registered as a service/component.\n\n\nWhile there can be multiple extension instances, the IntelliJ Platform ensures that only one instance of a service/component is loaded,\nthus registering the same class as both an extension and a service/component may cause issues.\n\nNew in 2023.2\n\nInspection ID: ExtensionRegisteredAsServiceOrComponent" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "ExtensionRegisteredAsServiceOrComponent", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ForbiddenInSuspectContextMethod", + "shortDescription": { + "text": "Forbidden in suspend context method usage" + }, + "fullDescription": { + "text": "Reports inappropriate usages of methods in Kotlin coroutines, which uses threading context (annotated with '@RequiresBlockingContext'). Many of these methods have corresponding coroutine-friendly analogues, that can be used in 'suspend' contexts. Examples: 'com.intellij.openapi.progress.ProgressManager.checkCanceled()' should be replaced with 'com.intellij.openapi.progress.checkCancelled()' 'com.intellij.openapi.application.Application.invokeAndWait()' should be replaced with 'withContext(Dispatchers.EDT)' etc. Inspection ID: ForbiddenInSuspectContextMethod", + "markdown": "Reports inappropriate usages of methods in Kotlin coroutines, which uses threading context (annotated with `@RequiresBlockingContext`). Many of these methods have corresponding coroutine-friendly analogues, that can be used in `suspend` contexts. Examples:\n\n* `com.intellij.openapi.progress.ProgressManager.checkCanceled()` should be replaced with `com.intellij.openapi.progress.checkCancelled()`\n* `com.intellij.openapi.application.Application.invokeAndWait()` should be replaced with `withContext(Dispatchers.EDT)`\n* etc.\n\nInspection ID: ForbiddenInSuspectContextMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ForbiddenInSuspectContextMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonDefaultConstructor", + "shortDescription": { + "text": "Non-default constructors for service and extension class" + }, + "fullDescription": { + "text": "Reports extension/service class having a non-default (empty) constructor. Other dependencies should be acquired when needed in corresponding methods only. Constructor having 'Project' for extension/service on the corresponding level is allowed. Inspection ID: NonDefaultConstructor", + "markdown": "Reports extension/service class having a non-default (empty) constructor.\n\n\nOther dependencies should be acquired when needed in corresponding methods only.\nConstructor having `Project` for extension/service on the corresponding level is allowed.\n\nInspection ID: NonDefaultConstructor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "NonDefaultConstructor", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CancellationCheckInLoops", + "shortDescription": { + "text": "Cancellation check in loops" + }, + "fullDescription": { + "text": "Reports loops, 'forEach'-like methods, and 'ContainerUtil.process()' with missing cancellation checks. Runs only within the methods with 'com.intellij.util.concurrency.annotations.RequiresReadLock' annotation. Example: '@RequiresReadLock\nfun doSomething() {\n ...\n for (item in items) {\n ProgressManager.checkCanceled() // should be present in the first line\n ...\n }\n\n items.forEach {\n ProgressManager.checkCanceled() // should be present in the first line\n ...\n }\n ...\n}' In the case of nested loops with nothing in between: '@RequiresReadLock\nfun doSomething() {\n ...\n for (item in items) {\n // nothing in between\n for (inner in item.inners) {\n ProgressManager.checkCanceled() // should be present in the first line of the inner loop only\n ...\n }\n }\n ...\n}' In blocking context 'com.intellij.openapi.progress.ProgressManager.checkCanceled()' should be used, while 'com.intellij.openapi.progress.CoroutinesKt.checkCancelled()' should be used in suspending one. See Background Processes Cancellation in IntelliJ Platform Plugin SDK docs for more details. New in 2023.1 Inspection ID: CancellationCheckInLoops", + "markdown": "Reports loops, `forEach`-like methods, and `ContainerUtil.process()` with missing cancellation checks.\n\nRuns only within the methods with `com.intellij.util.concurrency.annotations.RequiresReadLock` annotation.\n\n**Example:**\n\n\n @RequiresReadLock\n fun doSomething() {\n ...\n for (item in items) {\n ProgressManager.checkCanceled() // should be present in the first line\n ...\n }\n\n items.forEach {\n ProgressManager.checkCanceled() // should be present in the first line\n ...\n }\n ...\n }\n\nIn the case of nested loops with nothing in between:\n\n\n @RequiresReadLock\n fun doSomething() {\n ...\n for (item in items) {\n // nothing in between\n for (inner in item.inners) {\n ProgressManager.checkCanceled() // should be present in the first line of the inner loop only\n ...\n }\n }\n ...\n }\n\n\nIn blocking context `com.intellij.openapi.progress.ProgressManager.checkCanceled()` should be used,\nwhile `com.intellij.openapi.progress.CoroutinesKt.checkCancelled()` should be used in suspending one.\n\n\nSee [Background Processes Cancellation](https://plugins.jetbrains.com/docs/intellij/background-processes.html#cancellation) in IntelliJ Platform Plugin SDK docs for more details.\n\nNew in 2023.1\n\nInspection ID: CancellationCheckInLoops" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CancellationCheckInLoops", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ApplicationServiceAsStaticFinalFieldOrProperty", + "shortDescription": { + "text": "Application service assigned to a static final field or immutable property" + }, + "fullDescription": { + "text": "Reports assignments of application services to static final fields / immutable properties. Static final fields (Java) or static immutable properties with backing fields (Kotlin) Note: Hereinafter, static in Kotlin refers to members of non-anonymous objects or top-level declarations. Such services' assignments contribute to global state and make it impossible to tear down an application and set up another one in tests, therefore, repeated tests in the same process may fail. The only exception is an explicit constructor call to store dummy/default instances. The recommended way to avoid storing services is to retrieve a service locally. Alternatively, one can wrap it in 'java.util.function.Supplier' (Java, Kotlin) or convert the property to a function (Kotlin). Example (Java): '// Bad:\nprivate static final ManagingFS ourInstance = ApplicationManager.getApplication().getService(ManagingFS.class);' '// Good:\nprivate static final Supplier ourInstance = CachedSingletonsRegistry.lazy(() -> {\n return ApplicationManager.getApplication().getService(ManagingFS.class);\n});' '// Exception:\nprivate static final UniqueVFilePathBuilder DUMMY_BUILDER = new UniqueVFilePathBuilder()' Retrieving a service instance through static immutable properties (Kotlin) While services' assignments to properties without backing fields don't cause the aforementioned problem, using an explicit 'getInstance()' method to retrieve a service is preferred over using a property: It makes it clearer on the call site that it can involve loading the service, which might not be cheap. Loading the service can throw an exception, and having an exception thrown by a method call is less surprising than if it was caused by property access. (Over-)using properties may be error-prone in a way that it might be accidentally changed to a property with an initializer instead of the correct (but more verbose) property with a getter, and that change can easily be overlooked. Using the method instead of a property keeps 'MyApplicationService.getInstance()' calls consistent when used both in Kotlin, and Java. Using the method keeps 'MyApplicationService.getInstance()' consistent with 'MyProjectService.getInstance(project)', both on the declaration and call sites. For better tooling performance, it is always advised to keep an explicit method return type. Example: '@Service\nclass MyApplicationService {\n companion object {\n @JvmStatic\n val instance: MyApplicationService // bad\n get() = service()\n }\n}' '@Service\nclass MyApplicationService {\n companion object {\n @JvmStatic\n fun getInstance(): MyApplicationService = service() // good\n }\n}' New in 2023.3 Inspection ID: ApplicationServiceAsStaticFinalFieldOrProperty", + "markdown": "Reports assignments of application services to static final fields / immutable properties.\n\n#### Static final fields (Java) or static immutable properties with backing fields (Kotlin)\n\n\n**Note:** Hereinafter, static in Kotlin refers to members of non-anonymous objects or top-level declarations.\n\n\nSuch services' assignments contribute to global state and make it impossible to tear down an application and set up another one in tests,\ntherefore, repeated tests in the same process may fail.\nThe only exception is an explicit constructor call to store dummy/default instances.\n\n\nThe recommended way to avoid storing services is to retrieve a service locally.\nAlternatively, one can wrap it in `java.util.function.Supplier` (Java, Kotlin)\nor convert the property to a function (Kotlin).\n\nExample (Java):\n\n\n // Bad:\n private static final ManagingFS ourInstance = ApplicationManager.getApplication().getService(ManagingFS.class);\n\n\n // Good:\n private static final Supplier ourInstance = CachedSingletonsRegistry.lazy(() -> {\n return ApplicationManager.getApplication().getService(ManagingFS.class);\n });\n\n\n // Exception:\n private static final UniqueVFilePathBuilder DUMMY_BUILDER = new UniqueVFilePathBuilder()\n\n#### Retrieving a service instance through static immutable properties (Kotlin)\n\n\nWhile services' assignments to properties without backing fields don't cause the aforementioned problem,\nusing an explicit `getInstance()` method to retrieve a service is preferred over using a property:\n\n* It makes it clearer on the call site that it can involve loading the service, which might not be cheap.\n* Loading the service can throw an exception, and having an exception thrown by a method call is less surprising than if it was caused by property access.\n* (Over-)using properties may be error-prone in a way that it might be accidentally changed to a property with an initializer instead of the correct (but more verbose) property with a getter, and that change can easily be overlooked.\n* Using the method instead of a property keeps `MyApplicationService.getInstance()` calls consistent when used both in Kotlin, and Java.\n* Using the method keeps `MyApplicationService.getInstance()` consistent with `MyProjectService.getInstance(project)`, both on the declaration and call sites.\n\nFor better tooling performance, it is always advised to keep an explicit method return type.\n\nExample:\n\n\n @Service\n class MyApplicationService {\n companion object {\n @JvmStatic\n val instance: MyApplicationService // bad\n get() = service()\n }\n }\n\n\n @Service\n class MyApplicationService {\n companion object {\n @JvmStatic\n fun getInstance(): MyApplicationService = service() // good\n }\n }\n\nNew in 2023.3\n\nInspection ID: ApplicationServiceAsStaticFinalFieldOrProperty" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ApplicationServiceAsStaticFinalFieldOrProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PresentationAnnotation", + "shortDescription": { + "text": "Invalid icon path in @Presentation" + }, + "fullDescription": { + "text": "Reports invalid and deprecated value for 'icon' attribute in 'com.intellij.ide.presentation.Presentation' annotation. Inspection ID: PresentationAnnotation", + "markdown": "Reports invalid and deprecated value for `icon` attribute in `com.intellij.ide.presentation.Presentation` annotation.\n\nInspection ID: PresentationAnnotation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "PresentationAnnotation", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseVirtualFileEquals", + "shortDescription": { + "text": "Use 'VirtualFile#equals(Object)'" + }, + "fullDescription": { + "text": "Reports comparing 'VirtualFile' instances using '=='. Replace with 'equals()' call. Inspection ID: UseVirtualFileEquals", + "markdown": "Reports comparing `VirtualFile` instances using `==`.\n\n\nReplace with `equals()` call.\n\nInspection ID: UseVirtualFileEquals" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseVirtualFileEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticInitializationInExtensions", + "shortDescription": { + "text": "Static initialization in extension point implementations" + }, + "fullDescription": { + "text": "Reports static initialization in extension point implementations. Static initialization is performed once the class is loaded, which may cause excessive classloading or early initialization of heavy resources. Since extension point implementations are supposed to be cheap to create, they must not have static initializers. New in 2023.3 Inspection ID: StaticInitializationInExtensions", + "markdown": "Reports static initialization in [extension point implementations](https://plugins.jetbrains.com/docs/intellij/plugin-extensions.html).\n\n\nStatic initialization is performed once the class is loaded, which may cause excessive classloading or early initialization of heavy resources.\nSince extension point implementations are supposed to be cheap to create, they must not have static initializers.\n\nNew in 2023.3\n\nInspection ID: StaticInitializationInExtensions" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StaticInitializationInExtensions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnspecifiedActionsPlace", + "shortDescription": { + "text": "Unspecified action place" + }, + "fullDescription": { + "text": "Reports passing unspecified 'place' parameter for 'ActionManager.createActionToolbar()' and 'ActionManager.createActionPopupMenu()'. Specifying proper 'place' is required to distinguish Action's usage in 'update()/actionPerformed()' via 'AnActionEvent.getPlace()'. Examples: '// bad:\nactionManager.createActionToolbar(\"\", group, false);\nactionManager.createActionToolbar(\"unknown\", group, false);\nactionManager.createActionPopupMenu(ActionPlaces.UNKNOWN, group);\n\n// good:\nactionManager.createActionToolbar(\"MyPlace\", group, false);\nactionManager.createActionPopupMenu(ActionPlaces.EDITOR_TOOLBAR, group);' Inspection ID: UnspecifiedActionsPlace", + "markdown": "Reports passing unspecified `place` parameter for `ActionManager.createActionToolbar()` and `ActionManager.createActionPopupMenu()`.\n\n\nSpecifying proper `place` is required to distinguish Action's usage in `update()/actionPerformed()` via `AnActionEvent.getPlace()`.\n\n\nExamples:\n\n\n // bad:\n actionManager.createActionToolbar(\"\", group, false);\n actionManager.createActionToolbar(\"unknown\", group, false);\n actionManager.createActionPopupMenu(ActionPlaces.UNKNOWN, group);\n\n // good:\n actionManager.createActionToolbar(\"MyPlace\", group, false);\n actionManager.createActionPopupMenu(ActionPlaces.EDITOR_TOOLBAR, group);\n\nInspection ID: UnspecifiedActionsPlace" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnspecifiedActionsPlace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KeymapXmlDom", + "shortDescription": { + "text": "Keymap XML validity" + }, + "fullDescription": { + "text": "Reports problems in 'keymap.xml' files. New in 2025.1 Inspection ID: KeymapXmlDom", + "markdown": "Reports problems in `keymap.xml` files.\n\nNew in 2025.1\n\nInspection ID: KeymapXmlDom" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "KeymapXmlDom", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MismatchedLightServiceLevelAndCtor", + "shortDescription": { + "text": "Mismatch between light service level and its constructor" + }, + "fullDescription": { + "text": "Reports mismatches between light service levels and its constructors. The following problems are reported: A light service class has a constructor with two parameters of types 'com.intellij.openapi.project.Project' and 'kotlinx.coroutines.CoroutineScope', or one parameter of type 'Project' is not annotated as a project-level service. A light service class annotated as an application-level service does not have a no-arg constructor, nor a constructor with one parameter of type 'CoroutineScope'. Example (Kotlin): '@Service // Suggest specifying 'Service.Level.PROJECT' parameter in '@Service' annotation\nclass MyService(val project: Project) // Suggest removing the parameter from constructor 'MyService'' After applying the quick-fix that suggests specifying 'Service.Level.PROJECT' parameter in '@Service' annotation is applied: '@Service(Service.Level.PROJECT)\nclass MyService(val project: Project)' After applying the quick-fix that suggests removing the parameter from constructor 'MyService': '@Service\nclass MyService()' New in 2023.2 Inspection ID: MismatchedLightServiceLevelAndCtor", + "markdown": "Reports mismatches between light service levels and its constructors.\n\nThe following problems are reported:\n\n* A light service class has a constructor with two parameters of types `com.intellij.openapi.project.Project` and `kotlinx.coroutines.CoroutineScope`, or one parameter of type `Project` is not annotated as a project-level service.\n* A light service class annotated as an application-level service does not have a no-arg constructor, nor a constructor with one parameter of type `CoroutineScope`.\n\nExample (Kotlin):\n\n\n @Service // Suggest specifying 'Service.Level.PROJECT' parameter in '@Service' annotation\n class MyService(val project: Project) // Suggest removing the parameter from constructor 'MyService'\n\nAfter applying the quick-fix that suggests specifying 'Service.Level.PROJECT' parameter in '@Service' annotation is applied:\n\n\n @Service(Service.Level.PROJECT)\n class MyService(val project: Project)\n\nAfter applying the quick-fix that suggests removing the parameter from constructor 'MyService':\n\n\n @Service\n class MyService()\n\nNew in 2023.2\n\nInspection ID: MismatchedLightServiceLevelAndCtor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MismatchedLightServiceLevelAndCtor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ActionIsNotPreviewFriendly", + "shortDescription": { + "text": "Field blocks intention preview" + }, + "fullDescription": { + "text": "Reports fields in 'LocalQuickFix' and 'IntentionAction' implementations that prevent intention preview action from functioning properly. Additionally, excessive '@SafeFieldForPreview' annotations are reported on fields whose types are known to be safe. Intention preview is an IntelliJ platform feature that displays how quick-fix or intention action will change the current file when applied. To implement this in quick fixes, 'LocalQuickFix.generatePreview()' is called with a custom 'ProblemDescriptor' that points to the non-physical copy of current file. In intention actions, 'IntentionAction.generatePreview()' is called with the non-physical copy of current file and imaginary editor. Normally, these methods just delegate to 'LocalQuickFix.applyFix()' or 'IntentionAction.invoke()'. However, some quick-fixes may refer directly or indirectly to physical elements and use them for writing. As a result, preview won't work, as the quick-fix will attempt to update physical PSI instead of non-physical one. To avoid this, default implementation of 'generatePreview()' delegates only if all the instance fields of a quick fix or intention action class have safe types: primitives, Strings, etc. You may fix this problem in a number of ways: If the field does not actually store any PSI reference, or that PSI is used only for reading, you may annotate the field with '@SafeFieldForPreview'. You can also use '@SafeTypeForPreview' if the field type can never store any writable PSI reference. You may override 'getFileModifierForPreview()' method and create a copy of the quick-fix rebinding it to the non-physical file copy which is supplied as a parameter. Use 'PsiTreeUtil.findSameElementInCopy()' to find the corresponding PSI elements inside the supplied non-physical copy. Instead of storing PSI references in fields, try to extract all the necessary information from 'ProblemDescriptor.getPsiElement()' in quick fix or from the supplied file/editor in intention action. You may also inherit the abstract 'LocalQuickFixAndIntentionActionOnPsiElement' class and implement its 'invoke()' and 'isAvailable()' methods, which have 'startElement' and 'endElement' parameters. These parameters are automatically mapped to a non-physical file copy for you. You may override 'generatePreview()' method and provide completely custom preview behavior. For example, it's possible to display a custom HTML document instead of actual preview if your action does something besides modifying a current file. This inspection does not report if a custom implementation of 'getFileModifierForPreview()' or 'generatePreview()' exists. However, this doesn't mean that the implementation is correct and preview works. Please test. Also note that preview result is calculated in background thread, so you cannot start a write action during the preview or do any operation that requires a write action. Finally, no preview is generated automatically if 'startInWriteAction()' returns 'false'. In this case, having custom 'generatePreview()' implementation is desired. Inspection ID: ActionIsNotPreviewFriendly New in 2022.1", + "markdown": "Reports fields in `LocalQuickFix` and `IntentionAction` implementations that prevent intention preview action from functioning properly. Additionally, excessive `@SafeFieldForPreview` annotations are reported on fields whose types are known to be safe.\n\n\nIntention preview is an IntelliJ platform feature that displays how quick-fix or intention action\nwill change the current file when applied. To implement this in quick fixes,\n`LocalQuickFix.generatePreview()` is called with a custom `ProblemDescriptor`\nthat points to the non-physical copy of current file. In intention actions, `IntentionAction.generatePreview()`\nis called with the non-physical copy of current file and imaginary editor.\nNormally, these methods just delegate to `LocalQuickFix.applyFix()` or `IntentionAction.invoke()`.\nHowever, some quick-fixes may refer directly or indirectly to physical elements and use them for writing. As a result,\npreview won't work, as the quick-fix will attempt to update physical PSI instead of non-physical one.\nTo avoid this, default implementation of `generatePreview()` delegates only if all the\ninstance fields of a quick fix or intention action class have safe types: primitives, Strings, etc.\n\n\nYou may fix this problem in a number of ways:\n\n1. If the field does not actually store any PSI reference, or that PSI is used only for reading, you may annotate the field with `@SafeFieldForPreview`. You can also use `@SafeTypeForPreview` if the field type can never store any writable PSI reference.\n2. You may override `getFileModifierForPreview()` method and create a copy of the quick-fix rebinding it to the non-physical file copy which is supplied as a parameter. Use `PsiTreeUtil.findSameElementInCopy()` to find the corresponding PSI elements inside the supplied non-physical copy.\n3. Instead of storing PSI references in fields, try to extract all the necessary information from `ProblemDescriptor.getPsiElement()` in quick fix or from the supplied file/editor in intention action. You may also inherit the abstract `LocalQuickFixAndIntentionActionOnPsiElement` class and implement its `invoke()` and `isAvailable()` methods, which have `startElement` and `endElement` parameters. These parameters are automatically mapped to a non-physical file copy for you.\n4. You may override `generatePreview()` method and provide completely custom preview behavior. For example, it's possible to display a custom HTML document instead of actual preview if your action does something besides modifying a current file.\n\n\nThis inspection does not report if a custom implementation of `getFileModifierForPreview()`\nor `generatePreview()` exists. However, this doesn't mean that the implementation is correct and preview works.\nPlease test. Also note that preview result is calculated in background thread, so you cannot start a write action\nduring the preview or do any operation that requires a write action. Finally, no preview is generated automatically\nif `startInWriteAction()` returns `false`. In this case, having custom `generatePreview()`\nimplementation is desired.\n\nInspection ID: ActionIsNotPreviewFriendly\n\nNew in 2022.1" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ActionIsNotPreviewFriendly", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LightServiceMigrationCode", + "shortDescription": { + "text": "A service can be converted to a light one" + }, + "fullDescription": { + "text": "Reports classes that can be marked as light services using the '@com.intellij.openapi.components.Service' annotation instead of being registered as services in 'plugin.xml' A service that is not intended for overriding is not required to be registered in the 'plugin.xml' file. Instead, annotate the service class with the '@Service' annotation. For project-level services, specify '@Service(Service.Level.PROJECT)'. Requirements: IntelliJ Platform 2019.3 or newer. Service class must be 'final'. 'serviceInterface' is not specified. If the application-level service is a 'com.intellij.openapi.components.PersistentStateComponent', roaming must be disabled ('roamingType = RoamingType.DISABLED'). None of these attributes is specified: 'os', 'client', 'overrides', 'id', 'preload', 'configurationSchemaKey'. See Services in IntelliJ Platform Plugin SDK docs for more details. See also the 'Plugin DevKit | Plugin descriptor | A service can be converted to a light one' inspection. New in 2023.2 Inspection ID: LightServiceMigrationCode", + "markdown": "Reports classes that can be marked as light services using the `@com.intellij.openapi.components.Service` annotation instead of being registered as services in `plugin.xml`\n\n\nA service that is not intended for overriding is not required to be registered in the `plugin.xml` file.\nInstead, annotate the service class with the `@Service` annotation. For project-level services, specify\n`@Service(Service.Level.PROJECT)`.\n\n\nRequirements:\n\n* IntelliJ Platform 2019.3 or newer.\n* Service class must be `final`.\n* `serviceInterface` is not specified.\n* If the application-level service is a `com.intellij.openapi.components.PersistentStateComponent`, roaming must be disabled (`roamingType = RoamingType.DISABLED`).\n* None of these attributes is specified: `os`, `client`, `overrides`, `id`, `preload`, `configurationSchemaKey`.\n\n\nSee [Services](https://plugins.jetbrains.com/docs/intellij/plugin-services.html) in IntelliJ Platform Plugin SDK docs for more details.\n\n\nSee also the `Plugin DevKit | Plugin descriptor | A service can be converted to a light one` inspection.\n\nNew in 2023.2\n\nInspection ID: LightServiceMigrationCode" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LightServiceMigrationCode", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InspectionUsingGrayColors", + "shortDescription": { + "text": "Using new Color(a,a,a)" + }, + "fullDescription": { + "text": "Reports usages of 'java.awt.Color' to create gray colors. The Convert to 'Gray' quick fix replaces it using 'com.intellij.ui.Gray' constants instead. Examples: '// bad:\nColor gray = new Color(37, 37, 37);\n\n// good:\nColor gray = Gray._37;' Inspection ID: InspectionUsingGrayColors", + "markdown": "Reports usages of `java.awt.Color` to create gray colors.\n\n\nThe **Convert to 'Gray'** quick fix replaces it using `com.intellij.ui.Gray` constants instead.\n\nExamples:\n\n\n // bad:\n Color gray = new Color(37, 37, 37);\n\n // good:\n Color gray = Gray._37;\n\nInspection ID: InspectionUsingGrayColors" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InspectionUsingGrayColors", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ObsoleteDispatchersEdt", + "shortDescription": { + "text": "Consider using 'Dispatchers.UI'" + }, + "fullDescription": { + "text": "Reports usages of 'Dispatchers.EDT'. 'Dispatchers.EDT' is obsolete, because if acquires write-intent lock by default. Use 'Dispatchers.UI' of 'writeAction' instead. Inspection ID: ObsoleteDispatchersEdt", + "markdown": "Reports usages of `Dispatchers.EDT`.\n\n\n`Dispatchers.EDT` is obsolete, because if acquires write-intent lock by default.\nUse `Dispatchers.UI` of `writeAction` instead.\n\nInspection ID: ObsoleteDispatchersEdt" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ObsoleteDispatchersEdt", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IntentionDescriptionNotFoundInspection", + "shortDescription": { + "text": "Intention description checker" + }, + "fullDescription": { + "text": "Reports intentions that are missing an HTML description file, 'before.template' file or 'after.template' file. These are shown in Settings | Editor | Intentions. The Create description file quick-fix creates a template HTML description file. If no before/after template files are required, add 'true' to the intention registration in 'plugin.xml'. See Intentions in IntelliJ Platform Plugin SDK docs for more details. Inspection ID: IntentionDescriptionNotFoundInspection", + "markdown": "Reports intentions that are missing an HTML description file, `before.template` file or `after.template` file. These are shown in [Settings \\| Editor \\| Intentions](settings://preferences.intentionPowerPack).\n\n\nThe **Create description file** quick-fix creates a template HTML description file.\n\n\nIf no before/after template files are required, add `true`\nto the intention registration in `plugin.xml`.\n\n\nSee [Intentions](https://plugins.jetbrains.com/docs/intellij/code-intentions.html#intention-description)\nin IntelliJ Platform Plugin SDK docs for more details.\n\nInspection ID: IntentionDescriptionNotFoundInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "IntentionDescriptionNotFoundInspection", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Description file", + "index": 109, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncorrectServiceRetrieving", + "shortDescription": { + "text": "Incorrect service retrieving" + }, + "fullDescription": { + "text": "Reports the following problems when retrieving services: Attempts to retrieve an unregistered service. Mismatch when retrieving a service: attempting to get a project-level service as an application-level service, or vice versa. Example (Kotlin): '@Service\nclass MyAppService\n\n@Service(Service.Level.PROJECT)\nclass MyProjectService(private val project: Project)' '// Bad:\nval projectService = service() // The project-level service is retrieved as an application-level service\nval applicationService = project.service() // The application-level service is retrieved as a project-level service' '// Good:\nval projectService = project.service()\nval applicationService = service();' New in 2023.2 Inspection ID: IncorrectServiceRetrieving", + "markdown": "Reports the following problems when retrieving services:\n\n* Attempts to retrieve an unregistered service.\n* Mismatch when retrieving a service: attempting to get a project-level service as an application-level service, or vice versa.\n\nExample (Kotlin):\n\n\n @Service\n class MyAppService\n\n @Service(Service.Level.PROJECT)\n class MyProjectService(private val project: Project)\n\n\n // Bad:\n val projectService = service() // The project-level service is retrieved as an application-level service\n val applicationService = project.service() // The application-level service is retrieved as a project-level service\n\n\n // Good:\n val projectService = project.service()\n val applicationService = service();\n\nNew in 2023.2\n\nInspection ID: IncorrectServiceRetrieving" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "IncorrectServiceRetrieving", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PluginXmlDynamicPlugin", + "shortDescription": { + "text": "Plugin.xml dynamic plugin verification" + }, + "fullDescription": { + "text": "Reports dynamic plugin problems. Dynamic plugins can be installed, updated and uninstalled without restarting the IDE (supported in 2020.1 and later). Please see Dynamic Plugins for further reference. New in 2020.1 Inspection ID: PluginXmlDynamicPlugin", + "markdown": "Reports dynamic plugin problems.\n\n\nDynamic plugins can be installed, updated and uninstalled without restarting the IDE (supported in 2020.1 and later).\n\n\nPlease see [Dynamic Plugins](https://plugins.jetbrains.com/docs/intellij/dynamic-plugins.html?from=PluginXmlDynamicPlugin) for further reference.\n\nNew in 2020.1\n\nInspection ID: PluginXmlDynamicPlugin" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PluginXmlDynamicPlugin", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LiveTemplateI18n", + "shortDescription": { + "text": "Live templates i18n" + }, + "fullDescription": { + "text": "Reports hardcoded text in live template description. Using texts defined in resource bundles allows supporting multiple languages in the IDE. Inspection ID: LiveTemplateI18n", + "markdown": "Reports hardcoded text in live template description.\n\n\nUsing texts defined in resource bundles allows supporting multiple languages in the IDE.\n\nInspection ID: LiveTemplateI18n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LiveTemplateI18n", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UastHintedVisitorAdapterHints", + "shortDescription": { + "text": "'UastHintedVisitorAdapter' hints problems" + }, + "fullDescription": { + "text": "Reports missing or redundant hints in 'UastHintedVisitorAdapter' creation. 'UastHintedVisitorAdapter' receives hints that allow to optimize UAST visitor execution by visiting only elements, which classes are specified in the hint list. If the visitor implements, e.g., 'visitCallExpression' method, but does not include 'UCallExpression' in hints, then the method will not be executed. If the visitor does not implement, e.g., 'visitCallExpression' method, but does include 'UCallExpression' in hints, then the inherited method will be unnecessarily executed. Examples 'return UastHintedVisitorAdapter.create(\n language,\n object : AbstractUastNonRecursiveVisitor() {\n override fun visitForExpression(node: UForExpression): Boolean {\n inspectLoopExpression()\n return true\n }\n\n override fun visitDoWhileExpression(node: UDoWhileExpression): Boolean { // unused at runtime\n inspectLoopExpression()\n return true\n }\n //...\n },\n arrayOf(UForExpression::class.java) // Bad: missing UDoWhileExpression::class.java\n)' 'UastHintedVisitorAdapter.create(\n language,\n object : AbstractUastNonRecursiveVisitor() {\n override fun visitForExpression(node: UForExpression): Boolean {\n inspectLoopExpression()\n return true\n }\n //...\n },\n arrayOf(\n UForExpression::class.java,\n UDoWhileExpression::class.java // Bad: visiting UDoWhileExpression is not implemented\n )\n)' New in 2024.2 Inspection ID: UastHintedVisitorAdapterHints", + "markdown": "Reports missing or redundant hints in `UastHintedVisitorAdapter` creation.\n\n\n`UastHintedVisitorAdapter` receives hints that allow to optimize UAST visitor execution by visiting only elements, which classes are specified in the hint list.\n\n\nIf the visitor implements, e.g., `visitCallExpression` method, but does not include `UCallExpression` in hints, then the method will not be executed.\n\n\nIf the visitor does not implement, e.g., `visitCallExpression` method, but does include `UCallExpression` in hints, then the inherited method will be unnecessarily executed.\n\n### Examples\n\n\n return UastHintedVisitorAdapter.create(\n language,\n object : AbstractUastNonRecursiveVisitor() {\n override fun visitForExpression(node: UForExpression): Boolean {\n inspectLoopExpression()\n return true\n }\n\n override fun visitDoWhileExpression(node: UDoWhileExpression): Boolean { // unused at runtime\n inspectLoopExpression()\n return true\n }\n //...\n },\n arrayOf(UForExpression::class.java) // Bad: missing UDoWhileExpression::class.java\n )\n\n\n UastHintedVisitorAdapter.create(\n language,\n object : AbstractUastNonRecursiveVisitor() {\n override fun visitForExpression(node: UForExpression): Boolean {\n inspectLoopExpression()\n return true\n }\n //...\n },\n arrayOf(\n UForExpression::class.java,\n UDoWhileExpression::class.java // Bad: visiting UDoWhileExpression is not implemented\n )\n )\n\nNew in 2024.2\n\nInspection ID: UastHintedVisitorAdapterHints" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UastHintedVisitorAdapterHints", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComponentRegistrationProblems", + "shortDescription": { + "text": "Component type mismatch" + }, + "fullDescription": { + "text": "Reports incorrect registration of plugin components (Actions and Components). The following problems are reported: Action/Component implementation class is abstract. Class is registered in plugin.xml as action but does not extend 'AnAction' class. Action class does not have a public no-argument constructor. Inspection ID: ComponentRegistrationProblems", + "markdown": "Reports incorrect registration of plugin components (Actions and Components).\n\n\nThe following problems are reported:\n\n* Action/Component implementation class is abstract.\n* Class is registered in plugin.xml as action but does not extend `AnAction` class.\n* Action class does not have a public no-argument constructor.\n\nInspection ID: ComponentRegistrationProblems" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "ComponentRegistrationProblems", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LightServiceMustBeFinal", + "shortDescription": { + "text": "Light service must be final" + }, + "fullDescription": { + "text": "Reports classes annotated with the '@com.intellij.openapi.components.Service' annotation that are not final. Suggests making a class final if it is concrete. Example: '// MyService.kt\n @Service(Service.Level.APP)\n open class MyService' After the quick-fix is applied: '// MyService.kt\n @Service(Service.Level.APP)\n class MyService' Suggests removing the '@Service' annotation if it is an abstract class or interface. Example: '// MyService.java\n @Service(Service.Level.APP)\n abstract class MyService {}' After the quick-fix is applied: '// MyService.java\n abstract class MyService {}' New in 2023.2 Inspection ID: LightServiceMustBeFinal", + "markdown": "Reports classes annotated with the `@com.intellij.openapi.components.Service` annotation that are not final.\n\n\nSuggests making a class final if it is concrete.\n\n**Example:**\n\n\n // MyService.kt\n @Service(Service.Level.APP)\n open class MyService\n\nAfter the quick-fix is applied:\n\n\n // MyService.kt\n @Service(Service.Level.APP)\n class MyService\n\n\nSuggests removing the `@Service` annotation if it is an abstract class or interface.\n\n**Example:**\n\n\n // MyService.java\n @Service(Service.Level.APP)\n abstract class MyService {}\n\nAfter the quick-fix is applied:\n\n\n // MyService.java\n abstract class MyService {}\n\nNew in 2023.2\n\nInspection ID: LightServiceMustBeFinal" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "LightServiceMustBeFinal", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingRecentApi", + "shortDescription": { + "text": "Usage of IntelliJ API not available in older IDEs" + }, + "fullDescription": { + "text": "Reports usages of IntelliJ Platform API introduced in a version newer than the one specified in '' '@since-build' in 'plugin.xml'. Using such API may lead to incompatibilities of the plugin with older IDE versions. To avoid possible issues when running the plugin in older IDE versions, increase 'since-build' accordingly, or remove usages of this API. See Build Number Ranges in IntelliJ Platform Plugin SDK docs for more details. Configure the inspection: If '' '@since/until-build' attributes are not specified in 'plugin.xml', set Since/Until explicitly. Inspection ID: MissingRecentApi", + "markdown": "Reports usages of IntelliJ Platform API introduced in a version *newer* than the one specified in `` `@since-build` in `plugin.xml`.\n\n\nUsing such API may lead to incompatibilities of the plugin with older IDE versions.\n\n\nTo avoid possible issues when running the plugin in older IDE versions, increase `since-build` accordingly,\nor remove usages of this API.\n\n\nSee [Build Number Ranges](https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html) in IntelliJ Platform Plugin SDK docs for more details.\n\nConfigure the inspection:\nIf `` `@since/until-build` attributes are not specified in `plugin.xml`, set **Since** /**Until** explicitly.\n\nInspection ID: MissingRecentApi" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "MissingRecentApi", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LightServiceMigrationXML", + "shortDescription": { + "text": "A service can be converted to a light one" + }, + "fullDescription": { + "text": "Reports services registered in 'plugin.xml' that can be converted to light ones. A service that is not intended for overriding is not required to be registered in the 'plugin.xml' file. Instead, annotate the service class with the '@com.intellij.openapi.components.Service' annotation. For project-level services, specify '@Service(Service.Level.PROJECT)'. Requirements: IntelliJ Platform 2019.3 or newer. Service class must be 'final'. 'serviceInterface' is not specified. If the application-level service is a 'com.intellij.openapi.components.PersistentStateComponent', roaming must be disabled ('roamingType = RoamingType.DISABLED'). None of these attributes is specified: 'os', 'client', 'overrides', 'id', 'preload', 'configurationSchemaKey'. Also reports services registered in 'plugin.xml' whose classes are already annotated with '@Service'. See Services in IntelliJ Platform Plugin SDK docs for more details. See also the 'Plugin DevKit | Code | A service can be converted to a light one' inspection. New in 2023.2 Inspection ID: LightServiceMigrationXML", + "markdown": "Reports services registered in `plugin.xml` that can be converted to light ones.\n\n\nA service that is not intended for overriding is not required to be registered in the `plugin.xml` file.\nInstead, annotate the service class with the `@com.intellij.openapi.components.Service` annotation. For\nproject-level services, specify `@Service(Service.Level.PROJECT)`.\n\n\nRequirements:\n\n* IntelliJ Platform 2019.3 or newer.\n* Service class must be `final`.\n* `serviceInterface` is not specified.\n* If the application-level service is a `com.intellij.openapi.components.PersistentStateComponent`, roaming must be disabled (`roamingType = RoamingType.DISABLED`).\n* None of these attributes is specified: `os`, `client`, `overrides`, `id`, `preload`, `configurationSchemaKey`.\n\nAlso reports services registered in `plugin.xml` whose classes are already annotated with `@Service`.\n\n\nSee [Services](https://plugins.jetbrains.com/docs/intellij/plugin-services.html) in IntelliJ Platform Plugin SDK docs for more details.\n\n\nSee also the `Plugin DevKit | Code | A service can be converted to a light one` inspection.\n\nNew in 2023.2\n\nInspection ID: LightServiceMigrationXML" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LightServiceMigrationXML", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinObjectExtensionRegistration", + "shortDescription": { + "text": "Extension class is a Kotlin object" + }, + "fullDescription": { + "text": "Reports extensions which are instantiated by the IntelliJ Platform, but are declared as Kotlin objects. Extensions lifecycle is managed by the IntelliJ Platform. Using Kotlin objects for extension registration may cause creation of unnecessary extension instances and make plugin unloading impossible. Example Extension registration: '' Extension implementation: '// bad:\nobject MyAnnotator : Annotator {\n ...\n}\n\n// good:\nclass MyAnnotator : Annotator {\n ...\n}' New in 2023.1 Inspection ID: KotlinObjectExtensionRegistration", + "markdown": "Reports extensions which are instantiated by the IntelliJ Platform, but are declared as Kotlin objects.\n\n\nExtensions lifecycle is managed by the IntelliJ Platform.\nUsing Kotlin objects for extension registration may cause creation of unnecessary extension instances and make plugin unloading\nimpossible.\n\nExample\n-------\n\nExtension registration:\n\n\n \n\nExtension implementation:\n\n\n // bad:\n object MyAnnotator : Annotator {\n ...\n }\n\n // good:\n class MyAnnotator : Annotator {\n ...\n }\n\nNew in 2023.1\n\nInspection ID: KotlinObjectExtensionRegistration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "KotlinObjectExtensionRegistration", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingAccessibleContext", + "shortDescription": { + "text": "Accessible context is missing" + }, + "fullDescription": { + "text": "Reports Swing components that do not provide accessibility context. This information is used by screen readers. Failing to provide it makes the component inaccessible for visually impaired users. Example: 'ListCellRenderer renderer = (list, val, index, sel, cell) -> {\n JPanel panel = new JPanel();\n return panel;\n };' To fix the problem, you should either call 'setAccessibleName()' on the returned 'JPanel' or override its 'getAccessibleContext()' method. The returned text should reflect the purpose of the component. For example, in the case of 'ListCellRenderer', this would be the text of the menu item. Inspection ID: MissingAccessibleContext", + "markdown": "Reports Swing components that do not provide accessibility context.\n\n\nThis information is used by screen readers. Failing to provide it makes the component inaccessible for\nvisually impaired users.\n\n**Example:**\n\n\n ListCellRenderer renderer = (list, val, index, sel, cell) -> {\n JPanel panel = new JPanel();\n return panel;\n };\n\n\nTo fix the problem, you should either call `setAccessibleName()` on the returned `JPanel`\nor override its `getAccessibleContext()` method.\n\n\nThe returned text should reflect the purpose\nof the component. For example, in the case of `ListCellRenderer`, this would be the text of the menu\nitem.\n\nInspection ID: MissingAccessibleContext" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MissingAccessibleContext", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Security" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SimplifiableServiceRetrieving", + "shortDescription": { + "text": "Simplifiable service retrieving" + }, + "fullDescription": { + "text": "Reports service getting calls that can be replaced with a calls to an existing static 'getInstance()' or 'getInstance(Project)' methods. Example (Java): '@Service\npublic class MyAppService {\n public static MyAppService getInstance() {\n return ApplicationManager.getApplication().getService(MyAppService.class);\n }\n}\n\n@Service(Service.Level.PROJECT)\npublic class MyProjectService {\n public static MyProjectService getInstance(Project project) {\n return project.getService(MyProjectService.class);\n }\n}' '// Bad:\nMyAppService applicationService = ApplicationManager.getApplication().getService(MyAppService.class);\nMyProjectService projectService = project.getService(MyProjectService.class);' '// Good:\nMyAppService applicationService = MyAppService.getInstance();\nMyProjectService projectService = MyProjectService.getInstance(project);' New in 2023.2 Inspection ID: SimplifiableServiceRetrieving", + "markdown": "Reports service getting calls that can be replaced with a calls to an existing static `getInstance()` or `getInstance(Project)` methods.\n\nExample (Java):\n\n\n @Service\n public class MyAppService {\n public static MyAppService getInstance() {\n return ApplicationManager.getApplication().getService(MyAppService.class);\n }\n }\n\n @Service(Service.Level.PROJECT)\n public class MyProjectService {\n public static MyProjectService getInstance(Project project) {\n return project.getService(MyProjectService.class);\n }\n }\n\n\n // Bad:\n MyAppService applicationService = ApplicationManager.getApplication().getService(MyAppService.class);\n MyProjectService projectService = project.getService(MyProjectService.class);\n\n\n // Good:\n MyAppService applicationService = MyAppService.getInstance();\n MyProjectService projectService = MyProjectService.getInstance(project);\n\nNew in 2023.2\n\nInspection ID: SimplifiableServiceRetrieving" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SimplifiableServiceRetrieving", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseJBColor", + "shortDescription": { + "text": "Use Darcula aware JBColor" + }, + "fullDescription": { + "text": "Reports usages of 'java.awt.Color'. These are not aware of \"dark\" themes (e.g., bundled \"Darcula\") and might result in bad looking UI. Quick-fix replaces usages with 'JBColor', which defines \"dark\" color variant. Examples: '// bad:\nColor darkGreen = new Color(12, 58, 27);\nColor blue = Color.BLUE;\n\n// good:\nColor darkGreen = new JBColor(12, 58, 27);\nColor blue = JBColor.BLUE;\nColor green = new JBColor(new Color(12, 58, 27), new Color(27, 112, 39));' Inspection ID: UseJBColor", + "markdown": "Reports usages of `java.awt.Color`.\n\n\nThese are not aware of \"dark\" themes (e.g., bundled \"Darcula\") and might result in bad looking UI.\n\n\nQuick-fix replaces usages with `JBColor`, which defines \"dark\" color variant.\n\nExamples:\n\n\n // bad:\n Color darkGreen = new Color(12, 58, 27);\n Color blue = Color.BLUE;\n\n // good:\n Color darkGreen = new JBColor(12, 58, 27);\n Color blue = JBColor.BLUE;\n Color green = new JBColor(new Color(12, 58, 27), new Color(27, 112, 39));\n\nInspection ID: UseJBColor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseJBColor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PluginXmlExtensionRegistration", + "shortDescription": { + "text": "Plugin.xml extension registration" + }, + "fullDescription": { + "text": "Reports problems with extension registration in 'plugin.xml'. The following problems are reported: Missing 'language' declaration. If the extension does not target a specific language, use quick fix to create an explicit declaration for \"any language\". Inspections: missing attributes Intention: redundant 'descriptionDirectoryName' declaration Services: redundant 'serviceInterface' declaration 'com.intellij.stubElementTypeHolder' without 'externalIdPrefix', see Stub Indexes 'com.intellij.statusBarWidgetFactory' without 'id' 'com.intellij.applicationConfigurable|projectConfigurable' without 'displayName'/'key' New in 2022.3 Inspection ID: PluginXmlExtensionRegistration", + "markdown": "Reports problems with extension registration in `plugin.xml`.\n\n\nThe following problems are reported:\n\n* Missing `language` declaration. If the extension does not target a specific language, use quick fix to create an explicit declaration for \"any language\".\n* Inspections: missing attributes\n* Intention: redundant `descriptionDirectoryName` declaration\n* Services: redundant `serviceInterface` declaration\n* `com.intellij.stubElementTypeHolder` without `externalIdPrefix`, see [Stub Indexes](https://plugins.jetbrains.com/docs/intellij/stub-indexes.html?from=?from=DevkitPluginXmlInspectionDescription)\n* `com.intellij.statusBarWidgetFactory` without `id`\n* `com.intellij.applicationConfigurable|projectConfigurable` without `displayName`/`key`\n\nNew in 2022.3\n\nInspection ID: PluginXmlExtensionRegistration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PluginXmlExtensionRegistration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UElementAsPsi", + "shortDescription": { + "text": "UElement as PsiElement usage" + }, + "fullDescription": { + "text": "Reports usage of UAST 'UElement' as 'PsiElement'. The 'PsiElement' obtained this way is ambiguous. To obtain \"physical\" 'PsiElement' use 'UElementKt.getSourcePsiElement()', for 'PsiElement' that \"emulates\" behaviour of Java-elements ('PsiClass', 'PsiMethod', etc.) use 'UElementKt.getAsJavaPsiElement()'. See UAST - Unified Abstract Syntax Tree in SDK Docs. Inspection ID: UElementAsPsi", + "markdown": "Reports usage of UAST `UElement` as `PsiElement`.\n\n\nThe `PsiElement` obtained this way is ambiguous.\n\n\nTo obtain \"physical\" `PsiElement` use `UElementKt.getSourcePsiElement()`,\nfor `PsiElement` that \"emulates\" behaviour of Java-elements (`PsiClass`, `PsiMethod`, etc.)\nuse `UElementKt.getAsJavaPsiElement()`.\n\n\nSee [UAST - Unified Abstract Syntax Tree](https://plugins.jetbrains.com/docs/intellij/uast.html) in SDK Docs.\n\nInspection ID: UElementAsPsi" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UElementAsPsi", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingActionUpdateThread", + "shortDescription": { + "text": "ActionUpdateThread is missing" + }, + "fullDescription": { + "text": "Reports actions, action groups and other 'ActionUpdateThreadAware' classes that do not explicitly state their mode. When an action or an action group defines its own 'update()' method, IntelliJ Platform tries to mimic the old synchronous way of calling 'update()' and 'getChildren()' methods in the UI thread and supply it with all the data in 'AnActionEvent.dataContext()'. To do that, it caches all the possible data on a background thread beforehand, even if it is not needed. Provide one of the two modes 'ActionUpdateThread.EDT' or 'ActionUpdateThread.BGT' by overriding the 'getActionUpdateThread()' method. See the documentation of 'ActionUpdateThread' for more information. Inspection ID: MissingActionUpdateThread", + "markdown": "Reports actions, action groups and other `ActionUpdateThreadAware` classes that do not explicitly state their mode.\n\n\nWhen an action or an action group defines its own `update()` method, IntelliJ Platform tries to mimic\nthe old synchronous way of calling `update()` and `getChildren()` methods in the UI thread and\nsupply it with all the data in `AnActionEvent.dataContext()`.\nTo do that, it caches all the possible data on a background thread beforehand, even if it is not needed.\n\n\nProvide one of the two modes `ActionUpdateThread.EDT` or `ActionUpdateThread.BGT`\nby overriding the `getActionUpdateThread()` method.\n\n\nSee the documentation of `ActionUpdateThread` for more information.\n\nInspection ID: MissingActionUpdateThread" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MissingActionUpdateThread", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PluginXmlI18n", + "shortDescription": { + "text": "Plugin.xml i18n verification" + }, + "fullDescription": { + "text": "Reports hardcoded texts in 'plugin.xml'. Using texts defined in resource bundles allows supporting multiple languages in the IDE. See Internationalization in IntelliJ Platform Plugin SDK docs for more details. The following elements are checked: ', ' '' known extension points having 'bundle/key' alternative Inspection ID: PluginXmlI18n", + "markdown": "Reports hardcoded texts in `plugin.xml`.\n\n\nUsing texts defined in resource bundles allows supporting multiple languages in the IDE.\nSee [Internationalization](https://plugins.jetbrains.com/docs/intellij/internationalization.html)\nin IntelliJ Platform Plugin SDK docs for more details.\n\n\nThe following elements are checked:\n\n* `, `\n* ``\n* known extension points having `bundle/key` alternative\n\nInspection ID: PluginXmlI18n" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PluginXmlI18n", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UsePrimitiveTypes", + "shortDescription": { + "text": "Use 'PsiType#equals(Object)' with primitive types" + }, + "fullDescription": { + "text": "Reports comparing 'PsiPrimitiveType' instances using '=='. Primitive types should be compared with 'equals' as Java 8 type annotations are also applicable for them. Replace with 'equals()' call. Inspection ID: UsePrimitiveTypes", + "markdown": "Reports comparing `PsiPrimitiveType` instances using `==`.\n\n\nPrimitive types should be compared with `equals` as Java 8 type annotations are also applicable for them.\n\n\nReplace with `equals()` call.\n\nInspection ID: UsePrimitiveTypes" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UsePrimitiveTypes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "QuickFixGetFamilyNameViolation", + "shortDescription": { + "text": "QuickFix's getFamilyName() implementation must not depend on a specific context" + }, + "fullDescription": { + "text": "Reports 'QuickFix.getFamilyName()' using contextual information. This method must not use any non-static information. Inspection ID: QuickFixGetFamilyNameViolation", + "markdown": "Reports `QuickFix.getFamilyName()` using contextual information.\n\n\nThis method must not use any non-static information.\n\nInspection ID: QuickFixGetFamilyNameViolation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "QuickFixGetFamilyNameViolation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PublicTestExtensionFunction", + "shortDescription": { + "text": "Public extension function on Driver/Finder/IdeaFrameUI in intelij.driver.tests" + }, + "fullDescription": { + "text": "Reports public extension functions on Driver/Finder/IdeaFrameUI in test classes within the intellij.driver.tests module. Public extension functions in the intellij.driver.tests module create maintainability issues because they: Become visible to all tests across all contexts Can lead to unclear test dependencies and harder maintenance Recommended solutions: Move the function to a private companion object Relocate to an appropriate page object: Generic page object for widely applicable functions Specific page object for context-dependent functions Inspection ID: PublicTestExtensionFunction", + "markdown": "Reports public extension functions on Driver/Finder/IdeaFrameUI in test classes within the intellij.driver.tests module.\n\n\nPublic extension functions in the intellij.driver.tests module create maintainability issues because they:\n\n* Become visible to all tests across all contexts\n* Can lead to unclear test dependencies and harder maintenance\n\n\n**Recommended solutions:**\n\n* Move the function to a private companion object\n* Relocate to an appropriate page object:\n * Generic page object for widely applicable functions\n * Specific page object for context-dependent functions\n\nInspection ID: PublicTestExtensionFunction" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PublicTestExtensionFunction", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UsePluginIdEquals", + "shortDescription": { + "text": "Use 'PluginId#equals(Object)'" + }, + "fullDescription": { + "text": "Reports comparing 'PluginId' instances using '=='. Replace with 'equals()' call. Inspection ID: UsePluginIdEquals", + "markdown": "Reports comparing `PluginId` instances using `==`.\n\n\nReplace with `equals()` call.\n\nInspection ID: UsePluginIdEquals" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UsePluginIdEquals", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PotentialDeadlockInServiceInitialization", + "shortDescription": { + "text": "Potential deadlock in service initialization" + }, + "fullDescription": { + "text": "Reports read/write actions and 'invokeAndWait' called from the scope of service initialization: service constructors and initialization blocks (including static) service companion object's initialization blocks (Kotlin) service methods used in initialization blocks and fields initialization 'PersistentStateComponent' initialization lifecycle methods: 'loadState' 'noStateLoaded' 'initializeComponent' Running a read/write action or calling 'invokeAndWait' during service initialization may cause deadlocks. Examples: Kotlin: '@Service\ninternal class MyService {\n private val myData = initMyData();\n\n constructor() {\n val data = runReadAction { // bad: read action run in a constructor\n // read data\n }\n }\n\n private fun initMyData(): Data {\n return runWriteAction { // bad: invoked while initializing myData property\n // write data\n }\n }\n\n companion object {\n lateinit var companionData: String\n init {\n companionData = runReadAction { // bad: read action run in an init block\n // read data\n }\n }\n }\n}' Java: '@Service\nclass MyService {\n private static final Data ourData1 = ReadAction.compute(() -> {\n // read data\n });\n private static final Data ourData2;\n\n static {\n ourData2 = ReadAction.compute(() -> { // bad: read action in a static initialization block\n // read data\n });\n }\n\n private final Data myData2 = initMyData();\n\n MyService() {\n Data data = WriteAction.compute(() -> { // bad: read action run in a constructor\n // write data\n });\n }\n\n private Data initMyData() {\n return ReadAction.compute(() -> { // bad: invoked while initializing myData property\n // read data\n });\n }\n}' 'PersistentStateComponent': '@Service\n@State(...)\ninternal class MySettings : PersistentStateComponent {\n var stateValue: String? = null\n\n override fun loadState(state: MySettings) {\n val data = runReadAction { // bad: read action run in loadState\n // read data\n }\n // ...\n }\n\n override fun noStateLoaded() {\n val data = runWriteAction { // bad: read action run in noStateLoaded\n // write data\n }\n // ...\n }\n\n override fun initializeComponent() {\n val data = runReadAction { // bad: read action run in initializeComponent\n // read data\n }\n // ...\n }\n\n}' New in 2024.2 Inspection ID: PotentialDeadlockInServiceInitialization", + "markdown": "Reports read/write actions and `invokeAndWait` called from the scope of service initialization:\n\n* service constructors and initialization blocks (including static)\n* service companion object's initialization blocks (Kotlin)\n* service methods used in initialization blocks and fields initialization\n* `PersistentStateComponent` initialization lifecycle methods:\n * `loadState`\n * `noStateLoaded`\n * `initializeComponent`\n\nRunning a read/write action or calling `invokeAndWait` during service initialization may cause deadlocks.\n\n**Examples:**\n\nKotlin:\n\n\n @Service\n internal class MyService {\n private val myData = initMyData();\n\n constructor() {\n val data = runReadAction { // bad: read action run in a constructor\n // read data\n }\n }\n\n private fun initMyData(): Data {\n return runWriteAction { // bad: invoked while initializing myData property\n // write data\n }\n }\n\n companion object {\n lateinit var companionData: String\n init {\n companionData = runReadAction { // bad: read action run in an init block\n // read data\n }\n }\n }\n }\n\nJava:\n\n\n @Service\n class MyService {\n private static final Data ourData1 = ReadAction.compute(() -> {\n // read data\n });\n private static final Data ourData2;\n\n static {\n ourData2 = ReadAction.compute(() -> { // bad: read action in a static initialization block\n // read data\n });\n }\n\n private final Data myData2 = initMyData();\n\n MyService() {\n Data data = WriteAction.compute(() -> { // bad: read action run in a constructor\n // write data\n });\n }\n\n private Data initMyData() {\n return ReadAction.compute(() -> { // bad: invoked while initializing myData property\n // read data\n });\n }\n }\n\n`PersistentStateComponent`:\n\n\n @Service\n @State(...)\n internal class MySettings : PersistentStateComponent {\n var stateValue: String? = null\n\n override fun loadState(state: MySettings) {\n val data = runReadAction { // bad: read action run in loadState\n // read data\n }\n // ...\n }\n\n override fun noStateLoaded() {\n val data = runWriteAction { // bad: read action run in noStateLoaded\n // write data\n }\n // ...\n }\n\n override fun initializeComponent() {\n val data = runReadAction { // bad: read action run in initializeComponent\n // read data\n }\n // ...\n }\n\n }\n\nNew in 2024.2\n\nInspection ID: PotentialDeadlockInServiceInitialization" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "PotentialDeadlockInServiceInitialization", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncorrectCancellationExceptionHandling", + "shortDescription": { + "text": "Cancellation exception handled incorrectly" + }, + "fullDescription": { + "text": "Reports 'ProcessCanceledException' and 'CancellationException' handled incorrectly. 'ProcessCanceledException' and its inheritors must not be caught, swallowed, logged, or handled in any way. Instead, it must be rethrown so that the IntelliJ Platform infrastructure can handle it correctly. 'CancellationException' must not be caught, swallowed, logged, or handled in any way in coroutine context. Instead, it must be rethrown so that the coroutines infrastructure can handle it correctly. Inspection reports both explicit 'ProcessCanceledException' (including inheritors) and 'CancellationException'catching, as well as catching 'RuntimeException', 'Exception' and 'Throwable' covering cancellation exceptions. Examples: 'ProcessCanceledException': '// bad:\ntry {\n // ...\n} catch (ProcessCanceledException e) { // exception should not be swallowed\n}\n\n// bad:\ntry {\n // ...\n} catch (ProcessCanceledException e) {\n LOG.error(\"Error occurred\", e); // exception should not be logged\n throw e;\n}\n\n\n// good:\ntry {\n // ...\n} catch (ProcessCanceledException e) {\n // additional actions\n throw e;\n}' 'CancellationException': '// bad:\ncs.launch {\n try {\n // ...\n } catch (e: CancellationException) { // exception should not be swallowed\n }\n}\n\n// bad:\nsuspend fun suspendingFunction() {\n try {\n // ...\n } catch (ProcessCanceledException e) {\n LOG.error(\"Error occurred\", e); // exception should not be logged\n throw e;\n }\n}\n\n\n// good:\ncs.launch {\n try {\n // ...\n } catch (ProcessCanceledException e) {\n // additional actions\n throw e;\n }\n}' Inspection ID: IncorrectCancellationExceptionHandling New in 2023.2", + "markdown": "Reports `ProcessCanceledException` and `CancellationException` handled incorrectly.\n\n\n`ProcessCanceledException` and its inheritors must not be caught, swallowed, logged, or handled in any way.\nInstead, it must be rethrown so that the IntelliJ Platform infrastructure can handle it correctly.\n\n\n`CancellationException` must not be caught, swallowed, logged, or handled in any way in coroutine context.\nInstead, it must be rethrown so that the coroutines infrastructure can handle it correctly.\n\n\nInspection reports both explicit `ProcessCanceledException` (including inheritors) and `CancellationException`catching,\nas well as catching `RuntimeException`, `Exception` and `Throwable` covering cancellation exceptions.\n\n### Examples:\n\n#### `ProcessCanceledException`:\n\n\n // bad:\n try {\n // ...\n } catch (ProcessCanceledException e) { // exception should not be swallowed\n }\n\n // bad:\n try {\n // ...\n } catch (ProcessCanceledException e) {\n LOG.error(\"Error occurred\", e); // exception should not be logged\n throw e;\n }\n\n\n // good:\n try {\n // ...\n } catch (ProcessCanceledException e) {\n // additional actions\n throw e;\n }\n\n#### `CancellationException`:\n\n\n // bad:\n cs.launch {\n try {\n // ...\n } catch (e: CancellationException) { // exception should not be swallowed\n }\n }\n\n // bad:\n suspend fun suspendingFunction() {\n try {\n // ...\n } catch (ProcessCanceledException e) {\n LOG.error(\"Error occurred\", e); // exception should not be logged\n throw e;\n }\n }\n\n\n // good:\n cs.launch {\n try {\n // ...\n } catch (ProcessCanceledException e) {\n // additional actions\n throw e;\n }\n }\n\nInspection ID: IncorrectCancellationExceptionHandling\n\nNew in 2023.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "IncorrectCancellationExceptionHandling", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StatefulEp", + "shortDescription": { + "text": "Stateful extension" + }, + "fullDescription": { + "text": "Reports extensions and quick-fixes holding potentially leaking state. Keeping references to 'PsiElement', 'PsiReference', or 'Project' instances can result in memory leaks. Ideally, these should be stateless. For quick-fix, see 'LocalQuickFixOnPsiElement' as a convenient base class. Inspection ID: StatefulEp", + "markdown": "Reports extensions and quick-fixes holding potentially leaking state.\n\n\nKeeping references to `PsiElement`, `PsiReference`, or `Project` instances can result in memory leaks.\n\n\nIdeally, these should be stateless.\nFor quick-fix, see `LocalQuickFixOnPsiElement` as a convenient base class.\n\nInspection ID: StatefulEp" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "StatefulEp", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncorrectParentDisposable", + "shortDescription": { + "text": "Incorrect parentDisposable parameter" + }, + "fullDescription": { + "text": "Reports using 'Application' or 'Project' as a parent 'Disposable' in plugin code. Such usages will lead to plugins not being unloaded correctly. Please see Choosing a Disposable Parent in SDK Docs. Inspection ID: IncorrectParentDisposable", + "markdown": "Reports using `Application` or `Project` as a parent `Disposable` in plugin code.\n\n\nSuch usages will lead to plugins not being unloaded correctly.\nPlease see [Choosing a\nDisposable Parent](https://plugins.jetbrains.com/docs/intellij/disposers.html?from=IncorrectParentDisposable#choosing-a-disposable-parent) in SDK Docs.\n\nInspection ID: IncorrectParentDisposable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IncorrectParentDisposable", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ActionPresentationInstantiatedInCtor", + "shortDescription": { + "text": "Eager creation of action presentation" + }, + "fullDescription": { + "text": "Reports any actions that are registered in the 'plugin.xml' file and instantiate the 'com.intellij.openapi.actionSystem.Presentation' object in their constructors. Any of the constructors of 'AnAction' with parameters instantiate the 'Presentation' object. However, instantiating the 'Presentation' object in constructor results in allocating resources, which may not be necessary. Instead of creating an instance of 'Presentation' that stores text, description, or icon, it is more efficient to utilize no-argument constructors of 'AnAction' and other base classes and follow the convention for setting the text, description, and icon in 'plugin.xml'. The IDE will load text, description, and icon only when the action is actually displayed in the UI. The convention for setting the text, description, and icon is as follows: Set the 'id' attribute for the action in the 'plugin.xml' file. Optionally, set the 'icon' attribute if an icon is needed. Set the text and description in the associated message bundle (it could be overridden in ''): 'action..text=Translated Action Text' 'action..description=Translated Action Description' Bad example: '// NewKotlinFileAction.kt\n internal class NewKotlinFileAction : AnAction(\n KotlinBundle.message(\"action.new.file.text\"),\n KotlinBundle.message(\"action.new.file.description\"),\n KotlinIcons.FILE\n )' '' Good example: '// NewKotlinFileAction.kt\n internal class NewKotlinFileAction : AnAction()' '\n ' '# KotlinBundle.properties\n action.Kotlin.NewFile.text=Kotlin Class/File\n action.Kotlin.NewFile.description=Creates a new Kotlin class or file' Inspection ID: ActionPresentationInstantiatedInCtor New in 2023.2", + "markdown": "Reports any actions that are registered in the `plugin.xml` file and instantiate\nthe `com.intellij.openapi.actionSystem.Presentation` object in their constructors.\n\n\nAny of the constructors of `AnAction` with parameters instantiate the `Presentation`\nobject. However, instantiating the `Presentation` object in constructor results in allocating\nresources, which may not be necessary. Instead of creating an instance of `Presentation` that\nstores text, description, or icon, it is more efficient to utilize no-argument constructors of\n`AnAction` and other base classes and follow the convention for setting the text, description,\nand icon in `plugin.xml`. The IDE will load text, description, and icon only when the action\nis actually displayed in the UI.\n\n\nThe convention for setting the text, description, and icon is as follows:\n\n* Set the `id` attribute for the action in the `plugin.xml` file.\n* Optionally, set the `icon` attribute if an icon is needed.\n* Set the text and description in the associated message bundle (it could be overridden in ``):\n * `action..text=Translated Action Text`\n * `action..description=Translated Action Description`\n\n**Bad example:**\n\n\n // NewKotlinFileAction.kt\n internal class NewKotlinFileAction : AnAction(\n KotlinBundle.message(\"action.new.file.text\"),\n KotlinBundle.message(\"action.new.file.description\"),\n KotlinIcons.FILE\n )\n\n\n \n \n\n**Good example:**\n\n\n // NewKotlinFileAction.kt\n internal class NewKotlinFileAction : AnAction()\n\n\n \n \n \n\n\n # KotlinBundle.properties\n action.Kotlin.NewFile.text=Kotlin Class/File\n action.Kotlin.NewFile.description=Creates a new Kotlin class or file\n\nInspection ID: ActionPresentationInstantiatedInCtor\n\nNew in 2023.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ActionPresentationInstantiatedInCtor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TokenSetInParserDefinition", + "shortDescription": { + "text": "Non-platform TokenSet declared in ParserDefinition" + }, + "fullDescription": { + "text": "Reports 'TokenSet' field declarations referencing non-platform element types in 'ParserDefinition' classes. All languages 'ParserDefinition' are created on the application startup. Declaring a 'TokenSet' referencing non-platform language element types may cause creating and registering all the language element types in the holder class of the referenced type, even if a project doesn't contain any files in this language. Example: '// element types holder:\npublic interface MyLangTokenTypes {\n IElementType COMMENT = new MyLangTokenType(\"COMMENT\");\n IElementType TYPE1 = new MyLangTokenType(\"TYPE1\");\n IElementType TYPE2 = new MyLangTokenType(\"TYPE2\");\n // more types...\n}\n\n\n// bad:\n\npublic class MyLangParserDefinition implements ParserDefinition {\n // this field causes initializing and registering all the types from MyLangTokenTypes:\n private static final TokenSet COMMENTS = TokenSet.create(MyLangTokenTypes.COMMENT);\n\n @NotNull\n @Override\n public TokenSet getCommentTokens() {\n return COMMENTS;\n }\n ...\n}\n\n\n// good:\n\npublic final class MyLangTokenSets {\n public static final TokenSet COMMENTS = TokenSet.create(MyLangTokenTypes.COMMENT);\n}\n\npublic class MyLangParserDefinition implements ParserDefinition {\n @NotNull\n @Override\n public TokenSet getCommentTokens() {\n // types are referenced and registered only when this method is called:\n return MyLangTokenSets.COMMENTS;\n }\n ...\n}\n\n// good (Kotlin):\n\n// top-level declaration is not loaded until getCommentTokens() method is called:\nprivate val COMMENTS = TokenSet.create(MyLangTokenTypes.COMMENT);\n\nclass MyLangParserDefinition : ParserDefinition {\n override getCommentTokens(): TokenSet {\n return COMMENTS;\n }\n ...\n}\n\n// good:\n\npublic class MyLangParserDefinition implements ParserDefinition {\n // allowed platform TokenSet:\n private static final TokenSet COMMENTS1 = TokenSet.EMPTY;\n // allowed platform TokenType:\n private static final TokenSet COMMENTS2 = TokenSet.create(TokenType.WHITE_SPACE);\n\n @NotNull\n @Override\n public TokenSet getCommentTokens() {\n ...\n }\n ...\n}' New in 2023.2 Inspection ID: TokenSetInParserDefinition", + "markdown": "Reports `TokenSet` field declarations referencing non-platform element types in `ParserDefinition` classes.\n\n\nAll languages `ParserDefinition` are created on the application startup.\nDeclaring a `TokenSet` referencing non-platform language element types may cause creating and registering\nall the language element types in the holder class of the referenced type, even if a project doesn't contain any files in this language.\n\nExample:\n\n\n // element types holder:\n public interface MyLangTokenTypes {\n IElementType COMMENT = new MyLangTokenType(\"COMMENT\");\n IElementType TYPE1 = new MyLangTokenType(\"TYPE1\");\n IElementType TYPE2 = new MyLangTokenType(\"TYPE2\");\n // more types...\n }\n\n\n // bad:\n\n public class MyLangParserDefinition implements ParserDefinition {\n // this field causes initializing and registering all the types from MyLangTokenTypes:\n private static final TokenSet COMMENTS = TokenSet.create(MyLangTokenTypes.COMMENT);\n\n @NotNull\n @Override\n public TokenSet getCommentTokens() {\n return COMMENTS;\n }\n ...\n }\n\n\n // good:\n\n public final class MyLangTokenSets {\n public static final TokenSet COMMENTS = TokenSet.create(MyLangTokenTypes.COMMENT);\n }\n\n public class MyLangParserDefinition implements ParserDefinition {\n @NotNull\n @Override\n public TokenSet getCommentTokens() {\n // types are referenced and registered only when this method is called:\n return MyLangTokenSets.COMMENTS;\n }\n ...\n }\n\n // good (Kotlin):\n\n // top-level declaration is not loaded until getCommentTokens() method is called:\n private val COMMENTS = TokenSet.create(MyLangTokenTypes.COMMENT);\n\n class MyLangParserDefinition : ParserDefinition {\n override getCommentTokens(): TokenSet {\n return COMMENTS;\n }\n ...\n }\n\n // good:\n\n public class MyLangParserDefinition implements ParserDefinition {\n // allowed platform TokenSet:\n private static final TokenSet COMMENTS1 = TokenSet.EMPTY;\n // allowed platform TokenType:\n private static final TokenSet COMMENTS2 = TokenSet.create(TokenType.WHITE_SPACE);\n\n @NotNull\n @Override\n public TokenSet getCommentTokens() {\n ...\n }\n ...\n }\n\nNew in 2023.2\n\nInspection ID: TokenSetInParserDefinition" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TokenSetInParserDefinition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CompanionObjectInExtension", + "shortDescription": { + "text": "Companion object in extensions" + }, + "fullDescription": { + "text": "Reports incorrect companion objects' usage in extensions. Kotlin companion object is always created once you try to load its containing class, and extension point implementations are supposed to be cheap to create. Excessive classloading in plugins is a huge problem for IDE startup. Bad pattern: 'class KotlinDocumentationProvider : AbstractDocumentationProvider(), ExternalDocumentationProvider {\n\n companion object {\n private val LOG = Logger.getInstance(KotlinDocumentationProvider::class.java)\n private val javaDocumentProvider = JavaDocumentationProvider()\n }\n }' Here 'KotlinDocumentationProvider' is an extension registered in 'plugin.xml': '' In this example 'JavaDocumentationProvider' will be loaded from disk once someone just calls 'new KotlinDocumentationProvider()'. Kotlin companion objects in extension point implementation can only contain a logger and simple constants. Other declarations may cause excessive classloading or early initialization of heavy resources (e.g., 'TokenSet', Regex, etc.) when the extension class is loaded. Note that even declarations marked with '@JvmStatic' still produce an extra class for the companion object, potentially causing expensive computations. Instead of being stored in the companion object, these declarations must be top-level or stored in an object. FAQ How to rewrite run ConfigurationType? Move the declaration to top-level: '// DO, use top level fun\n internal fun mnRunConfigurationType(): MnRunConfigurationType = runConfigurationType()\n\n internal class MnRunConfigurationType : ConfigurationType {\n companion object { // DON'T\n fun getInstance(): MnRunConfigurationType = runConfigurationType()\n }\n ...' How to rewrite FileType? Before: 'internal class SpringBootImportsFileType : LanguageFileType(SPILanguage.INSTANCE, true) {\n companion object {\n val FILE_TYPE = SpringBootImportsFileType()\n ...' After: 'internal object SpringBootImportsFileType : LanguageFileType(SPILanguage.INSTANCE, true) {\n ...' Use 'INSTANCE' fieldName in 'plugin.xml': '' How to rewrite CounterUsagesCollector? Internal API Before: 'class AntActionsUsagesCollector : CounterUsagesCollector() {\n override fun getGroup(): EventLogGroup = GROUP\n\n companion object {\n private val GROUP = EventLogGroup(\"build.ant.actions\", 1)\n\n @JvmField\n val runSelectedBuildAction = GROUP.registerEvent(\"RunSelectedBuild\")\n }\n}' After: 'object AntActionsUsagesCollector : CounterUsagesCollector() {\n override fun getGroup(): EventLogGroup = GROUP\n\n private val GROUP = EventLogGroup(\"build.ant.actions\", 1)\n\n @JvmField\n val runSelectedBuildAction = GROUP.registerEvent(\"RunSelectedBuild\")\n}' New in 2023.3 Inspection ID: CompanionObjectInExtension", + "markdown": "Reports incorrect companion objects' usage in [extensions](https://plugins.jetbrains.com/docs/intellij/plugin-extensions.html).\n\n\nKotlin companion object is always created once you try to load its containing class, and extension point implementations are supposed to be cheap to create.\nExcessive classloading in plugins is a huge problem for IDE startup.\n\nBad pattern:\n\n\n class KotlinDocumentationProvider : AbstractDocumentationProvider(), ExternalDocumentationProvider {\n\n companion object {\n private val LOG = Logger.getInstance(KotlinDocumentationProvider::class.java)\n private val javaDocumentProvider = JavaDocumentationProvider()\n }\n }\n\n\nHere `KotlinDocumentationProvider` is an extension registered in `plugin.xml`:\n\n\n \n\n\nIn this example `JavaDocumentationProvider` will be loaded from disk once someone just calls `new KotlinDocumentationProvider()`.\n\n\nKotlin companion objects in extension point implementation can only contain a logger and simple constants.\nOther declarations may cause excessive classloading or early initialization of heavy resources (e.g., `TokenSet`, Regex, etc.)\nwhen the extension class is loaded.\nNote that even declarations marked with `@JvmStatic` still produce an extra class for the companion object, potentially causing expensive computations.\n\n\nInstead of being stored in the companion object, these declarations must be top-level or stored in an object.\n\n### FAQ\n\n#### How to rewrite run ConfigurationType?\n\nMove the declaration to top-level:\n\n\n // DO, use top level fun\n internal fun mnRunConfigurationType(): MnRunConfigurationType = runConfigurationType()\n\n internal class MnRunConfigurationType : ConfigurationType {\n companion object { // DON'T\n fun getInstance(): MnRunConfigurationType = runConfigurationType()\n }\n ...\n\n#### How to rewrite FileType?\n\nBefore:\n\n\n internal class SpringBootImportsFileType : LanguageFileType(SPILanguage.INSTANCE, true) {\n companion object {\n val FILE_TYPE = SpringBootImportsFileType()\n ...\n\nAfter:\n\n\n internal object SpringBootImportsFileType : LanguageFileType(SPILanguage.INSTANCE, true) {\n ...\n\nUse `INSTANCE` fieldName in `plugin.xml`:\n\n\n \n\n#### How to rewrite CounterUsagesCollector?\n\n##### Internal API\n\nBefore:\n\n\n class AntActionsUsagesCollector : CounterUsagesCollector() {\n override fun getGroup(): EventLogGroup = GROUP\n\n companion object {\n private val GROUP = EventLogGroup(\"build.ant.actions\", 1)\n\n @JvmField\n val runSelectedBuildAction = GROUP.registerEvent(\"RunSelectedBuild\")\n }\n }\n\nAfter:\n\n\n object AntActionsUsagesCollector : CounterUsagesCollector() {\n override fun getGroup(): EventLogGroup = GROUP\n\n private val GROUP = EventLogGroup(\"build.ant.actions\", 1)\n\n @JvmField\n val runSelectedBuildAction = GROUP.registerEvent(\"RunSelectedBuild\")\n }\n\nNew in 2023.3\n\nInspection ID: CompanionObjectInExtension" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CompanionObjectInExtension", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CanBeDumbAware", + "shortDescription": { + "text": "Can be DumbAware" + }, + "fullDescription": { + "text": "Reports API that can be made 'DumbAware'. If the implementation does not access indexes, it can be marked as working during dumb mode. See DumbAware API for more information. Add classes that have been verified not to be suitable to \"Ignore class list\". These will be skipped while avoiding adding a suppression comment/annotation. A quick-fix is available to add the reported class to this list. New in 2025.1 Inspection ID: CanBeDumbAware", + "markdown": "Reports API that can be made `DumbAware`.\n\n\nIf the implementation does not access indexes, it can be marked as working during dumb mode.\n\n\nSee [DumbAware API](https://plugins.jetbrains.com/docs/intellij/indexing-and-psi-stubs.html#DumbAwareAPI)\nfor more information.\n\n\nAdd classes that have been verified *not* to be suitable to \"Ignore class list\".\nThese will be skipped while avoiding adding a suppression comment/annotation.\nA quick-fix is available to add the reported class to this list.\n\nNew in 2025.1\n\nInspection ID: CanBeDumbAware" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CanBeDumbAware", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UsePlatformProcessAwaitExit", + "shortDescription": { + "text": "Use 'com.intellij.util.io.ProcessKt.awaitExit()'" + }, + "fullDescription": { + "text": "Reports usages of 'Process.waitFor()' and 'Process.onExit()' in coroutine context. Using these methods in coroutine context is forbidden. Use 'com.intellij.util.io.awaitExit()' instead. Example: 'suspend fun doSomething(process: Process) {\n val exitCode = process.waitFor() // bad\n // ...\n}\n\nsuspend fun doSomething(process: Process) {\n val exitCode = process.awaitExit() // good\n // ...\n}' New in 2023.3 Inspection ID: UsePlatformProcessAwaitExit", + "markdown": "Reports usages of `Process.waitFor()` and `Process.onExit()` in coroutine context. Using these methods in coroutine context is forbidden.\n\nUse `com.intellij.util.io.awaitExit()` instead.\n\nExample:\n\n\n suspend fun doSomething(process: Process) {\n val exitCode = process.waitFor() // bad\n // ...\n }\n\n suspend fun doSomething(process: Process) {\n val exitCode = process.awaitExit() // good\n // ...\n }\n\nNew in 2023.3\n\nInspection ID: UsePlatformProcessAwaitExit" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "UsePlatformProcessAwaitExit", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnknownIdInMetaInformation", + "shortDescription": { + "text": "Unknown inspection id in meta information" + }, + "fullDescription": { + "text": "Reports unknown inspection ids in 'metaInformation.json' files. It contains additional information about inspections declared in the current plugin. The presence of inspections in this file is optional. An example of such information is a list of corresponding CWE IDs. Entries in 'metaInformation.json' with unknown inspection ID will be ignored at runtime. The presence of such elements could be a bug or outdated information. Inspection ID: UnknownIdInMetaInformation", + "markdown": "Reports unknown inspection ids in `metaInformation.json` files. It contains additional information about inspections declared in the current plugin. The presence of inspections in this file is optional. An example of such information is a list of corresponding CWE IDs. Entries in `metaInformation.json` with unknown inspection ID will be ignored at runtime. The presence of such elements could be a bug or outdated information.\n\nInspection ID: UnknownIdInMetaInformation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "UnknownIdInMetaInformation", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit", + "index": 27, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SerializableCtor", + "shortDescription": { + "text": "Non-default constructor in serializable class" + }, + "fullDescription": { + "text": "Reports non-default constructor in serializable classes. The platform's 'IonObjectSerializer' requires specifying '@PropertyMapping' explicitly. Quick-fix generates necessary '@PropertyMapping' annotation for the constructor. Inspection ID: SerializableCtor", + "markdown": "Reports non-default constructor in serializable classes.\n\n\nThe platform's `IonObjectSerializer` requires specifying `@PropertyMapping` explicitly.\n\n\nQuick-fix generates necessary `@PropertyMapping` annotation for the constructor.\n\nInspection ID: SerializableCtor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SerializableCtor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PsiElementConcatenation", + "shortDescription": { + "text": "Using PsiElement string representation to generate new expression is incorrect" + }, + "fullDescription": { + "text": "Reports direct usage of 'PsiElement' and 'PsiType' in strings. When building strings for 'PsiJavaParserFacade.createExpressionFromText()' (or similar methods), 'PsiElement.getText()' should be used instead. Inspection ID: PsiElementConcatenation", + "markdown": "Reports direct usage of `PsiElement` and `PsiType` in strings.\n\n\nWhen building strings for `PsiJavaParserFacade.createExpressionFromText()` (or similar methods), `PsiElement.getText()` should be used\ninstead.\n\nInspection ID: PsiElementConcatenation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "PsiElementConcatenation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ComponentNotRegistered", + "shortDescription": { + "text": "Component/Action not registered" + }, + "fullDescription": { + "text": "Reports plugin components and actions that are not registered in a 'plugin.xml' descriptor. This eases developing new components when using the \"Create Class\" intention and helps keep track of potentially obsolete components. Provided quick-fix to register the component adds necessary registration in 'plugin.xml' descriptor. Configure the inspection: Use the Check Actions option to turn off the check for Actions, as they may be intentionally created and registered dynamically. Use the Ignore non-public classes option to ignore abstract and non-public classes. Inspection ID: ComponentNotRegistered", + "markdown": "Reports plugin components and actions that are not registered in a `plugin.xml` descriptor.\n\n\nThis eases developing new components when using the \"Create Class\" intention and helps keep track of potentially obsolete components.\n\n\nProvided quick-fix to register the component adds necessary registration in `plugin.xml` descriptor.\n\nConfigure the inspection:\n\n* Use the **Check Actions** option to turn off the check for Actions, as they may be intentionally created and registered dynamically.\n* Use the **Ignore non-public classes** option to ignore abstract and non-public classes.\n\nInspection ID: ComponentNotRegistered" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ComponentNotRegistered", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DevKitPropertiesMessageValidation", + "shortDescription": { + "text": "Message format validation in properties files" + }, + "fullDescription": { + "text": "Reports the following 'MessageFormat' problems in property values: Unknown format types 'MessageFormat' supports only these format types: number date time choice Other format types will be reported. Unpaired quotes 'property.key=Shouldn't happen: {0}' A single quote is interpreted as an escape until the end of the property, and will not be present in the result string. In most cases this is not what is intended. If a single quote should be present in the result string, it has to be duplicated in the property. Unmatched braces Every placeholder must have a closing brace. Too many quotes In some cases (e.g. 'it's'), it is expected that only one quote ends up in the result string. Cases where two or more quotes are placed together in the result string are reported. Incorrect lower bounds for nested 'ChoiceFormat' Lower bounds are expected to be numbers and to be sorted in ascending order. Wrong number of quotes around parameters In 'java.text.MessageFormat' patterns single quotes are used for escaping. To keep quotes visible, they must be duplicated. For example when passing '1': ''{0}'' → '{0}' '''{0}''' → ''1'' When using choice format, nested formats are evaluated as format strings themselves, and quotes will need to be duplicated twice. For example when passing '1': '{0, choice, 0#no|1#''{0}'' files}' → '{0} files' '{0, choice, 0#no|1#''''{0}'''' files}' → ''1' files' Note Property values are verified only if they contain the literal text '{0}', '{0,', '{1}' or '{1,'. This is to make sure that these property values are actually used as 'MessageFormat' patterns. New in 2023.2 Inspection ID: DevKitPropertiesMessageValidation", + "markdown": "Reports the following `MessageFormat` problems in property values:\n\n**Unknown format types**\n\n\n`MessageFormat` supports only these format types:\n\n* number\n* date\n* time\n* choice\n\nOther format types will be reported.\n\n**Unpaired quotes**\n\n\n property.key=Shouldn't happen: {0}\n\n\nA single quote is interpreted as an escape until the end of the property, and will not be present in the result string.\nIn most cases this is not what is intended.\nIf a single quote should be present in the result string, it has to be duplicated in the property.\n\n**Unmatched braces**\n\n\nEvery placeholder must have a closing brace.\n\n**Too many quotes**\n\n\nIn some cases (e.g. `it's`), it is expected that only one quote ends up in the result string.\nCases where two or more quotes are placed together in the result string are reported.\n\n**Incorrect lower bounds for nested `ChoiceFormat`**\n\n\nLower bounds are expected to be numbers and to be sorted in ascending order.\n\n**Wrong number of quotes around parameters**\n\n\nIn `java.text.MessageFormat` patterns single quotes are used for escaping.\nTo keep quotes visible, they must be duplicated.\nFor example when passing `1`:\n\n* `'{0}'` → `{0}`\n* `''{0}''` → `'1'`\n\n\nWhen using choice format, nested formats are evaluated as format strings themselves, and quotes will need to be duplicated twice.\nFor example when passing `1`:\n\n* `{0, choice, 0#no|1#''{0}'' files}` → `{0} files`\n* `{0, choice, 0#no|1#''''{0}'''' files}` → `'1' files`\n\n**Note**\n\n\nProperty values are verified only if they contain the literal text `{0}`, `{0,`, `{1}` or `{1,`.\nThis is to make sure that these property values are actually used as `MessageFormat` patterns.\n\nNew in 2023.2\n\nInspection ID: DevKitPropertiesMessageValidation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DevKitPropertiesMessageValidation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit", + "index": 27, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "checkedExceptions", + "shortDescription": { + "text": "Unchecked exceptions in Kotlin" + }, + "fullDescription": { + "text": "Checked exceptions in Kotlin This inspection works only for methods annotated with 'com.intellij.openapi.ThrowsChecked'. The inspection tries to find cases when an annotated function is called, but the exception is not caught. Differences from Java's checked exceptions: This inspection produces warnings and doesn't break compilation. By design, it's fine to suppress the exception. The inspection should not try to prove in every case that some exception is not caught. It's supposed only to remind API users about exceptions. Inspection ID: checkedExceptions", + "markdown": "Checked exceptions in Kotlin\n============================\n\nThis inspection works only for methods annotated with `com.intellij.openapi.ThrowsChecked`.\n\nThe inspection tries to find cases when an annotated function is called, but the exception is not caught.\n\nDifferences from Java's checked exceptions:\n\n* This inspection produces warnings and doesn't break compilation.\n* By design, it's fine to suppress the exception.\n* The inspection should not try to prove in every case that some exception is not caught. It's supposed only to remind API users about exceptions.\n\nInspection ID: checkedExceptions" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "checkedExceptions", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnsafeReturnStatementVisitor", + "shortDescription": { + "text": "Unsafe return statements visitor" + }, + "fullDescription": { + "text": "Reports unsafe use of 'JavaRecursiveElementVisitor.visitReturnStatement()'. Processing 'PsiReturnStatement's even if they belong to another 'PsiClass' or 'PsiLambdaExpression' is a bug in most cases, and a visitor most probably should implement 'visitClass()' and 'visitLambdaExpression()' methods. Inspection ID: UnsafeReturnStatementVisitor", + "markdown": "Reports unsafe use of `JavaRecursiveElementVisitor.visitReturnStatement()`.\n\n\nProcessing `PsiReturnStatement`s\neven if they belong to another `PsiClass` or `PsiLambdaExpression` is a bug in most cases, and a visitor most\nprobably should implement `visitClass()` and `visitLambdaExpression()` methods.\n\nInspection ID: UnsafeReturnStatementVisitor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnsafeReturnStatementVisitor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnresolvedPluginConfigReference", + "shortDescription": { + "text": "Unresolved plugin configuration reference" + }, + "fullDescription": { + "text": "Reports unresolved references to plugin configuration elements. Extensions Referencing extension with an unknown 'id' might result in errors at runtime. The following extension points are supported: 'com.intellij.advancedSetting' in resource bundle 'advanced.setting.*' key 'com.intellij.experimentalFeature' in 'Experiments.isFeatureEnabled()/setFeatureEnabled()' 'com.intellij.notificationGroup' in 'Notification' constructor and 'NotificationGroupManager.getNotificationGroup()' 'com.intellij.registryKey' in 'Registry' methods 'key' parameter 'com.intellij.toolWindow' in resource bundle 'toolwindow.stripe.*' key Extension Point Extension point name referencing its corresponding '' declaration in 'plugin.xml'. 'com.intellij.openapi.extensions.ExtensionPointName' constructor and 'create()' 'com.intellij.openapi.extensions.ProjectExtensionPointName' constructor 'com.intellij.openapi.util.KeyedExtensionCollector' and inheritors constructor Action/Group Referencing '' or '' 'id' declared in 'plugin.xml'. Inspection ID: UnresolvedPluginConfigReference", + "markdown": "Reports unresolved references to plugin configuration elements.\n\n#### Extensions\n\n\nReferencing extension with an unknown `id` might result in errors at runtime.\n\n\nThe following extension points are supported:\n\n* `com.intellij.advancedSetting` in resource bundle `advanced.setting.*` key\n* `com.intellij.experimentalFeature` in `Experiments.isFeatureEnabled()/setFeatureEnabled()`\n* `com.intellij.notificationGroup` in `Notification` constructor and `NotificationGroupManager.getNotificationGroup()`\n* `com.intellij.registryKey` in `Registry` methods `key` parameter\n* `com.intellij.toolWindow` in resource bundle `toolwindow.stripe.*` key\n\n#### Extension Point\n\n\nExtension point name referencing its corresponding `` declaration in `plugin.xml`.\n\n* `com.intellij.openapi.extensions.ExtensionPointName` constructor and `create()`\n* `com.intellij.openapi.extensions.ProjectExtensionPointName` constructor\n* `com.intellij.openapi.util.KeyedExtensionCollector` and inheritors constructor\n\n#### Action/Group\n\n\nReferencing `` or `` `id` declared in `plugin.xml`.\n\nInspection ID: UnresolvedPluginConfigReference" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "UnresolvedPluginConfigReference", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseDPIAwareInsets", + "shortDescription": { + "text": "Use DPI-aware insets" + }, + "fullDescription": { + "text": "Reports usages of 'java.awt.Insets' and 'JBUI.insetsXyz()' that can be simplified. The 'Insets' instances are not DPI-aware and can result in UI layout problems. Quick fix performs replacement with 'JBUI.insets()' or simplifies the expression. Example: '// bad:\nInsets insets1 = new Insets(1, 2, 3, 4);\nInsets insets2 = new Insets(1, 2, 1, 2);\nInsets insets3 = new Insets(1, 0, 0, 0);\n\n// good:\nInsets insets1 = JBUI.insets(1, 2, 3, 4);\nInsets insets2 = JBUI.insets(1, 2);\nInsets insets3 = JBUI.insetsTop(1);' Inspection ID: UseDPIAwareInsets", + "markdown": "Reports usages of `java.awt.Insets` and `JBUI.insetsXyz()` that can be simplified.\n\n\nThe `Insets` instances are not DPI-aware and can result in UI layout problems.\n\n\nQuick fix performs replacement with `JBUI.insets()` or simplifies the expression.\n\nExample:\n\n\n // bad:\n Insets insets1 = new Insets(1, 2, 3, 4);\n Insets insets2 = new Insets(1, 2, 1, 2);\n Insets insets3 = new Insets(1, 0, 0, 0);\n\n // good:\n Insets insets1 = JBUI.insets(1, 2, 3, 4);\n Insets insets2 = JBUI.insets(1, 2);\n Insets insets3 = JBUI.insetsTop(1);\n\nInspection ID: UseDPIAwareInsets" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseDPIAwareInsets", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ThreadingConcurrency", + "shortDescription": { + "text": "Threading and concurrency problems" + }, + "fullDescription": { + "text": "Reports threading and concurrency issues in code using information from 'com.intellij.util.concurrency.annotations' annotations. Work in progress. Enable options below to check '@Requires(Read|Write)Lock' inside '@RequiresEdt' blocks. Additionally, non-overriding public methods having not all annotations present can be highlighted + quickfix to add missing annotations. New in 2023.2 Inspection ID: ThreadingConcurrency", + "markdown": "Reports threading and concurrency issues in code using information from `com.intellij.util.concurrency.annotations` annotations.\n\n\n**Work in progress**.\nEnable options below to check `@Requires(Read|Write)Lock` inside `@RequiresEdt` blocks. Additionally, non-overriding public methods having not all annotations present can be highlighted + quickfix to add missing annotations.\n\nNew in 2023.2\n\nInspection ID: ThreadingConcurrency" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "ThreadingConcurrency", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UndesirableClassUsage", + "shortDescription": { + "text": "Undesirable class usage" + }, + "fullDescription": { + "text": "Reports usages of undesirable classes (mostly Swing components). Quick-fix offers replacement with recommended IntelliJ Platform replacement. Inspection ID: UndesirableClassUsage", + "markdown": "Reports usages of undesirable classes (mostly Swing components).\n\n\nQuick-fix offers replacement with recommended IntelliJ Platform replacement.\n\nInspection ID: UndesirableClassUsage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UndesirableClassUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CallingMethodShouldBeRequiresBlockingContext", + "shortDescription": { + "text": "Calling method should be annotated with @RequiresBlockingContext" + }, + "fullDescription": { + "text": "Highlights calls of method annotated with '@RequiresBlockingMethod' inside non-annotated method. The calling method should be also annotated with '@RequiresBlockingMethod' to clearly state its contract. Inspection ID: CallingMethodShouldBeRequiresBlockingContext", + "markdown": "Highlights calls of method annotated with `@RequiresBlockingMethod` inside non-annotated method.\nThe calling method should be also annotated with `@RequiresBlockingMethod` to clearly state its contract.\n\nInspection ID: CallingMethodShouldBeRequiresBlockingContext" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "CallingMethodShouldBeRequiresBlockingContext", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InspectionDescriptionNotFoundInspection", + "shortDescription": { + "text": "Inspection description checker" + }, + "fullDescription": { + "text": "Reports inspections that are missing an HTML description file, i.e. a file containing a text like this. The Create description file quick-fix creates a template HTML description file. Inspection ID: InspectionDescriptionNotFoundInspection", + "markdown": "Reports inspections that are missing an HTML description file, i.e. a file containing a text like this.\n\n\nThe **Create description file** quick-fix creates a template HTML description file.\n\nInspection ID: InspectionDescriptionNotFoundInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "InspectionDescriptionNotFoundInspection", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Description file", + "index": 109, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PluginXmlValidity", + "shortDescription": { + "text": "Plugin.xml validity" + }, + "fullDescription": { + "text": "Reports problems in 'plugin.xml'. Invalid configuration can lead to problems at runtime. Inspection ID: PluginXmlValidity", + "markdown": "Reports problems in `plugin.xml`.\n\n\nInvalid configuration can lead to problems at runtime.\n\nInspection ID: PluginXmlValidity" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "PluginXmlValidity", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Plugin descriptor", + "index": 28, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LeakableMapKey", + "shortDescription": { + "text": "Map key may leak" + }, + "fullDescription": { + "text": "Reports using 'Language' or 'FileType' as a map key in plugin code. Such usages might lead to inability to unload the plugin properly. Please consider using 'String' as keys instead. See Dynamic Plugins in SDK Docs for more information. Inspection ID: LeakableMapKey", + "markdown": "Reports using `Language` or `FileType` as a map key in plugin code.\n\n\nSuch usages might lead to inability to unload the plugin properly.\n\n\nPlease consider using `String` as keys instead.\n\n\nSee [Dynamic\nPlugins](https://plugins.jetbrains.com/docs/intellij/dynamic-plugins.html) in SDK Docs for more information.\n\nInspection ID: LeakableMapKey" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LeakableMapKey", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "PostfixTemplateDescriptionNotFound", + "shortDescription": { + "text": "Postfix template description checker" + }, + "fullDescription": { + "text": "Reports postfix templates missing an HTML description file, 'before.template' file or 'after.template' file. These are shown in Settings | Editor | General | Postfix Completion. The Create description file quick-fix creates a template HTML description file. See Postfix Templates in IntelliJ Platform Plugin SDK docs for more details. Inspection ID: PostfixTemplateDescriptionNotFound", + "markdown": "Reports postfix templates missing an HTML description file, `before.template` file or `after.template` file. These are shown in [Settings \\| Editor \\| General \\| Postfix Completion](settings://reference.settingsdialog.IDE.editor.postfix.templates).\n\n\nThe **Create description file** quick-fix creates a template HTML description file.\n\n\nSee [Postfix Templates](https://plugins.jetbrains.com/docs/intellij/postfix-templates.html#postfix-template-description)\nin IntelliJ Platform Plugin SDK docs for more details.\n\nInspection ID: PostfixTemplateDescriptionNotFound" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "PostfixTemplateDescriptionNotFound", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Description file", + "index": 109, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnsafeVfsRecursion", + "shortDescription": { + "text": "Unsafe VFS recursion" + }, + "fullDescription": { + "text": "Reports usage of 'VirtualFile.getChildren()' inside recursive methods. This may cause endless loops when iterating over cyclic symlinks. Use 'VfsUtilCore.visitChildrenRecursively()' instead. 'void processDirectory(VirtualFile dir) {\n for (VirtualFile file : dir.getChildren()) { // bad\n if (!file.isDirectory()) {\n processFile(file);\n } else {\n processDirectory(file); // recursive call\n }\n }\n}'\n 'void processDirectory(VirtualFile dir) {\n VfsUtilCore.visitChildrenRecursively(dir, new VirtualFileVisitor() { // good\n @Override\n public boolean visitFile(@NotNull VirtualFile file) {\n if (!file.isDirectory()) {\n processFile(file);\n }\n return true;\n }\n });\n}' Inspection ID: UnsafeVfsRecursion", + "markdown": "Reports usage of `VirtualFile.getChildren()` inside recursive methods.\n\n\nThis may cause endless loops when iterating over cyclic symlinks.\nUse `VfsUtilCore.visitChildrenRecursively()` instead.\n\n\n void processDirectory(VirtualFile dir) {\n for (VirtualFile file : dir.getChildren()) { // bad\n if (!file.isDirectory()) {\n processFile(file);\n } else {\n processDirectory(file); // recursive call\n }\n }\n }\n\n\n void processDirectory(VirtualFile dir) {\n VfsUtilCore.visitChildrenRecursively(dir, new VirtualFileVisitor() { // good\n @Override\n public boolean visitFile(@NotNull VirtualFile file) {\n if (!file.isDirectory()) {\n processFile(file);\n }\n return true;\n }\n });\n }\n\nInspection ID: UnsafeVfsRecursion" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnsafeVfsRecursion", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ListenerImplementationMustNotBeDisposable", + "shortDescription": { + "text": "Listener implementation implements 'Disposable'" + }, + "fullDescription": { + "text": "Reports listener implementations that implement 'com.intellij.openapi.Disposable'. Listener implementations must be stateless and must not implement life-cycle, including 'com.intellij.openapi.Disposable'. See documentation for more information. New in 2023.3 Inspection ID: ListenerImplementationMustNotBeDisposable", + "markdown": "Reports listener implementations that implement `com.intellij.openapi.Disposable`.\n\n\nListener implementations must be stateless and must not implement life-cycle, including `com.intellij.openapi.Disposable`.\n\n\nSee [documentation](https://plugins.jetbrains.com/docs/intellij/plugin-listeners.html) for more information.\n\nNew in 2023.3\n\nInspection ID: ListenerImplementationMustNotBeDisposable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "ListenerImplementationMustNotBeDisposable", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "KotlinObjectRegisteredAsExtension", + "shortDescription": { + "text": "Kotlin object registered as extension" + }, + "fullDescription": { + "text": "Reports Kotlin objects that are registered as plugin extensions. Extensions lifecycle is managed by the IntelliJ Platform. Using Kotlin objects for extension registration may cause creation of unnecessary extension instances and make plugin unloading impossible. Example Extension registration: '' Extension implementation: '// bad:\nobject MyAnnotator : Annotator {\n ...\n}\n\n// good:\nclass MyAnnotator : Annotator {\n ...\n}' New in 2023.1 Inspection ID: KotlinObjectRegisteredAsExtension", + "markdown": "Reports Kotlin objects that are registered as plugin extensions.\n\n\nExtensions lifecycle is managed by the IntelliJ Platform.\nUsing Kotlin objects for extension registration may cause creation of unnecessary extension instances and make plugin unloading\nimpossible.\n\nExample\n-------\n\nExtension registration:\n\n\n \n\nExtension implementation:\n\n\n // bad:\n object MyAnnotator : Annotator {\n ...\n }\n\n // good:\n class MyAnnotator : Annotator {\n ...\n }\n\nNew in 2023.1\n\nInspection ID: KotlinObjectRegisteredAsExtension" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "KotlinObjectRegisteredAsExtension", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FileEqualsUsage", + "shortDescription": { + "text": "File.equals() usage" + }, + "fullDescription": { + "text": "Reports usages of 'java.io.File.equals()/hashCode()/compareTo()' methods. These do not honor case-insensitivity on macOS. Use 'com.intellij.openapi.util.io.FileUtil.filesEquals()/fileHashCode()/compareFiles()' methods instead. Inspection ID: FileEqualsUsage", + "markdown": "Reports usages of `java.io.File.equals()/hashCode()/compareTo()` methods.\n\n\nThese do not honor case-insensitivity on macOS.\n\n\nUse `com.intellij.openapi.util.io.FileUtil.filesEquals()/fileHashCode()/compareFiles()` methods instead.\n\nInspection ID: FileEqualsUsage" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FileEqualsUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Code", + "index": 34, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WorkspaceImplAbsent", + "shortDescription": { + "text": "Generate implementation" + }, + "fullDescription": { + "text": "Reports absent of implementation for the entity. Verifies that each entity in the project has the implementation. Suggests generation implementation for the whole entities in the current module. Inspection ID: WorkspaceImplAbsent", + "markdown": "Reports absent of implementation for the entity.\n\n\nVerifies that each entity in the project has the implementation.\n\n\nSuggests generation implementation for the whole entities in the current module.\n\nInspection ID: WorkspaceImplAbsent" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "WorkspaceImplAbsent", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Plugin DevKit/Workspace model", + "index": 55, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij", + "version": "252.28459", + "rules": [ + { + "id": "HtmlUnknownBooleanAttribute", + "shortDescription": { + "text": "Incorrect boolean attribute" + }, + "fullDescription": { + "text": "Reports an HTML non-boolean attribute without a value. Suggests configuring attributes that should not be reported. Inspection ID: HtmlUnknownBooleanAttribute", + "markdown": "Reports an HTML non-boolean attribute without a value. Suggests configuring attributes that should not be reported.\n\nInspection ID: HtmlUnknownBooleanAttribute" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlUnknownBooleanAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InconsistentLineSeparators", + "shortDescription": { + "text": "Inconsistent line separators" + }, + "fullDescription": { + "text": "Reports files with line separators different from the ones that are specified in the project's settings. For example, the inspection will be triggered if you set the line separator to '\\n' in Settings | Editor | Code Style | Line separator, while the file you are editing uses '\\r\\n' as a line separator. The inspection also warns you about mixed line separators within a file. Inspection ID: InconsistentLineSeparators", + "markdown": "Reports files with line separators different from the ones that are specified in the project's settings.\n\nFor example, the inspection will be triggered if you set the line separator to `\\n` in\n[Settings \\| Editor \\| Code Style \\| Line separator](settings://preferences.sourceCode?Line%20separator),\nwhile the file you are editing uses `\\r\\n` as a line separator.\n\nThe inspection also warns you about mixed line separators within a file.\n\nInspection ID: InconsistentLineSeparators" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InconsistentLineSeparators", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantSuppression", + "shortDescription": { + "text": "Redundant suppression" + }, + "fullDescription": { + "text": "Reports usages of the following elements that can be safely removed because the inspection they affect is no longer applicable in this context: '@SuppressWarning' annotation, or '// noinspection' line comment, or '/** noinspection */' JavaDoc comment Example: 'public class C {\n // symbol is already private,\n // but annotation is still around\n @SuppressWarnings({\"WeakerAccess\"})\n private boolean CONST = true;\n void f() {\n CONST = false;\n }\n}' Inspection ID: RedundantSuppression", + "markdown": "Reports usages of the following elements that can be safely removed because the inspection they affect is no longer applicable in this context:\n\n* `@SuppressWarning` annotation, or\n* `// noinspection` line comment, or\n* `/** noinspection */` JavaDoc comment\n\nExample:\n\n\n public class C {\n // symbol is already private,\n // but annotation is still around\n @SuppressWarnings({\"WeakerAccess\"})\n private boolean CONST = true;\n void f() {\n CONST = false;\n }\n }\n\nInspection ID: RedundantSuppression" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantSuppression", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ProblematicWhitespace", + "shortDescription": { + "text": "Problematic whitespace" + }, + "fullDescription": { + "text": "Reports the following problems: Tabs used for indentation when the code style is configured to use only spaces. Spaces used for indentation when the code style is configured to use only tabs. Spaces used for indentation and tabs used for alignment when the code style is configured to use smart tabs. Inspection ID: ProblematicWhitespace", + "markdown": "Reports the following problems:\n\n* Tabs used for indentation when the code style is configured to use only spaces.\n* Spaces used for indentation when the code style is configured to use only tabs.\n* Spaces used for indentation and tabs used for alignment when the code style is configured to use smart tabs.\n\n\nInspection ID: ProblematicWhitespace" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ProblematicWhitespace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlUnknownTarget", + "shortDescription": { + "text": "Unresolved file in a link" + }, + "fullDescription": { + "text": "Reports an unresolved file in a link. Inspection ID: HtmlUnknownTarget", + "markdown": "Reports an unresolved file in a link.\n\nInspection ID: HtmlUnknownTarget" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlUnknownTarget", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LongLine", + "shortDescription": { + "text": "Line is longer than allowed by code style" + }, + "fullDescription": { + "text": "Reports lines that are longer than the Hard wrap at parameter specified in Settings | Editor | Code Style | General. Inspection ID: LongLine", + "markdown": "Reports lines that are longer than the **Hard wrap at** parameter specified in [Settings \\| Editor \\| Code Style \\| General](settings://preferences.sourceCode?Hard%20wrap%20at).\n\nInspection ID: LongLine" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LongLine", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlWrongRootElement", + "shortDescription": { + "text": "Wrong root element" + }, + "fullDescription": { + "text": "Reports a root tag name different from the name specified in the '' tag. Inspection ID: XmlWrongRootElement", + "markdown": "Reports a root tag name different from the name specified in the `` tag.\n\nInspection ID: XmlWrongRootElement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlWrongRootElement", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlUnknownAttribute", + "shortDescription": { + "text": "Unknown attribute" + }, + "fullDescription": { + "text": "Reports an unknown HTML attribute. Suggests configuring attributes that should not be reported. Inspection ID: HtmlUnknownAttribute", + "markdown": "Reports an unknown HTML attribute. Suggests configuring attributes that should not be reported.\n\nInspection ID: HtmlUnknownAttribute" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlUnknownAttribute", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpRedundantEscape", + "shortDescription": { + "text": "Redundant character escape" + }, + "fullDescription": { + "text": "Reports redundant character escape sequences that can be replaced with unescaped characters preserving the meaning. Many escape sequences that are necessary outside of a character class are redundant inside square brackets '[]' of a character class. Although unescaped opening curly braces '{' outside of character classes are allowed in some dialects (JavaScript, Python, and so on), it can cause confusion and make the pattern less portable, because there are dialects that require escaping curly braces as characters. For this reason the inspection does not report escaped opening curly braces. Example: '\\-\\;[\\.]' After the quick-fix is applied: '-;[.]' The Ignore escaped closing brackets '}' and ']' option specifies whether to report '\\}' and '\\]' outside of a character class when they are allowed to be unescaped by the RegExp dialect. New in 2017.3 Inspection ID: RegExpRedundantEscape", + "markdown": "Reports redundant character escape sequences that can be replaced with unescaped characters preserving the meaning. Many escape sequences that are necessary outside of a character class are redundant inside square brackets `[]` of a character class.\n\n\nAlthough unescaped opening curly braces `{` outside of character classes are allowed in some dialects (JavaScript, Python, and so on),\nit can cause confusion and make the pattern less portable, because there are dialects that require escaping curly braces as characters.\nFor this reason the inspection does not report escaped opening curly braces.\n\n**Example:**\n\n\n \\-\\;[\\.]\n\nAfter the quick-fix is applied:\n\n\n -;[.]\n\n\nThe **Ignore escaped closing brackets '}' and '\\]'** option specifies whether to report `\\}` and `\\]` outside of a character class\nwhen they are allowed to be unescaped by the RegExp dialect.\n\nNew in 2017.3\n\nInspection ID: RegExpRedundantEscape" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpRedundantEscape", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CustomRegExpInspection", + "shortDescription": { + "text": "Custom RegExp inspection" + }, + "fullDescription": { + "text": "Custom Regex Inspection Inspection ID: CustomRegExpInspection", + "markdown": "Custom Regex Inspection\n\nInspection ID: CustomRegExpInspection" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "CustomRegExpInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncorrectFormatting", + "shortDescription": { + "text": "Incorrect formatting" + }, + "fullDescription": { + "text": "Reports formatting issues that appear if your code doesn't follow your project's code style settings. This inspection is not compatible with languages that require third-party formatters for code formatting, for example, Go or C with CLangFormat enabled. Inspection ID: IncorrectFormatting", + "markdown": "Reports formatting issues that appear if your code doesn't\nfollow your project's code style settings.\n\n\nThis inspection is not compatible with languages that require\nthird-party formatters for code formatting, for example, Go or\nC with CLangFormat enabled.\n\nInspection ID: IncorrectFormatting" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "IncorrectFormatting", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlExtraClosingTag", + "shortDescription": { + "text": "Redundant closing tag" + }, + "fullDescription": { + "text": "Reports redundant closing tags on empty elements, for example, 'img' or 'br'. Example: '\n \n

\n \n ' After the quick-fix is applied: '\n \n
\n \n ' Inspection ID: HtmlExtraClosingTag", + "markdown": "Reports redundant closing tags on empty elements, for example, `img` or `br`.\n\n**Example:**\n\n\n \n \n

\n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n
\n \n \n\nInspection ID: HtmlExtraClosingTag" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlExtraClosingTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpUnexpectedAnchor", + "shortDescription": { + "text": "Begin or end anchor in unexpected position" + }, + "fullDescription": { + "text": "Reports '^' or '\\A' anchors not at the beginning of the pattern and '$', '\\Z' or '\\z' anchors not at the end of the pattern. In the wrong position these RegExp anchors prevent the pattern from matching anything. In case of the '^' and '$' anchors, most likely the literal character was meant and the escape forgotten. Example: '(Price $10)' New in 2018.1 Inspection ID: RegExpUnexpectedAnchor", + "markdown": "Reports `^` or `\\A` anchors not at the beginning of the pattern and `$`, `\\Z` or `\\z` anchors not at the end of the pattern. In the wrong position these RegExp anchors prevent the pattern from matching anything. In case of the `^` and `$` anchors, most likely the literal character was meant and the escape forgotten.\n\n**Example:**\n\n\n (Price $10)\n\n\nNew in 2018.1\n\nInspection ID: RegExpUnexpectedAnchor" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpUnexpectedAnchor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SpellCheckingInspection", + "shortDescription": { + "text": "Typo" + }, + "fullDescription": { + "text": "Reports typos and misspellings in your code, comments, and literals and fixes them with one click. Inspection ID: SpellCheckingInspection", + "markdown": "Reports typos and misspellings in your code, comments, and literals and fixes them with one click.\n\nInspection ID: SpellCheckingInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "SpellCheckingInspection", + "ideaSeverity": "TYPO", + "qodanaSeverity": "Low", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Proofreading", + "index": 96, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckXmlFileWithXercesValidator", + "shortDescription": { + "text": "Failed external validation" + }, + "fullDescription": { + "text": "Reports a discrepancy in an XML file with the specified DTD or schema detected by the Xerces validator. Inspection ID: CheckXmlFileWithXercesValidator", + "markdown": "Reports a discrepancy in an XML file with the specified DTD or schema detected by the Xerces validator.\n\nInspection ID: CheckXmlFileWithXercesValidator" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CheckXmlFileWithXercesValidator", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlUnknownTag", + "shortDescription": { + "text": "Unknown tag" + }, + "fullDescription": { + "text": "Reports an unknown HTML tag. Suggests configuring tags that should not be reported. Inspection ID: HtmlUnknownTag", + "markdown": "Reports an unknown HTML tag. Suggests configuring tags that should not be reported.\n\nInspection ID: HtmlUnknownTag" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlUnknownTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpEscapedMetaCharacter", + "shortDescription": { + "text": "Escaped meta character" + }, + "fullDescription": { + "text": "Reports escaped meta characters. Some RegExp coding styles specify that meta characters should be placed inside a character class, to make the regular expression easier to understand. This inspection does not warn about the meta character '[', ']' and '^', because those would need additional escaping inside a character class. Example: '\\d+\\.\\d+' After the quick-fix is applied: '\\d+[.]\\d+' New in 2017.1 Inspection ID: RegExpEscapedMetaCharacter", + "markdown": "Reports escaped meta characters. Some RegExp coding styles specify that meta characters should be placed inside a character class, to make the regular expression easier to understand. This inspection does not warn about the meta character `[`, `]` and `^`, because those would need additional escaping inside a character class.\n\n**Example:**\n\n\n \\d+\\.\\d+\n\nAfter the quick-fix is applied:\n\n\n \\d+[.]\\d+\n\nNew in 2017.1\n\nInspection ID: RegExpEscapedMetaCharacter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RegExpEscapedMetaCharacter", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlHighlighting", + "shortDescription": { + "text": "XML highlighting" + }, + "fullDescription": { + "text": "Reports XML validation problems in the results of a batch code inspection. Inspection ID: XmlHighlighting", + "markdown": "Reports XML validation problems in the results of a batch code inspection.\n\nInspection ID: XmlHighlighting" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlHighlighting", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlDuplicatedId", + "shortDescription": { + "text": "Duplicate 'id' attribute" + }, + "fullDescription": { + "text": "Reports a duplicate values of the 'id' attribute in XML and HTML. Inspection ID: XmlDuplicatedId", + "markdown": "Reports a duplicate values of the `id` attribute in XML and HTML.\n\nInspection ID: XmlDuplicatedId" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlDuplicatedId", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpDuplicateCharacterInClass", + "shortDescription": { + "text": "Duplicate character in character class" + }, + "fullDescription": { + "text": "Reports duplicate characters inside a RegExp character class. Duplicate characters are unnecessary and can be removed without changing the semantics of the regex. Example: '[aabc]' After the quick-fix is applied: '[abc]' Inspection ID: RegExpDuplicateCharacterInClass", + "markdown": "Reports duplicate characters inside a RegExp character class. Duplicate characters are unnecessary and can be removed without changing the semantics of the regex.\n\n**Example:**\n\n\n [aabc]\n\nAfter the quick-fix is applied:\n\n\n [abc]\n\nInspection ID: RegExpDuplicateCharacterInClass" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpDuplicateCharacterInClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlUnboundNsPrefix", + "shortDescription": { + "text": "Unbound namespace prefix" + }, + "fullDescription": { + "text": "Reports an unbound namespace prefix in XML. Inspection ID: XmlUnboundNsPrefix", + "markdown": "Reports an unbound namespace prefix in XML.\n\nInspection ID: XmlUnboundNsPrefix" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XmlUnboundNsPrefix", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RequiredAttributes", + "shortDescription": { + "text": "Missing required attribute" + }, + "fullDescription": { + "text": "Reports a missing mandatory attribute in an XML/HTML tag. Suggests configuring attributes that should not be reported. Inspection ID: RequiredAttributes", + "markdown": "Reports a missing mandatory attribute in an XML/HTML tag. Suggests configuring attributes that should not be reported.\n\nInspection ID: RequiredAttributes" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RequiredAttributes", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlUnusedNamespaceDeclaration", + "shortDescription": { + "text": "Unused schema declaration" + }, + "fullDescription": { + "text": "Reports an unused namespace declaration or location hint in XML. Inspection ID: XmlUnusedNamespaceDeclaration", + "markdown": "Reports an unused namespace declaration or location hint in XML.\n\nInspection ID: XmlUnusedNamespaceDeclaration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XmlUnusedNamespaceDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpRedundantClassElement", + "shortDescription": { + "text": "Redundant '\\d', '[:digit:]', or '\\D' class elements" + }, + "fullDescription": { + "text": "Reports redundant '\\d' or '[:digit:]' that are used in one class with '\\w' or '[:word:]' ('\\D' with '\\W') and can be removed. Example: '[\\w\\d]' After the quick-fix is applied: '[\\w]' New in 2022.2 Inspection ID: RegExpRedundantClassElement", + "markdown": "Reports redundant `\\d` or `[:digit:]` that are used in one class with `\\w` or `[:word:]` (`\\D` with `\\W`) and can be removed.\n\n**Example:**\n\n\n [\\w\\d]\n\nAfter the quick-fix is applied:\n\n\n [\\w]\n\nNew in 2022.2\n\nInspection ID: RegExpRedundantClassElement" + }, + "defaultConfiguration": { + "enabled": true, + "level": "note", + "parameters": { + "suppressToolId": "RegExpRedundantClassElement", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpSimplifiable", + "shortDescription": { + "text": "Regular expression can be simplified" + }, + "fullDescription": { + "text": "Reports regular expressions that can be simplified. Example: '[a] xx* [ah-hz]' After the quick-fix is applied: 'a x+ [ahz]' New in 2022.1 Inspection ID: RegExpSimplifiable", + "markdown": "Reports regular expressions that can be simplified.\n\n**Example:**\n\n\n [a] xx* [ah-hz]\n\nAfter the quick-fix is applied:\n\n\n a x+ [ahz]\n\nNew in 2022.1\n\nInspection ID: RegExpSimplifiable" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RegExpSimplifiable", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpEmptyAlternationBranch", + "shortDescription": { + "text": "Empty branch in alternation" + }, + "fullDescription": { + "text": "Reports empty branches in a RegExp alternation. An empty branch will only match the empty string, and in most cases that is not what is desired. This inspection will not report a single empty branch at the start or the end of an alternation. Example: '(alpha||bravo)' After the quick-fix is applied: '(alpha|bravo)' New in 2017.2 Inspection ID: RegExpEmptyAlternationBranch", + "markdown": "Reports empty branches in a RegExp alternation. An empty branch will only match the empty string, and in most cases that is not what is desired. This inspection will not report a single empty branch at the start or the end of an alternation.\n\n**Example:**\n\n\n (alpha||bravo)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo)\n\nNew in 2017.2\n\nInspection ID: RegExpEmptyAlternationBranch" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpEmptyAlternationBranch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlPathReference", + "shortDescription": { + "text": "Unresolved file reference" + }, + "fullDescription": { + "text": "Reports an unresolved file reference in XML. Inspection ID: XmlPathReference", + "markdown": "Reports an unresolved file reference in XML.\n\nInspection ID: XmlPathReference" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlPathReference", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpUnnecessaryNonCapturingGroup", + "shortDescription": { + "text": "Unnecessary non-capturing group" + }, + "fullDescription": { + "text": "Reports unnecessary non-capturing groups, which have no influence on the match result. Example: 'Everybody be cool, (?:this) is a robbery!' After the quick-fix is applied: 'Everybody be cool, this is a robbery!' New in 2021.1 Inspection ID: RegExpUnnecessaryNonCapturingGroup", + "markdown": "Reports unnecessary non-capturing groups, which have no influence on the match result.\n\n**Example:**\n\n\n Everybody be cool, (?:this) is a robbery!\n\nAfter the quick-fix is applied:\n\n\n Everybody be cool, this is a robbery!\n\nNew in 2021.1\n\nInspection ID: RegExpUnnecessaryNonCapturingGroup" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpUnnecessaryNonCapturingGroup", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TodoComment", + "shortDescription": { + "text": "TODO comment" + }, + "fullDescription": { + "text": "Reports TODO comments in your code. You can configure the format for TODO comments in Settings | Editor | TODO. Enable the Only warn on TODO comments without any details option to only warn on empty TODO comments, that don't provide any description on the task that should be done. Disable to report all TODO comments. Inspection ID: TodoComment", + "markdown": "Reports **TODO** comments in your code.\n\nYou can configure the format for **TODO** comments in [Settings \\| Editor \\| TODO](settings://preferences.toDoOptions).\n\nEnable the **Only warn on TODO comments without any details** option to only warn on empty TODO comments, that\ndon't provide any description on the task that should be done. Disable to report all TODO comments.\n\nInspection ID: TodoComment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TodoComment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlWrongAttributeValue", + "shortDescription": { + "text": "Wrong attribute value" + }, + "fullDescription": { + "text": "Reports an incorrect HTML attribute value. Inspection ID: HtmlWrongAttributeValue", + "markdown": "Reports an incorrect HTML attribute value.\n\nInspection ID: HtmlWrongAttributeValue" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlWrongAttributeValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlDefaultAttributeValue", + "shortDescription": { + "text": "Redundant attribute with default value" + }, + "fullDescription": { + "text": "Reports a redundant assignment of the default value to an XML attribute. Inspection ID: XmlDefaultAttributeValue", + "markdown": "Reports a redundant assignment of the default value to an XML attribute.\n\nInspection ID: XmlDefaultAttributeValue" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XmlDefaultAttributeValue", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EmptyDirectory", + "shortDescription": { + "text": "Empty directory" + }, + "fullDescription": { + "text": "Reports empty directories. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Only report empty directories located under a source folder option to have only directories under source roots reported. Inspection ID: EmptyDirectory", + "markdown": "Reports empty directories.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Only report empty directories located under a source folder** option to have only directories under source\nroots reported.\n\n\nInspection ID: EmptyDirectory" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EmptyDirectory", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckDtdRefs", + "shortDescription": { + "text": "Unresolved DTD reference" + }, + "fullDescription": { + "text": "Reports inconsistency in a DTD-specific reference, for example, in a reference to an XML entity or to a DTD element declaration. Works in DTD an XML files. Inspection ID: CheckDtdRefs", + "markdown": "Reports inconsistency in a DTD-specific reference, for example, in a reference to an XML entity or to a DTD element declaration. Works in DTD an XML files.\n\nInspection ID: CheckDtdRefs" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CheckDtdRefs", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NonAsciiCharacters", + "shortDescription": { + "text": "Non-ASCII characters" + }, + "fullDescription": { + "text": "Reports code elements that use non-ASCII symbols in an unusual context. Example: Non-ASCII characters used in identifiers, strings, or comments. Identifiers written in different languages, such as 'myСollection' with the letter 'C' written in Cyrillic. Comments or strings containing Unicode symbols, such as long dashes and arrows. Inspection ID: NonAsciiCharacters", + "markdown": "Reports code elements that use non-ASCII symbols in an unusual context.\n\nExample:\n\n* Non-ASCII characters used in identifiers, strings, or comments.\n* Identifiers written in different languages, such as `my`**С**`ollection` with the letter **C** written in Cyrillic.\n* Comments or strings containing Unicode symbols, such as long dashes and arrows.\n\nInspection ID: NonAsciiCharacters" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NonAsciiCharacters", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Internationalization", + "index": 115, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LossyEncoding", + "shortDescription": { + "text": "Lossy encoding" + }, + "fullDescription": { + "text": "Reports characters that cannot be displayed because of the current document encoding. Examples: If you type international characters in a document with the US-ASCII charset, some characters will be lost on save. If you load a UTF-8-encoded file using the ISO-8859-1 one-byte charset, some characters will be displayed incorrectly. You can fix this by changing the file encoding either by specifying the encoding directly in the file, e.g. by editing 'encoding=' attribute in the XML prolog of XML file, or by changing the corresponding options in Settings | Editor | File Encodings. Inspection ID: LossyEncoding", + "markdown": "Reports characters that cannot be displayed because of the current document encoding.\n\nExamples:\n\n* If you type international characters in a document with the **US-ASCII** charset, some characters will be lost on save.\n* If you load a **UTF-8** -encoded file using the **ISO-8859-1** one-byte charset, some characters will be displayed incorrectly.\n\nYou can fix this by changing the file encoding\neither by specifying the encoding directly in the file, e.g. by editing `encoding=` attribute in the XML prolog of XML file,\nor by changing the corresponding options in **Settings \\| Editor \\| File Encodings**.\n\nInspection ID: LossyEncoding" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LossyEncoding", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Internationalization", + "index": 115, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IgnoreFileDuplicateEntry", + "shortDescription": { + "text": "Ignore file duplicates" + }, + "fullDescription": { + "text": "Reports duplicate entries (patterns) in the ignore file (e.g. .gitignore, .hgignore). Duplicate entries in these files are redundant and can be removed. Example: '# Output directories\n /out/\n /target/\n /out/' Inspection ID: IgnoreFileDuplicateEntry", + "markdown": "Reports duplicate entries (patterns) in the ignore file (e.g. .gitignore, .hgignore). Duplicate entries in these files are redundant and can be removed.\n\nExample:\n\n\n # Output directories\n /out/\n /target/\n /out/\n\nInspection ID: IgnoreFileDuplicateEntry" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IgnoreFileDuplicateEntry", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Version control", + "index": 119, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SSBasedInspection", + "shortDescription": { + "text": "Structural search inspection" + }, + "fullDescription": { + "text": "Allows configuring Structural Search/Structural Replace templates that you can apply to the file you are editing. All matches will be highlighted and marked with the template name that you have configured. If you configure the Structural Replace pattern as well, the corresponding replace option will be available as a quick-fix. Inspection ID: SSBasedInspection", + "markdown": "Allows configuring **Structural Search/Structural Replace** templates that you can apply to the file you are editing.\n\nAll matches will be highlighted and marked with the template name that you have configured.\nIf you configure the **Structural Replace** pattern as well, the corresponding replace option will be available as a quick-fix.\n\nInspection ID: SSBasedInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SSBasedInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Structural search", + "index": 122, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckValidXmlInScriptTagBody", + "shortDescription": { + "text": "Malformed content of 'script' tag" + }, + "fullDescription": { + "text": "Reports contents of 'script' tags that are invalid XML. Example: '' After the quick-fix is applied: '' Inspection ID: CheckValidXmlInScriptTagBody", + "markdown": "Reports contents of `script` tags that are invalid XML. \n\n**Example:**\n\n\n \n\nAfter the quick-fix is applied:\n\n\n \n\nInspection ID: CheckValidXmlInScriptTagBody" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "CheckValidXmlInScriptTagBody", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpSuspiciousBackref", + "shortDescription": { + "text": "Suspicious back reference" + }, + "fullDescription": { + "text": "Reports back references that will not be resolvable at runtime. This means that the back reference can never match anything. A back reference will not be resolvable when the group is defined after the back reference, or if the group is defined in a different branch of an alternation. Example of a group defined after its back reference: '\\1(abc)' Example of a group and a back reference in different branches: 'a(b)c|(xy)\\1z' New in 2022.1 Inspection ID: RegExpSuspiciousBackref", + "markdown": "Reports back references that will not be resolvable at runtime. This means that the back reference can never match anything. A back reference will not be resolvable when the group is defined after the back reference, or if the group is defined in a different branch of an alternation.\n\n**Example of a group defined after its back reference:**\n\n\n \\1(abc)\n\n**Example of a group and a back reference in different branches:**\n\n\n a(b)c|(xy)\\1z\n\nNew in 2022.1\n\nInspection ID: RegExpSuspiciousBackref" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpSuspiciousBackref", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpSingleCharAlternation", + "shortDescription": { + "text": "Single character alternation" + }, + "fullDescription": { + "text": "Reports single char alternation in a RegExp. It is simpler to use a character class instead. This may also provide better matching performance. Example: 'a|b|c|d' After the quick-fix is applied: '[abcd]' New in 2017.1 Inspection ID: RegExpSingleCharAlternation", + "markdown": "Reports single char alternation in a RegExp. It is simpler to use a character class instead. This may also provide better matching performance.\n\n**Example:**\n\n\n a|b|c|d\n\nAfter the quick-fix is applied:\n\n\n [abcd]\n\n\nNew in 2017.1\n\nInspection ID: RegExpSingleCharAlternation" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpSingleCharAlternation", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckTagEmptyBody", + "shortDescription": { + "text": "Empty element content" + }, + "fullDescription": { + "text": "Reports XML elements without contents. Example: '\n \n ' After the quick-fix is applied: '\n \n ' Inspection ID: CheckTagEmptyBody", + "markdown": "Reports XML elements without contents.\n\n**Example:**\n\n\n \n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n \n\nInspection ID: CheckTagEmptyBody" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CheckTagEmptyBody", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnresolvedReference", + "shortDescription": { + "text": "Unresolved reference" + }, + "fullDescription": { + "text": "Reports an unresolved reference to a named pattern ('define') in RELAX-NG files that use XML syntax. Suggests creating the referenced 'define' element. Inspection ID: UnresolvedReference", + "markdown": "Reports an unresolved reference to a named pattern (`define`) in RELAX-NG files that use XML syntax. Suggests creating the referenced `define` element.\n\nInspection ID: UnresolvedReference" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "UnresolvedReference", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "RELAX NG", + "index": 124, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlMissingClosingTag", + "shortDescription": { + "text": "Missing closing tag" + }, + "fullDescription": { + "text": "Reports an HTML element without a closing tag. Some coding styles require that HTML elements have closing tags even where this is optional. Example: '\n \n

Behold!\n \n ' After the quick-fix is applied: '\n \n

Behold!

\n \n ' Inspection ID: HtmlMissingClosingTag", + "markdown": "Reports an HTML element without a closing tag. Some coding styles require that HTML elements have closing tags even where this is optional.\n\n**Example:**\n\n\n \n \n

Behold!\n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n

Behold!

\n \n \n\nInspection ID: HtmlMissingClosingTag" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "HtmlMissingClosingTag", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HtmlUnknownAnchorTarget", + "shortDescription": { + "text": "Unresolved fragment in a link" + }, + "fullDescription": { + "text": "Reports an unresolved last part of an URL after the '#' sign. Inspection ID: HtmlUnknownAnchorTarget", + "markdown": "Reports an unresolved last part of an URL after the `#` sign.\n\nInspection ID: HtmlUnknownAnchorTarget" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HtmlUnknownAnchorTarget", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlInvalidId", + "shortDescription": { + "text": "Unresolved 'id' reference" + }, + "fullDescription": { + "text": "Reports the use of the 'id' that is not defined anywhere in XML and HTML. Inspection ID: XmlInvalidId", + "markdown": "Reports the use of the `id` that is not defined anywhere in XML and HTML.\n\nInspection ID: XmlInvalidId" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlInvalidId", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ReassignedToPlainText", + "shortDescription": { + "text": "Reassigned to plain text" + }, + "fullDescription": { + "text": "Reports files that were explicitly re-assigned to Plain Text File Type. This association is unnecessary because the platform auto-detects text files by content automatically. You can dismiss this warning by removing the file type association in Settings | Editor | File Types | Text. Inspection ID: ReassignedToPlainText", + "markdown": "Reports files that were explicitly re-assigned to Plain Text File Type. This association is unnecessary because the platform auto-detects text files by content automatically.\n\nYou can dismiss this warning by removing the file type association\nin **Settings \\| Editor \\| File Types \\| Text**.\n\nInspection ID: ReassignedToPlainText" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ReassignedToPlainText", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Annotator", + "shortDescription": { + "text": "Annotator" + }, + "fullDescription": { + "text": "Reports issues essential to this file (e.g., syntax errors) in the result of a batch code inspection run. These issues are usually always highlighted in the editor and can't be configured, unlike inspections. These options control the scope of checks performed by this inspection: Option \"Report syntax errors\": report parser-related issues. Option \"Report issues from language-specific annotators\": report issues found by annotators configured for the relevant language. See Custom Language Support: Annotators for details. Option \"Report other highlighting problems\": report issues specific to the language of the current file (e.g., type mismatches or unreported exceptions). See Custom Language Support: Highlighting for details. Inspection ID: Annotator", + "markdown": "Reports issues essential to this file (e.g., syntax errors) in the result of a batch code inspection run. These issues are usually always highlighted in the editor and can't be configured, unlike inspections. These options control the scope of checks performed by this inspection:\n\n* Option \"**Report syntax errors**\": report parser-related issues.\n* Option \"**Report issues from language-specific annotators** \": report issues found by annotators configured for the relevant language. See [Custom Language Support: Annotators](https://plugins.jetbrains.com/docs/intellij/annotator.html) for details.\n* Option \"**Report other highlighting problems** \": report issues specific to the language of the current file (e.g., type mismatches or unreported exceptions). See [Custom Language Support: Highlighting](https://plugins.jetbrains.com/docs/intellij/syntax-highlighting-and-error-highlighting.html#semantic-highlighting) for details.\n\nInspection ID: Annotator" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "Annotator", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlDeprecatedElement", + "shortDescription": { + "text": "Deprecated symbol" + }, + "fullDescription": { + "text": "Reports a deprecated XML element or attribute. Symbols can be marked by XML comment or documentation tag with text 'deprecated'. Inspection ID: XmlDeprecatedElement", + "markdown": "Reports a deprecated XML element or attribute.\n\nSymbols can be marked by XML comment or documentation tag with text 'deprecated'.\n\nInspection ID: XmlDeprecatedElement" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "XmlDeprecatedElement", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpRedundantNestedCharacterClass", + "shortDescription": { + "text": "Redundant nested character class" + }, + "fullDescription": { + "text": "Reports unnecessary nested character classes. Example: '[a-c[x-z]]' After the quick-fix is applied: '[a-cx-z]' New in 2020.2 Inspection ID: RegExpRedundantNestedCharacterClass", + "markdown": "Reports unnecessary nested character classes.\n\n**Example:**\n\n\n [a-c[x-z]]\n\nAfter the quick-fix is applied:\n\n\n [a-cx-z]\n\nNew in 2020.2\n\nInspection ID: RegExpRedundantNestedCharacterClass" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpRedundantNestedCharacterClass", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpOctalEscape", + "shortDescription": { + "text": "Octal escape" + }, + "fullDescription": { + "text": "Reports octal escapes, which are easily confused with back references. Use hexadecimal escapes to avoid confusion. Example: '\\07' After the quick-fix is applied: '\\x07' New in 2017.1 Inspection ID: RegExpOctalEscape", + "markdown": "Reports octal escapes, which are easily confused with back references. Use hexadecimal escapes to avoid confusion.\n\n**Example:**\n\n\n \\07\n\nAfter the quick-fix is applied:\n\n\n \\x07\n\nNew in 2017.1\n\nInspection ID: RegExpOctalEscape" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "RegExpOctalEscape", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedDefine", + "shortDescription": { + "text": "Unused define" + }, + "fullDescription": { + "text": "Reports an unused named pattern ('define') in a RELAX-NG file (XML or Compact Syntax). 'define' elements that are used through an include in another file are ignored. Inspection ID: UnusedDefine", + "markdown": "Reports an unused named pattern (`define`) in a RELAX-NG file (XML or Compact Syntax). `define` elements that are used through an include in another file are ignored.\n\nInspection ID: UnusedDefine" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedDefine", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "RELAX NG", + "index": 124, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpAnonymousGroup", + "shortDescription": { + "text": "Anonymous capturing group or numeric back reference" + }, + "fullDescription": { + "text": "Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. '(?:xxx)' instead of '(xxx)'. Example: '(\\d\\d\\d\\d)\\1' A better regex pattern could look like this: '(?\\d\\d\\d\\d)\\k' New in 2017.2 Inspection ID: RegExpAnonymousGroup", + "markdown": "Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. `(?:xxx)` instead of `(xxx)`.\n\n**Example:**\n\n\n (\\d\\d\\d\\d)\\1\n\nA better regex pattern could look like this:\n\n\n (?\\d\\d\\d\\d)\\k\n\nNew in 2017.2\n\nInspection ID: RegExpAnonymousGroup" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpAnonymousGroup", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "XmlUnresolvedReference", + "shortDescription": { + "text": "Unresolved references" + }, + "fullDescription": { + "text": "Reports an unresolved references in XML. Inspection ID: XmlUnresolvedReference", + "markdown": "Reports an unresolved references in XML.\n\nInspection ID: XmlUnresolvedReference" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "XmlUnresolvedReference", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "XML", + "index": 63, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpRepeatedSpace", + "shortDescription": { + "text": "Consecutive spaces" + }, + "fullDescription": { + "text": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier. Example: '( )' After the quick-fix is applied: '( {5})' New in 2017.1 Inspection ID: RegExpRepeatedSpace", + "markdown": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier.\n\n**Example:**\n\n\n ( )\n\nAfter the quick-fix is applied:\n\n\n ( {5})\n\n\nNew in 2017.1\n\nInspection ID: RegExpRepeatedSpace" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpRepeatedSpace", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RegExpDuplicateAlternationBranch", + "shortDescription": { + "text": "Duplicate branch in alternation" + }, + "fullDescription": { + "text": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression. Example: '(alpha|bravo|charlie|alpha)' After the quick-fix is applied: '(alpha|bravo|charlie)' New in 2017.1 Inspection ID: RegExpDuplicateAlternationBranch", + "markdown": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression.\n\n**Example:**\n\n\n (alpha|bravo|charlie|alpha)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo|charlie)\n\nNew in 2017.1\n\nInspection ID: RegExpDuplicateAlternationBranch" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RegExpDuplicateAlternationBranch", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "RegExp", + "index": 84, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CheckEmptyScriptTag", + "shortDescription": { + "text": "Empty tag" + }, + "fullDescription": { + "text": "Reports empty tags that do not work in some browsers. Example: '\n \n ' Inspection ID: CheckEmptyScriptTag", + "markdown": "Reports empty tags that do not work in some browsers.\n\n**Example:**\n\n\n \n \n \n\nInspection ID: CheckEmptyScriptTag" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CheckEmptyScriptTag", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "HTML", + "index": 30, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.java-i18n", + "version": "252.28459.0", + "rules": [ + { + "id": "UnusedMessageFormatParameter", + "shortDescription": { + "text": "Missing message format parameter" + }, + "fullDescription": { + "text": "Reports properties values that look like 'java.text.MessageFormat' format strings but do not use some the parameters of the '{xx}' kind. Example: '# parameter {0} is not used\nerror.message=Something happened in line {1}' Inspection ID: UnusedMessageFormatParameter", + "markdown": "Reports properties values that look like `java.text.MessageFormat` format strings but do not use some the parameters of the `{xx}` kind.\n\nExample:\n\n\n # parameter {0} is not used\n error.message=Something happened in line {1}\n \nInspection ID: UnusedMessageFormatParameter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedMessageFormatParameter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertToBasicLatin", + "shortDescription": { + "text": "Non-Basic Latin character" + }, + "fullDescription": { + "text": "Reports non-Basic Latin characters in literals and comments. The inspection provides a fix to replace such characters with Unicode escapes in literals, and with HTML entities in comments. Example: '// © 2021\n char c = '©';\n String s = \"Áî\";'\n After the quick-fix is applied: '// © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";' By default, this inspection does not highlight in the editor, but only provides a fix. Inspection ID: ConvertToBasicLatin", + "markdown": "Reports non-Basic Latin characters in literals and comments. The inspection provides a fix to replace such characters with Unicode escapes in literals, and with HTML entities in comments.\n\n**Example:**\n\n\n // © 2021\n char c = '©';\n String s = \"Áî\";\n\nAfter the quick-fix is applied:\n\n\n // © 2021\n char c = '\\u00a9';\n String s = \"\\u00c1\\u00ee\";\n\nBy default, this inspection does not highlight in the editor, but only provides a fix.\n\nInspection ID: ConvertToBasicLatin" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ConvertToBasicLatin", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InconsistentResourceBundle", + "shortDescription": { + "text": "Inconsistent resource bundle" + }, + "fullDescription": { + "text": "Reports problems in the properties files contained in the resource bundle. Report missing translations Use this option to report properties contained in the parent properties file that are missing in inherited ones (unless it's a language dialect). Example: '# messages.properties\n abc=xxx\n\n # messages_fr.properties\n # Empty file' Property 'abc' will be reported as untranslated. Report inconsistent properties Use this option to report properties contained in inherited properties file that are missing in the parent one (or in siblings if there is no parent). Example: '# messages.properties\n # Empty file\n\n # messages_fr.properties\n abc=xxx' Property 'abc' translation is not available here for any language except French, and, thus, will be reported as missing in the (default) properties file 'messages.properties'. Report properties overridden with the same value Use this option to report properties copy-pasted into several properties files verbatim. Example: '# messages.properties\n abc=xxx\n\n # messages_fr.properties\n abc=xxx' Property 'abc' will be reported as unnecessarily inherited in the file 'messages_fr.properties' . Report properties overridden with different placeholders Use this option to check for placeholder consistency in overridden properties. Example: '# messages.properties\n qwe={0}xxx{1}\n abc={0}yyy{1}\n\n # messages_fr.properties\n qwe={0}xxx{0}xxx{1}\n abc={0}yyy' Property 'abc' will be reported as a property containing message format placeholders not corresponding to 'messages.properties'. Report properties overridden with different values endings Use this option to check for ending consistency in overridden properties. Example: '# messages.properties\n abc=xxxzzz\n\n # messages_fr.properties\n abc=xxx;' Property 'abc' will be reported as ending with special signs ('!' / '?' / '.' / ':' / ';') whereas the parent value in 'messages.properties' doesn't. Inspection ID: InconsistentResourceBundle", + "markdown": "Reports problems in the properties files contained in the resource bundle.\n\n* **Report missing translations** \n\n Use this option to report properties contained in the parent properties file that are missing in inherited ones (unless it's a language dialect). \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n # Empty file\n \n Property `abc` will be reported as untranslated. \n\n* **Report inconsistent properties** \n\n Use this option to report properties contained in inherited properties file that are missing in the parent one (or in siblings if there is no parent). \n\n Example:\n\n\n # messages.properties\n # Empty file\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` translation is not available here for any language except French, and, thus, will be reported as missing in the (default) properties file `messages.properties`. \n\n* **Report properties overridden with the same value** \n\n Use this option to report properties copy-pasted into several properties files verbatim. \n\n Example:\n\n\n # messages.properties\n abc=xxx\n\n # messages_fr.properties\n abc=xxx\n \n Property `abc` will be reported as unnecessarily inherited in the file `messages_fr.properties` . \n\n* **Report properties overridden with different placeholders** \n\n Use this option to check for placeholder consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n qwe={0}xxx{1}\n abc={0}yyy{1}\n\n # messages_fr.properties\n qwe={0}xxx{0}xxx{1}\n abc={0}yyy\n \n Property `abc` will be reported as a property containing message format placeholders not corresponding to `messages.properties`. \n\n* **Report properties overridden with different values endings** \n\n Use this option to check for ending consistency in overridden properties. \n\n Example:\n\n\n # messages.properties\n abc=xxxzzz\n\n # messages_fr.properties\n abc=xxx;\n \n Property `abc` will be reported as ending with special signs (`!` / `?` / `.` / `:` / `;`) whereas the parent value in `messages.properties` doesn't.\n\nInspection ID: InconsistentResourceBundle" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "InconsistentResourceBundle", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "HardCodedStringLiteral", + "shortDescription": { + "text": "Hardcoded strings" + }, + "fullDescription": { + "text": "Reports any instances of hardcoded 'String' literals. Hardcoded 'String' literals are probably errors in an internationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available to transform a string literal into a 'java.util.ResourceBundle.getString()' method call. Inspection ID: HardCodedStringLiteral", + "markdown": "Reports any instances of hardcoded `String` literals.\n\nHardcoded `String` literals are probably errors in an\ninternationalized environment. This inspection won't report empty strings and strings consisting only of whitespaces. A quick-fix is available\nto transform a string literal into a `java.util.ResourceBundle.getString()` method call.\n\nInspection ID: HardCodedStringLiteral" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "HardCodedStringLiteral", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnsupportedCharacter", + "shortDescription": { + "text": "Unsupported character" + }, + "fullDescription": { + "text": "Reports characters in property files that are unsupported by the ISO-8859-1 charset when Java 1.8 or earlier is used. The inspection checks if a property file contains characters that cannot be mapped to ISO-8859-1 and suggests converting them to Unicode escape sequences for compatibility. Configure the inspection: Use the Convert to escape sequences quick-fix to ensure compatibility with ISO-8859-1 encoding: Example: 'key=Java + ☕ = 🍀' After the quick-fix is applied: 'key=Java + \\u2615 = \\uD83C\\uDF40' Inspection ID: UnsupportedCharacter", + "markdown": "Reports characters in property files that are unsupported by the ISO-8859-1 charset when Java 1.8 or earlier is used. The inspection checks if a property file contains characters that cannot be mapped to ISO-8859-1 and suggests converting them to Unicode escape sequences for compatibility.\n\nConfigure the inspection:\n\n\nUse the **Convert to escape sequences** quick-fix to ensure compatibility with ISO-8859-1 encoding:\n\n**Example:**\n\n\n key=Java + ☕ = 🍀\n\nAfter the quick-fix is applied:\n\n\n key=Java + \\u2615 = \\uD83C\\uDF40\n\nInspection ID: UnsupportedCharacter" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "UnsupportedCharacter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Properties files", + "index": 120, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DialogTitleCapitalization", + "shortDescription": { + "text": "Incorrect string capitalization" + }, + "fullDescription": { + "text": "Reports strings in method parameters and return values annotated with '@Nls' and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines. Example: 'void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\");' After the quick-fix is applied: 'setTitle(\"This Is Sentence Capitalization but Should Be Title\");' Inspection ID: DialogTitleCapitalization", + "markdown": "Reports strings in method parameters and return values annotated with `@Nls` and having the capitalization parameter to conform to capitalization rules existing in most platform UI guidelines.\n\n**Example:**\n\n\n void setTitle(@NlsContexts.DialogTitle String title) {}\n setTitle(\"This is sentence capitalization but should be title\"); \n\nAfter the quick-fix is applied:\n\n\n setTitle(\"This Is Sentence Capitalization but Should Be Title\"); \n\nInspection ID: DialogTitleCapitalization" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DialogTitleCapitalization", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnresolvedPropertyKey", + "shortDescription": { + "text": "Invalid property key" + }, + "fullDescription": { + "text": "Reports invalid arguments that are passed to methods with parameters annotated as '@PropertyKey'. These arguments should be valid property keys in corresponding properties files. Also, the inspection verifies that the 'resourceBundle' argument of the '@PropertyKey' annotation is an existing resource bundle. Use the quick-fix to create a new property or to select an existing one. Example: '@PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";' Inspection ID: UnresolvedPropertyKey", + "markdown": "Reports invalid arguments that are passed to methods with parameters annotated as `@PropertyKey`.\n\nThese arguments should be valid property keys in corresponding properties files.\nAlso, the inspection verifies that the `resourceBundle`\nargument of the `@PropertyKey` annotation is an existing resource bundle.\n\n\nUse the quick-fix to create a new property or to select an existing one.\n\nExample:\n\n\n @PropertyKey(resourceBundle = \"myBundle\") String value = \"invalid.key\";\n\nInspection ID: UnresolvedPropertyKey" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "UnresolvedPropertyKey", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Properties files", + "index": 120, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuspiciousLocalesLanguages", + "shortDescription": { + "text": "Suspicious resource bundle locale languages" + }, + "fullDescription": { + "text": "Reports locales with language codes that are not supported by Java. Inspection ID: SuspiciousLocalesLanguages", + "markdown": "Reports locales with language codes that are not supported by Java.\n\nInspection ID: SuspiciousLocalesLanguages" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SuspiciousLocalesLanguages", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicateStringLiteralInspection", + "shortDescription": { + "text": "Duplicate string literal" + }, + "fullDescription": { + "text": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal. Example: 'class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }' Configure the inspection: Use the Min string length field to set the minimal string length required to detect duplicates. Use the Ignore @PropertyKey expressions option to ignore strings passed as arguments to methods annotated with 'org.jetbrains.annotations.PropertyKey'. Inspection ID: DuplicateStringLiteralInspection", + "markdown": "Reports string literals that are replicated unchanged throughout the project. Two quick-fixes are provided. One to introduce a constant for a duplicated string and use it throughout the project, and one to show the location of all the duplicates of a particular string literal.\n\nExample:\n\n\n class C1 { String CONST1 = \"duplicate string\"; }\n class C2 { String CONST2 = \"duplicate string\"; }\n\nConfigure the inspection:\n\n* Use the **Min string length** field to set the minimal string length required to detect duplicates.\n* Use the **Ignore @PropertyKey expressions** option to ignore strings passed as arguments to methods annotated with `org.jetbrains.annotations.PropertyKey`.\n\nInspection ID: DuplicateStringLiteralInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicateStringLiteralInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Internationalization", + "index": 9, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.editorconfig.editorconfigjetbrains", + "version": "252.28459.0", + "rules": [ + { + "id": "EditorConfigRootDeclarationUniqueness", + "shortDescription": { + "text": "Extra top-level declaration" + }, + "fullDescription": { + "text": "Reports multiple top-level declarations. There can be only one optional “root=true” top-level declaration in the EditorConfig file. Using multiple top-level declarations is not allowed. Inspection ID: EditorConfigRootDeclarationUniqueness", + "markdown": "Reports multiple top-level declarations. There can be only one optional \"root=true\" top-level declaration in the EditorConfig file. Using multiple top-level declarations is not allowed.\n\nInspection ID: EditorConfigRootDeclarationUniqueness" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigRootDeclarationUniqueness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigNumerousWildcards", + "shortDescription": { + "text": "Too many wildcards" + }, + "fullDescription": { + "text": "Reports sections that contain too many wildcards. Using a lot of wildcards may lead to performance issues. Inspection ID: EditorConfigNumerousWildcards", + "markdown": "Reports sections that contain too many wildcards. Using a lot of wildcards may lead to performance issues.\n\nInspection ID: EditorConfigNumerousWildcards" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EditorConfigNumerousWildcards", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigKeyCorrectness", + "shortDescription": { + "text": "Unknown property" + }, + "fullDescription": { + "text": "Reports properties that are not supported by the IDE. Note: some “ij” domain properties may require specific language plugins. Inspection ID: EditorConfigKeyCorrectness", + "markdown": "Reports properties that are not supported by the IDE. Note: some \"ij\" domain properties may require specific language plugins.\n\nInspection ID: EditorConfigKeyCorrectness" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigKeyCorrectness", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigEncoding", + "shortDescription": { + "text": "File encoding doesn't match EditorConfig charset" + }, + "fullDescription": { + "text": "Checks that current file encoding matches the encoding defined in \"charset\" property of .editorconfig file. Inspection ID: EditorConfigEncoding", + "markdown": "Checks that current file encoding matches the encoding defined in \"charset\" property of .editorconfig file.\n\nInspection ID: EditorConfigEncoding" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigEncoding", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigRootDeclarationCorrectness", + "shortDescription": { + "text": "Unexpected top-level declaration" + }, + "fullDescription": { + "text": "Reports unexpected top-level declarations. Top-level declarations other than “root=true” are not allowed in the EditorConfig file. Inspection ID: EditorConfigRootDeclarationCorrectness", + "markdown": "Reports unexpected top-level declarations. Top-level declarations other than \"root=true\" are not allowed in the EditorConfig file.\n\nInspection ID: EditorConfigRootDeclarationCorrectness" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigRootDeclarationCorrectness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigPatternRedundancy", + "shortDescription": { + "text": "Duplicate or redundant pattern" + }, + "fullDescription": { + "text": "Reports file patterns that are redundant as there already are other patterns that define the same scope of files or even a broader one. For example, in '[{*.java,*}]' the first '*.java' pattern defines a narrower scope compared to '*'. That is why it is redundant and can be removed. Inspection ID: EditorConfigPatternRedundancy", + "markdown": "Reports file patterns that are redundant as there already are other patterns that define the same scope of files or even a broader one. For example, in `[{*.java,*}]` the first `*.java` pattern defines a narrower scope compared to `*`. That is why it is redundant and can be removed.\n\nInspection ID: EditorConfigPatternRedundancy" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigPatternRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigDeprecatedDescriptor", + "shortDescription": { + "text": "Deprecated property" + }, + "fullDescription": { + "text": "Reports EditorConfig properties that are no longer supported. Inspection ID: EditorConfigDeprecatedDescriptor", + "markdown": "Reports EditorConfig properties that are no longer supported.\n\nInspection ID: EditorConfigDeprecatedDescriptor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigDeprecatedDescriptor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigShadowedOption", + "shortDescription": { + "text": "Overridden property" + }, + "fullDescription": { + "text": "Reports properties that are already defined in other sections. For example: '[*.java]\nindent_size=4\n[{*.java,*.js}]\nindent_size=2' The second section includes all '*.java' files too but it also redefines indent_size. As a result the value 2 will be used for files matching '*.java'. Inspection ID: EditorConfigShadowedOption", + "markdown": "Reports properties that are already defined in other sections.\n\nFor example:\n\n\n [*.java]\n indent_size=4\n [{*.java,*.js}]\n indent_size=2\n\nThe second section includes all `*.java` files too but it also redefines indent_size. As a result the value 2 will be used for files matching `*.java`.\n\nInspection ID: EditorConfigShadowedOption" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigShadowedOption", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigEmptyHeader", + "shortDescription": { + "text": "Empty header" + }, + "fullDescription": { + "text": "Reports sections with an empty header. Section header must contain file path globs in the format similar to one supported by 'gitignore'. Inspection ID: EditorConfigEmptyHeader", + "markdown": "Reports sections with an empty header. Section header must contain file path globs in the format similar to one supported by `gitignore`.\n\nInspection ID: EditorConfigEmptyHeader" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigEmptyHeader", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigValueUniqueness", + "shortDescription": { + "text": "Non-unique list value" + }, + "fullDescription": { + "text": "Reports duplicates in lists of values. Inspection ID: EditorConfigValueUniqueness", + "markdown": "Reports duplicates in lists of values.\n\nInspection ID: EditorConfigValueUniqueness" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigValueUniqueness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigMissingRequiredDeclaration", + "shortDescription": { + "text": "Required declarations are missing" + }, + "fullDescription": { + "text": "Reports properties that miss the required declarations. Refer to the documentation for more information. Inspection ID: EditorConfigMissingRequiredDeclaration", + "markdown": "Reports properties that miss the required declarations. Refer to the documentation for more information.\n\nInspection ID: EditorConfigMissingRequiredDeclaration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigMissingRequiredDeclaration", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigSpaceInHeader", + "shortDescription": { + "text": "Space in file pattern" + }, + "fullDescription": { + "text": "Reports space characters in wildcard patterns that affect pattern matching. If these characters are not intentional, they should be removed. Inspection ID: EditorConfigSpaceInHeader", + "markdown": "Reports space characters in wildcard patterns that affect pattern matching. If these characters are not intentional, they should be removed.\n\nInspection ID: EditorConfigSpaceInHeader" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EditorConfigSpaceInHeader", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigOptionRedundancy", + "shortDescription": { + "text": "Redundant property" + }, + "fullDescription": { + "text": "Reports properties that are redundant when another applicable section already contains the same property and value. For example: '[*]\nindent_size=4\n[*.java]\nindent_size=4' are both applicable to '*.java' files and define the same 'indent_size' value. Inspection ID: EditorConfigOptionRedundancy", + "markdown": "Reports properties that are redundant when another applicable section already contains the same property and value.\n\n\nFor example:\n\n\n [*]\n indent_size=4\n [*.java]\n indent_size=4\n\nare both applicable to `*.java` files and define the same `indent_size` value.\n\nInspection ID: EditorConfigOptionRedundancy" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigOptionRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigUnexpectedComma", + "shortDescription": { + "text": "Unexpected comma" + }, + "fullDescription": { + "text": "Reports commas that cannot be used in the current context. Commas are allowed only as separators for values in lists. Inspection ID: EditorConfigUnexpectedComma", + "markdown": "Reports commas that cannot be used in the current context. Commas are allowed only as separators for values in lists.\n\nInspection ID: EditorConfigUnexpectedComma" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigUnexpectedComma", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigCharClassRedundancy", + "shortDescription": { + "text": "Unnecessary character class" + }, + "fullDescription": { + "text": "Reports character classes that consist of a single character. Such classes can be simplified to a character, for example '[a]'→'a'. Inspection ID: EditorConfigCharClassRedundancy", + "markdown": "Reports character classes that consist of a single character. Such classes can be simplified to a character, for example `[a]`→`a`.\n\nInspection ID: EditorConfigCharClassRedundancy" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigCharClassRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigPartialOverride", + "shortDescription": { + "text": "Overlapping sections" + }, + "fullDescription": { + "text": "Reports subsets of files specified in the current section that overlap with other subsets in other sections. For example: '[{foo,bar}]' and '[{foo,bas}]' both contain “foo”. Inspection ID: EditorConfigPartialOverride", + "markdown": "Reports subsets of files specified in the current section that overlap with other subsets in other sections. For example: `[{foo,bar}]` and `[{foo,bas}]` both contain \"foo\".\n\nInspection ID: EditorConfigPartialOverride" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "EditorConfigPartialOverride", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigEmptySection", + "shortDescription": { + "text": "Empty section" + }, + "fullDescription": { + "text": "Reports sections that do not contain any EditorConfig properties. Inspection ID: EditorConfigEmptySection", + "markdown": "Reports sections that do not contain any EditorConfig properties.\n\nInspection ID: EditorConfigEmptySection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigEmptySection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigShadowingOption", + "shortDescription": { + "text": "Overriding property" + }, + "fullDescription": { + "text": "Reports properties that override the same properties defined earlier in the file. For example: '[*.java]\nindent_size=4\n[{*.java,*.js}]\nindent_size=2' The second section includes the same files as '[*.java]' but also sets indent_size to value 2. Thus the first declaration 'indent_size=4'will be ignored. Inspection ID: EditorConfigShadowingOption", + "markdown": "Reports properties that override the same properties defined earlier in the file.\n\nFor example:\n\n\n [*.java]\n indent_size=4\n [{*.java,*.js}]\n indent_size=2\n\nThe second section includes the same files as `[*.java]` but also sets indent_size to value 2. Thus the first declaration `indent_size=4`will be ignored.\n\nInspection ID: EditorConfigShadowingOption" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigShadowingOption", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigListAcceptability", + "shortDescription": { + "text": "Unexpected value list" + }, + "fullDescription": { + "text": "Reports lists of values that are used in properties in which lists are not supported. In this case, only a single value can be specified. Inspection ID: EditorConfigListAcceptability", + "markdown": "Reports lists of values that are used in properties in which lists are not supported. In this case, only a single value can be specified.\n\nInspection ID: EditorConfigListAcceptability" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigListAcceptability", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigPatternEnumerationRedundancy", + "shortDescription": { + "text": "Unnecessary braces" + }, + "fullDescription": { + "text": "Reports pattern lists that are either empty '{}' or contain just one pattern, for example '{foo}' in contrast to a list containing multiple patterns, for example '{foo,bar}'. In this case braces are handled as a part of the name. For example, the pattern '*.{a}' will match the file 'my.{a}' but not 'my.a'. Inspection ID: EditorConfigPatternEnumerationRedundancy", + "markdown": "Reports pattern lists that are either empty `{}` or contain just one pattern, for example `{foo}` in contrast to a list containing multiple patterns, for example `{foo,bar}`. In this case braces are handled as a part of the name. For example, the pattern `*.{a}` will match the file `my.{a}` but not `my.a`.\n\nInspection ID: EditorConfigPatternEnumerationRedundancy" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigPatternEnumerationRedundancy", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigReferenceCorrectness", + "shortDescription": { + "text": "Invalid reference" + }, + "fullDescription": { + "text": "Reports identifiers that are either unknown or have a wrong type. Inspection ID: EditorConfigReferenceCorrectness", + "markdown": "Reports identifiers that are either unknown or have a wrong type.\n\nInspection ID: EditorConfigReferenceCorrectness" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigReferenceCorrectness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigPairAcceptability", + "shortDescription": { + "text": "Unexpected key-value pair" + }, + "fullDescription": { + "text": "Reports key-value pairs that are not allowed in the current context. Inspection ID: EditorConfigPairAcceptability", + "markdown": "Reports key-value pairs that are not allowed in the current context.\n\nInspection ID: EditorConfigPairAcceptability" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigPairAcceptability", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigNoMatchingFiles", + "shortDescription": { + "text": "No matching files" + }, + "fullDescription": { + "text": "Reports sections with wildcard patterns that do not match any files under the directory in which the '.editorconfig' file is located. Inspection ID: EditorConfigNoMatchingFiles", + "markdown": "Reports sections with wildcard patterns that do not match any files under the directory in which the `.editorconfig` file is located.\n\nInspection ID: EditorConfigNoMatchingFiles" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigNoMatchingFiles", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigWildcardRedundancy", + "shortDescription": { + "text": "Redundant wildcard" + }, + "fullDescription": { + "text": "Reports wildcards that become redundant when the “**” wildcard is used in the same section. The “**” wildcard defines a broader set of files than any other wildcard. That is why, any other wildcard used in the same section has no affect and can be removed. Inspection ID: EditorConfigWildcardRedundancy", + "markdown": "Reports wildcards that become redundant when the \"\\*\\*\" wildcard is used in the same section.\n\n\nThe \"\\*\\*\" wildcard defines a broader set of files than any other wildcard.\nThat is why, any other wildcard used in the same section has no affect and can be removed.\n\nInspection ID: EditorConfigWildcardRedundancy" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigWildcardRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigHeaderUniqueness", + "shortDescription": { + "text": "EditorConfig section is not unique" + }, + "fullDescription": { + "text": "Reports sections that define the same file pattern as other sections. Inspection ID: EditorConfigHeaderUniqueness", + "markdown": "Reports sections that define the same file pattern as other sections.\n\nInspection ID: EditorConfigHeaderUniqueness" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigHeaderUniqueness", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigValueCorrectness", + "shortDescription": { + "text": "Invalid property value" + }, + "fullDescription": { + "text": "Reports property values that do not meet value restrictions. For example, some properties may be only “true” or “false”, others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them. Inspection ID: EditorConfigValueCorrectness", + "markdown": "Reports property values that do not meet value restrictions. For example, some properties may be only \"true\" or \"false\", others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them.\n\nInspection ID: EditorConfigValueCorrectness" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigValueCorrectness", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigVerifyByCore", + "shortDescription": { + "text": "Invalid .editorconfig file" + }, + "fullDescription": { + "text": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied. Inspection ID: EditorConfigVerifyByCore", + "markdown": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied.\n\nInspection ID: EditorConfigVerifyByCore" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "EditorConfigVerifyByCore", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigCharClassLetterRedundancy", + "shortDescription": { + "text": "Duplicate character class letter" + }, + "fullDescription": { + "text": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example '[aa]'. Inspection ID: EditorConfigCharClassLetterRedundancy", + "markdown": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example `[aa]`.\n\nInspection ID: EditorConfigCharClassLetterRedundancy" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigCharClassLetterRedundancy", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "EditorConfigUnusedDeclaration", + "shortDescription": { + "text": "Unused declaration" + }, + "fullDescription": { + "text": "Reports unused declarations. Such declarations can be removed. Inspection ID: EditorConfigUnusedDeclaration", + "markdown": "Reports unused declarations. Such declarations can be removed.\n\nInspection ID: EditorConfigUnusedDeclaration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "EditorConfigUnusedDeclaration", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "EditorConfig", + "index": 33, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.jetbrains.plugins.gradle", + "version": "252.28459.0", + "rules": [ + { + "id": "ForeignDelegate", + "shortDescription": { + "text": "Possibly misplaced call to Gradle method" + }, + "fullDescription": { + "text": "Detects possibly misplaced calls to Gradle methods. Gradle buildscripts comprise a lot of nested closures, making the code structure similar to a markup language. Due to the behavior of DSL languages, the methods that you can write in the outer closures are also available in the inner ones. Such methods may have no meaning when written outside their scope. Sometimes it may be hard to detect this situation. This inspection aims to detect such methods. Example: 'repositories {\n // the delegate of 'repositories' has method 'exclusiveContent', which can be written here\n maven {\n // the delegate of 'maven' has method 'content', which can be written here\n // but 'exclusiveContent' is also available\n exclusiveContent {} // reports 'exclusiveContent'\n }\n}' Inspection ID: ForeignDelegate", + "markdown": "Detects possibly misplaced calls to Gradle methods.\nGradle buildscripts comprise a lot of nested closures, making the code structure similar to a markup language. Due to the behavior of DSL languages, the methods that you can write in the outer closures are also available in the inner ones. Such methods may have no meaning when written outside their scope. \nSometimes it may be hard to detect this situation. This inspection aims to detect such methods.\n\n**Example:**\n\n\n repositories {\n // the delegate of 'repositories' has method 'exclusiveContent', which can be written here\n maven {\n // the delegate of 'maven' has method 'content', which can be written here\n // but 'exclusiveContent' is also available\n exclusiveContent {} // reports 'exclusiveContent'\n }\n }\n\nInspection ID: ForeignDelegate" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "ForeignDelegate", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Gradle/Probable bugs", + "index": 42, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IncorrectPluginDslStructure", + "shortDescription": { + "text": "Plugin DSL structure" + }, + "fullDescription": { + "text": "Detects disallowed statements before 'plugins {}' block. Due to the limitations of Gradle Plugin DSL, only a restricted set of Groovy statements is available before ''plugins {}'' block. The only options are ''buildscript {}'', ''pluginManagement {}'' and other ''plugins {}''. See Gradle documentation Example: 'import foo.bar.Baz\nplugins {} // reports 'plugins'\nplugins {\n foo() // reports 'foo'\n id 'java'\n}' Inspection ID: IncorrectPluginDslStructure", + "markdown": "Detects disallowed statements before 'plugins {}' block.\nDue to the limitations of Gradle Plugin DSL, only a restricted set of Groovy statements is available before '`plugins {}`' block. The only options are '`buildscript {}`', '`pluginManagement {}`' and other '`plugins {}`'. \n[See Gradle documentation](https://docs.gradle.org/current/userguide/plugins.html#plugins_dsl_limitations)\n\n**Example:**\n\n\n import foo.bar.Baz\n plugins {} // reports 'plugins'\n plugins {\n foo() // reports 'foo'\n id 'java'\n }\n\nInspection ID: IncorrectPluginDslStructure" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "IncorrectPluginDslStructure", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Gradle/Validity issues", + "index": 48, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BintrayPublishingPlugin", + "shortDescription": { + "text": "Bintray publishing plugin may stop working on May 1st, 2021" + }, + "fullDescription": { + "text": "Detects usages of Gradle plugin 'com.jfrog.bintray'. The plugin is used for publishing build results to Bintray. Publishing to Bintray service is disabled. Inspection ID: BintrayPublishingPlugin", + "markdown": "Detects usages of Gradle plugin `com.jfrog.bintray`.\nThe plugin is used for publishing build results to Bintray.\nPublishing to\n[Bintray](https://www.jfrog.com/confluence/display/BT/Welcome+to+JFrog+Bintray) service is disabled.\n\nInspection ID: BintrayPublishingPlugin" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BintrayPublishingPlugin", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Gradle/Probable bugs", + "index": 42, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DependencyNotationArgument", + "shortDescription": { + "text": "Unrecognized dependency notation" + }, + "fullDescription": { + "text": "Detects incorrect dependency notations. The following types/formats are supported by Gradle: Instances of 'Dependency'; 'String' or 'CharSequence' values, for example ''org.gradle:gradle-core:1.0''; Maps, for example '[group: 'org.gradle', name: 'gradle-core', version: '1.0']'; FileCollections, for example 'files('some.jar', 'someOther.jar')'; Projects, for example 'project(':some:project:path')'; 'ClassPathNotation', for example 'gradleApi()'; Lists of dependency notations, for example '['org.gradle:gradle-core:1.0']'; (Gradle 7.0+) Version catalog accessors, for example 'libs.groovy.core'. See Gradle documentation Example: 'dependencies {\n implementation(1) // reports '1'\n}' Inspection ID: DependencyNotationArgument", + "markdown": "Detects incorrect dependency notations.\nThe following types/formats are supported by Gradle:\n\n* Instances of `Dependency`;\n* `String` or `CharSequence` values, for example `'org.gradle:gradle-core:1.0'`;\n* Maps, for example `[group: 'org.gradle', name: 'gradle-core', version: '1.0']`;\n* FileCollections, for example `files('some.jar', 'someOther.jar')`;\n* Projects, for example `project(':some:project:path')`;\n* `ClassPathNotation`, for example `gradleApi()`;\n* Lists of dependency notations, for example `['org.gradle:gradle-core:1.0']`;\n* (Gradle 7.0+) [Version catalog accessors](https://docs.gradle.org/current/userguide/platforms.html), for example `libs.groovy.core`.\n\n[See Gradle documentation](https://docs.gradle.org/current/userguide/declaring_dependencies.html#sec:dependency-types)\n\n**Example:**\n\n\n dependencies {\n implementation(1) // reports '1'\n }\n\nInspection ID: DependencyNotationArgument" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DependencyNotationArgument", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Gradle/Probable bugs", + "index": 42, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DeprecatedConfigurations", + "shortDescription": { + "text": "Deprecated configurations" + }, + "fullDescription": { + "text": "Detects usage of configuration methods that were deprecated. Configuration methods may be deprecated because of two possible reasons: The Gradle API has evolved, so old method choices should be avoided; Some plugin provides a better version of the deprecated configuration method. Most likely there will be an alternative for the deprecated method. Example: 'plugins {\n id 'java'\n}\n\ndependencies {\n archive 'org.gradle.api:gradle:1.0' // reports 'archive'\n}' Inspection ID: DeprecatedConfigurations", + "markdown": "Detects usage of configuration methods that were deprecated.\nConfiguration methods may be deprecated because of two possible reasons:\n\n* The Gradle API has evolved, so old method choices should be avoided;\n* Some plugin provides a better version of the deprecated configuration method.\n\nMost likely there will be an alternative for the deprecated method.\n\n**Example:**\n\n\n plugins {\n id 'java'\n }\n\n dependencies {\n archive 'org.gradle.api:gradle:1.0' // reports 'archive'\n }\n\nInspection ID: DeprecatedConfigurations" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DeprecatedConfigurations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Gradle/Validity issues", + "index": 48, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MultipleRepositoryUrls", + "shortDescription": { + "text": "Multiple repository urls" + }, + "fullDescription": { + "text": "Reports the usage of multiple URLs per repository (maven or ivy) block. The problem is that only one URL can be picked up for the repository, the other URLs will be ignored. Inspection ID: MultipleRepositoryUrls", + "markdown": "Reports the usage of multiple URLs per repository (maven or ivy) block. The problem is that only one URL can be picked up for the repository, the other URLs will be ignored.\n\nInspection ID: MultipleRepositoryUrls" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MultipleRepositoryUrls", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Gradle/Probable bugs", + "index": 42, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JCenterRepository", + "shortDescription": { + "text": "Builds will no longer be able to resolve artifacts from JCenter after February 1st, 2022" + }, + "fullDescription": { + "text": "Detects usages of the JCenter repository to resolve dependencies. Builds will no longer be able to resolve artifacts from JCenter after February 1st, 2022. Inspection ID: JCenterRepository", + "markdown": "Detects usages of the JCenter repository to resolve dependencies. Builds will no longer be able to resolve artifacts from JCenter after February 1st, 2022.\n\nInspection ID: JCenterRepository" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JCenterRepository", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Gradle/Probable bugs", + "index": 42, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConfigurationAvoidance", + "shortDescription": { + "text": "Configuration avoidance" + }, + "fullDescription": { + "text": "(Gradle 4.9+) Detects usage of API that interacts with tasks eagerly. Eager interaction with tasks implies some inconveniences: The user should manually set up all dependencies between tasks; In the configuration phase, all the tasks accessed via the eager API become configured, even if they are not executed afterwards. It results in performance degradation. Eventually, the eager API will be deprecated in favor of the lazy one. For a migration guide, see the Gradle documentation. Example: 'task foo { // reports 'task', suggests replacing it with 'task.register'\n // ...\n}' Inspection ID: ConfigurationAvoidance", + "markdown": "(Gradle 4.9+) Detects usage of API that interacts with tasks eagerly.\n\nEager interaction with tasks implies some inconveniences:\n\n* The user should manually set up all dependencies between tasks;\n* In the [configuration phase](https://docs.gradle.org/current/userguide/build_lifecycle.html#sec:build_phases), all the tasks accessed via the eager API become configured, even if they are not executed afterwards. It results in performance degradation.\n\nEventually, the eager API will be deprecated in favor of the lazy one.\n\nFor a migration guide, see the\n[Gradle documentation](https://docs.gradle.org/current/userguide/task_configuration_avoidance.html).\n\n**Example:**\n\n task foo { // reports 'task', suggests replacing it with 'task.register'\n // ...\n }\n\nInspection ID: ConfigurationAvoidance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConfigurationAvoidance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Performance" + } + }, + "relationships": [ + { + "target": { + "id": "Gradle/Best practises", + "index": 128, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "Lombook Plugin", + "version": "252.28459.0", + "rules": [ + { + "id": "LombokGetterMayBeUsed", + "shortDescription": { + "text": "Lombok @Getter may be used" + }, + "fullDescription": { + "text": "Reports standard getter method that can be replaced by the lombok '@Getter' annotation. Example: 'import java.util.Date;\n\n public class MyClass {\n /**\n * The process date.\n */\n private Date processDate;\n\n /**\n * Returns the date.\n *\n * @return The date\n */\n public Date getProcessDate() {\n return processDate;\n }\n }' After the quick-fix/cleanup is applied: 'import lombok.Getter;\n import java.util.Date;\n\n @Getter\n public class MyClass {\n /**\n * The process date.\n * -- GETTER --\n * Returns the date.\n *\n * @return The date\n */\n private Date processDate;\n }' It only reports when the lombok library is configured. To unlombok, see the lombok site. Inspection ID: LombokGetterMayBeUsed New in 2023.2", + "markdown": "Reports standard getter method that can be replaced by the lombok `@Getter` annotation.\n\nExample:\n\n\n import java.util.Date;\n\n public class MyClass {\n /**\n * The process date.\n */\n private Date processDate;\n\n /**\n * Returns the date.\n *\n * @return The date\n */\n public Date getProcessDate() {\n return processDate;\n }\n }\n\nAfter the quick-fix/cleanup is applied:\n\n\n import lombok.Getter;\n import java.util.Date;\n\n @Getter\n public class MyClass {\n /**\n * The process date.\n * -- GETTER --\n * Returns the date.\n *\n * @return The date\n */\n private Date processDate;\n }\n\nIt only reports when the lombok library is configured. To unlombok, see the lombok site.\n\nInspection ID: LombokGetterMayBeUsed\n\nNew in 2023.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LombokGetterMayBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantSlf4jDefinition", + "shortDescription": { + "text": "@Slf4j" + }, + "fullDescription": { + "text": "Reports explicitly defined Slf4j Loggers. The '@Slf4j' annotation can be used instead. Inspection ID: RedundantSlf4jDefinition", + "markdown": "Reports explicitly defined *Slf4j* Loggers. The `@Slf4j` annotation can be used instead.\n\nInspection ID: RedundantSlf4jDefinition" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantSlf4jDefinition", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Lombok/Redundant definitions", + "index": 58, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantModifiersUtilityClassLombok", + "shortDescription": { + "text": "@UtilityClass modifiers" + }, + "fullDescription": { + "text": "Reports unneeded modifiers for classes annotated with '@UtilityClass'. Inspection ID: RedundantModifiersUtilityClassLombok", + "markdown": "Reports unneeded modifiers for classes annotated with `@UtilityClass`.\n\nInspection ID: RedundantModifiersUtilityClassLombok" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantModifiersUtilityClassLombok", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Lombok/Redundant modifiers", + "index": 89, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantModifiersValueLombok", + "shortDescription": { + "text": "@Value modifiers" + }, + "fullDescription": { + "text": "Reports unneeded modifiers for classes annotated with '@Value'. Inspection ID: RedundantModifiersValueLombok", + "markdown": "Reports unneeded modifiers for classes annotated with `@Value`.\n\nInspection ID: RedundantModifiersValueLombok" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantModifiersValueLombok", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Lombok/Redundant modifiers", + "index": 89, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "StaticMethodImportLombok", + "shortDescription": { + "text": "Using static import for Lombok-generated methods" + }, + "fullDescription": { + "text": "Reports usages of static imports for Lombok's generated methods. This will fail on compilation with javac. The reason is that static methods are resolved before the lombok annotation processor kicks in. At this time javac uses the original code before the one that should have been generated by the annotation processor, then javac of course report the missing symbols (generated methods). See for more details Inspection ID: StaticMethodImportLombok", + "markdown": "Reports usages of static imports for Lombok's generated methods. \n\n\nThis will fail on compilation with javac. The reason is that static methods are resolved before the lombok annotation processor kicks in.\nAt this time javac uses the original code before the one that should have been generated by the annotation processor, then javac of course\nreport the missing symbols (generated methods).\nSee for more [details](https://github.com/projectlombok/lombok/issues/2044)\n\nInspection ID: StaticMethodImportLombok" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "StaticMethodImportLombok", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Lombok", + "index": 57, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LombokSetterMayBeUsed", + "shortDescription": { + "text": "Lombok @Setter may be used" + }, + "fullDescription": { + "text": "Reports standard setter method that can be replaced by the lombok '@Setter' annotation. Example: 'import java.util.Date;\n\n public class MyClass {\n /**\n * The process date.\n */\n private Date processDate;\n\n /**\n * Sets the date.\n *\n * @param The date\n */\n public void setProcessDate(Date param) {\n processDate = param;\n }\n }' After the quick-fix/cleanup is applied: 'import lombok.Setter;\n import java.util.Date;\n\n @Setter\n public class MyClass {\n /**\n * The process date.\n * -- SETTER --\n * Sets the date.\n *\n * @param The date\n */\n private Date processDate;\n }' It only reports when the lombok library is configured. To unlombok, see the lombok site. Inspection ID: LombokSetterMayBeUsed New in 2023.2", + "markdown": "Reports standard setter method that can be replaced by the lombok `@Setter` annotation.\n\nExample:\n\n\n import java.util.Date;\n\n public class MyClass {\n /**\n * The process date.\n */\n private Date processDate;\n\n /**\n * Sets the date.\n *\n * @param The date\n */\n public void setProcessDate(Date param) {\n processDate = param;\n }\n }\n\nAfter the quick-fix/cleanup is applied:\n\n\n import lombok.Setter;\n import java.util.Date;\n\n @Setter\n public class MyClass {\n /**\n * The process date.\n * -- SETTER --\n * Sets the date.\n *\n * @param The date\n */\n private Date processDate;\n }\n\nIt only reports when the lombok library is configured. To unlombok, see the lombok site.\n\nInspection ID: LombokSetterMayBeUsed\n\nNew in 2023.2" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "LombokSetterMayBeUsed", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Verbose or redundant code constructs", + "index": 39, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SpringQualifierCopyableLombok", + "shortDescription": { + "text": "@Qualifier not copyable by Lombok" + }, + "fullDescription": { + "text": "Reports Spring '@Qualifier' annotations on class fields that are ignored by the corresponding Lombok '@RequiredArgsConstructor' and '@AllArgsConstructor' annotations. The generated constructors will not receive the '@Qualifier' annotation without a 'lombok.copyableAnnotations' definition inside the 'lombok.config' file. Inspection ID: SpringQualifierCopyableLombok", + "markdown": "Reports Spring `@Qualifier` annotations on class fields that are ignored by the corresponding Lombok `@RequiredArgsConstructor` and `@AllArgsConstructor` annotations. The generated constructors will not receive the `@Qualifier` annotation without a `lombok.copyableAnnotations` definition inside the `lombok.config` file.\n\nInspection ID: SpringQualifierCopyableLombok" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "SpringQualifierCopyableLombok", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Lombok", + "index": 57, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Lombok", + "shortDescription": { + "text": "Lombok annotations" + }, + "fullDescription": { + "text": "Offers general inspections for Lombok annotations. Warnings and errors reported by this inspection aim to match 1:1 the warnings and errors reported by the Lombok annotation processor at compile-time, such as: Redundantly applied annotation (reported as a warning) Example: '@ToString\n class Person {\n final String name;\n final int age;\n\n @Override\n public String toString() {\n return \"Person{name='\" + name + \"', age=\" + age + '}';\n }\n }' Quick-fix suggests removing the redundant annotation. Incorrectly applied annotation (reported as an error) Example: '@Value\n record Person(String name, int age) {}' Quick-fix suggests removing the invalid annotation. Inspection ID: Lombok", + "markdown": "Offers general inspections for Lombok annotations.\n\n\nWarnings and errors reported by this inspection aim to match 1:1 the warnings and errors reported\nby the Lombok annotation processor at compile-time, such as:\n\n* Redundantly applied annotation (reported as a warning) **Example:**\n\n\n @ToString\n class Person {\n final String name;\n final int age;\n\n @Override\n public String toString() {\n return \"Person{name='\" + name + \"', age=\" + age + '}';\n }\n }\n \n Quick-fix suggests removing the redundant annotation.\n* Incorrectly applied annotation (reported as an error) **Example:**\n\n\n @Value\n record Person(String name, int age) {}\n \n Quick-fix suggests removing the invalid annotation.\n\nInspection ID: Lombok" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "Lombok", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Lombok", + "index": 57, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "RedundantModifiersValLombok", + "shortDescription": { + "text": "Unnecessary final before 'val'" + }, + "fullDescription": { + "text": "Reports unneeded 'final' modifiers before 'val'. Inspection ID: RedundantModifiersValLombok", + "markdown": "Reports unneeded `final` modifiers before `val`.\n\nInspection ID: RedundantModifiersValLombok" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "RedundantModifiersValLombok", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Lombok/Redundant modifiers", + "index": 89, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "LombokFlagUsage", + "shortDescription": { + "text": "Lombok flag usages" + }, + "fullDescription": { + "text": "IntelliJ Lombok flagUsage Inspection This inspection supports every 'flagUsage' configuration specified in the 'lombok.config' file. It issue warnings or errors inside IntelliJ when a Lombok feature is used that is configured to be flagged. This proactive feedback helps maintain code standards and ensures that only approved Lombok features are utilized. Supported flagUsage Configurations Configuration Key Description lombok.anyConstructor.flagUsage Emit a warning or error if any of the XxxArgsConstructor annotations are used. lombok.allArgsConstructor.flagUsage Emit a warning or error if '@AllArgsConstructor' is used. lombok.noArgsConstructor.flagUsage Emit a warning or error if '@NoArgsConstructor' is used. lombok.requiredArgsConstructor.flagUsage Emit a warning or error if '@RequiredArgsConstructor' is used. lombok.data.flagUsage Emit a warning or error if '@Data' is used. lombok.value.flagUsage Emit a warning or error if '@Value' is used. lombok.getter.flagUsage Emit a warning or error if '@Getter' is used. lombok.getter.lazy.flagUsage Emit a warning or error if '@Getter(lazy=true)' is used. lombok.setter.flagUsage Emit a warning or error if '@Setter' is used. lombok.equalsAndHashCode.flagUsage Emit a warning or error if '@EqualsAndHashCode' is used. lombok.toString.flagUsage Emit a warning or error if '@ToString' is used. lombok.builder.flagUsage Emit a warning or error if '@Builder' is used. lombok.cleanup.flagUsage Emit a warning or error if '@Cleanup' is used. lombok.delegate.flagUsage Emit a warning or error if '@Delegate' is used. lombok.nonNull.flagUsage Emit a warning or error if '@NonNull' is used. lombok.sneakyThrows.flagUsage Emit a warning or error if '@SneakyThrows' is used. lombok.synchronized.flagUsage Emit a warning or error if '@Synchronized' is used. lombok.val.flagUsage Emit a warning or error if the language keyword 'val' is used. lombok.var.flagUsage Emit a warning or error if the language keyword 'var' is used. lombok.with.flagUsage Emit a warning or error if '@With' is used. lombok.log.flagUsage Emit a warning or error if any log annotation is used. lombok.log.apacheCommons.flagUsage Emit a warning or error if '@CommonsLog' is used. lombok.log.javaUtilLogging.flagUsage Emit a warning or error if '@Log' is used. lombok.log.log4j.flagUsage Emit a warning or error if '@Log4j' is used. lombok.log.log4j2.flagUsage Emit a warning or error if '@Log4j2' is used. lombok.log.slf4j.flagUsage Emit a warning or error if '@Slf4j' is used. lombok.log.xslf4j.flagUsage Emit a warning or error if '@XSlf4j' is used. lombok.log.jbosslog.flagUsage Emit a warning or error if '@JBossLog' is used. lombok.log.flogger.flagUsage Emit a warning or error if '@Flogger' is used. lombok.log.custom.flagUsage Emit a warning or error if '@CustomLog' is used. lombok.experimental.flagUsage Emit a warning or error if an experimental feature is used. lombok.accessors.flagUsage Emit a warning or error if '@Accessors' is used. lombok.extensionMethod.flagUsage Emit a warning or error if '@ExtensionMethod' is used. lombok.fieldDefaults.flagUsage Emit a warning or error if '@FieldDefaults' is used. lombok.helper.flagUsage Emit a warning or error if '@Helper' is used. lombok.locked.flagUsage Emit a warning or error if '@Locked' is used. lombok.onX.flagUsage Emit a warning or error if the 'onX' flag is used. lombok.utilityClass.flagUsage Emit a warning or error if '@UtilityClass' is used. lombok.fieldNameConstants.flagUsage Emit a warning or error if '@FieldNameConstants' is used. lombok.superBuilder.flagUsage Emit a warning or error if '@SuperBuilder' is used. lombok.withBy.flagUsage Emit a warning or error if '@WithBy' is used. lombok.jacksonized.flagUsage Emit a warning or error if '@Jacksonized' is used. lombok.standardException.flagUsage Emit a warning or error if '@StandardException' is used. Inspection ID: LombokFlagUsage", + "markdown": "IntelliJ Lombok flagUsage Inspection\n====================================\n\n\nThis inspection supports every `flagUsage` configuration specified in the `lombok.config` file. It issue warnings or errors inside IntelliJ when a Lombok feature is used that is configured to be flagged. This proactive feedback helps maintain code standards and ensures that only approved Lombok features are utilized.\n\nSupported flagUsage Configurations\n----------------------------------\n\n| Configuration Key | Description |\n|------------------------------------------|--------------------------------------------------------------------------------|\n| lombok.anyConstructor.flagUsage | Emit a warning or error if any of the XxxArgsConstructor annotations are used. |\n| lombok.allArgsConstructor.flagUsage | Emit a warning or error if `@AllArgsConstructor` is used. |\n| lombok.noArgsConstructor.flagUsage | Emit a warning or error if `@NoArgsConstructor` is used. |\n| lombok.requiredArgsConstructor.flagUsage | Emit a warning or error if `@RequiredArgsConstructor` is used. |\n| lombok.data.flagUsage | Emit a warning or error if `@Data` is used. |\n| lombok.value.flagUsage | Emit a warning or error if `@Value` is used. |\n| lombok.getter.flagUsage | Emit a warning or error if `@Getter` is used. |\n| lombok.getter.lazy.flagUsage | Emit a warning or error if `@Getter(lazy=true)` is used. |\n| lombok.setter.flagUsage | Emit a warning or error if `@Setter` is used. |\n| lombok.equalsAndHashCode.flagUsage | Emit a warning or error if `@EqualsAndHashCode` is used. |\n| lombok.toString.flagUsage | Emit a warning or error if `@ToString` is used. |\n| lombok.builder.flagUsage | Emit a warning or error if `@Builder` is used. |\n| lombok.cleanup.flagUsage | Emit a warning or error if `@Cleanup` is used. |\n| lombok.delegate.flagUsage | Emit a warning or error if `@Delegate` is used. |\n| lombok.nonNull.flagUsage | Emit a warning or error if `@NonNull` is used. |\n| lombok.sneakyThrows.flagUsage | Emit a warning or error if `@SneakyThrows` is used. |\n| lombok.synchronized.flagUsage | Emit a warning or error if `@Synchronized` is used. |\n| lombok.val.flagUsage | Emit a warning or error if the language keyword `val` is used. |\n| lombok.var.flagUsage | Emit a warning or error if the language keyword `var` is used. |\n| lombok.with.flagUsage | Emit a warning or error if `@With` is used. |\n| lombok.log.flagUsage | Emit a warning or error if any log annotation is used. |\n| lombok.log.apacheCommons.flagUsage | Emit a warning or error if `@CommonsLog` is used. |\n| lombok.log.javaUtilLogging.flagUsage | Emit a warning or error if `@Log` is used. |\n| lombok.log.log4j.flagUsage | Emit a warning or error if `@Log4j` is used. |\n| lombok.log.log4j2.flagUsage | Emit a warning or error if `@Log4j2` is used. |\n| lombok.log.slf4j.flagUsage | Emit a warning or error if `@Slf4j` is used. |\n| lombok.log.xslf4j.flagUsage | Emit a warning or error if `@XSlf4j` is used. |\n| lombok.log.jbosslog.flagUsage | Emit a warning or error if `@JBossLog` is used. |\n| lombok.log.flogger.flagUsage | Emit a warning or error if `@Flogger` is used. |\n| lombok.log.custom.flagUsage | Emit a warning or error if `@CustomLog` is used. |\n| lombok.experimental.flagUsage | Emit a warning or error if an experimental feature is used. |\n| lombok.accessors.flagUsage | Emit a warning or error if `@Accessors` is used. |\n| lombok.extensionMethod.flagUsage | Emit a warning or error if `@ExtensionMethod` is used. |\n| lombok.fieldDefaults.flagUsage | Emit a warning or error if `@FieldDefaults` is used. |\n| lombok.helper.flagUsage | Emit a warning or error if `@Helper` is used. |\n| lombok.locked.flagUsage | Emit a warning or error if `@Locked` is used. |\n| lombok.onX.flagUsage | Emit a warning or error if the `onX` flag is used. |\n| lombok.utilityClass.flagUsage | Emit a warning or error if `@UtilityClass` is used. |\n| lombok.fieldNameConstants.flagUsage | Emit a warning or error if `@FieldNameConstants` is used. |\n| lombok.superBuilder.flagUsage | Emit a warning or error if `@SuperBuilder` is used. |\n| lombok.withBy.flagUsage | Emit a warning or error if `@WithBy` is used. |\n| lombok.jacksonized.flagUsage | Emit a warning or error if `@Jacksonized` is used. |\n| lombok.standardException.flagUsage | Emit a warning or error if `@StandardException` is used. |\n\nInspection ID: LombokFlagUsage" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "LombokFlagUsage", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Lombok", + "index": 57, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DeprecatedLombok", + "shortDescription": { + "text": "Deprecated Lombok annotations" + }, + "fullDescription": { + "text": "Reports deprecated Lombok annotations and suggests quick-fixes to replace them with the ones promoted to the main package. Inspection ID: DeprecatedLombok", + "markdown": "Reports deprecated Lombok annotations and suggests quick-fixes to replace them with the ones promoted to the main package.\n\nInspection ID: DeprecatedLombok" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "DeprecatedLombok", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Java/Lombok", + "index": 57, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "TestNG-J", + "version": "252.28459.0", + "rules": [ + { + "id": "groupsTestNG", + "shortDescription": { + "text": "Undefined group name" + }, + "fullDescription": { + "text": "Reports undefined group names passed to the 'dependsOnGroups' or 'groups' attributes in the '@Test' annotation. The quick-fix adds an undefined name to a list of known groups. Use the Defined Groups field to define a comma-separated list of known groups. Inspection ID: groupsTestNG", + "markdown": "Reports undefined group names passed to the `dependsOnGroups` or `groups` attributes in the `@Test` annotation.\n\nThe quick-fix adds an undefined name to a list of known groups.\n\nUse the **Defined Groups** field to define a comma-separated list of known groups.\n\nInspection ID: groupsTestNG" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "groupsTestNG", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JUnitTestNG", + "shortDescription": { + "text": "JUnit Test can be converted to TestNG" + }, + "fullDescription": { + "text": "Reports any JUnit-based test class that can be converted into TestNG based unit test. Example: 'import org.junit.Test;\nimport static org.junit.Assert.*;\n\npublic class ExampleTest {\n @Test\n public void testExample(){\n assertEquals(2 + 2, 4);\n }\n}' After the quick-fix is applied: 'import org.testng.Assert;\nimport org.testng.annotations.Test;\n\npublic class ExampleTest {\n @Test\n public void testExample(){\n Assert.assertEquals(4, 2 + 2);\n }\n}' Inspection ID: JUnitTestNG", + "markdown": "Reports any JUnit-based test class that can be converted into TestNG based unit test.\n\nExample:\n\n\n import org.junit.Test;\n import static org.junit.Assert.*;\n\n public class ExampleTest {\n @Test\n public void testExample(){\n assertEquals(2 + 2, 4);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import org.testng.Assert;\n import org.testng.annotations.Test;\n\n public class ExampleTest {\n @Test\n public void testExample(){\n Assert.assertEquals(4, 2 + 2);\n }\n }\n\nInspection ID: JUnitTestNG" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JUnitTestNG", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertJavadoc", + "shortDescription": { + "text": "TestNG Javadoc can be converted to annotations" + }, + "fullDescription": { + "text": "Asserts your TestNG tests with Javadoc annotations and converts them to JDK annotations. Example: '/**\n * @testng.before-test\n */\n public void sample() {}' After the quick-fix is applied: '@BeforeTest\n public void sample() {}' Inspection ID: ConvertJavadoc", + "markdown": "Asserts your TestNG tests with Javadoc annotations and converts them to JDK annotations.\n\nExample:\n\n\n /**\n * @testng.before-test\n */\n public void sample() {}\n\nAfter the quick-fix is applied:\n\n\n @BeforeTest\n public void sample() {}\n\n\nInspection ID: ConvertJavadoc" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConvertJavadoc", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DataProviderReturnType", + "shortDescription": { + "text": "Invalid data provider return type" + }, + "fullDescription": { + "text": "Reports methods marked with '@DataProvider' annotation that doesn't return 'Object[][]' or 'Iterator'. If another type is returned, TestNG throws an exception. Example: 'public class TestNgTest {\n @DataProvider(name = \"Languages\")\n List getData() {\n return List.of(\"Java\", \"Kotlin\");\n }\n\n @Test(dataProvider = \"Languages\")\n public void testData(String language) {\n System.out.println(language);\n }\n}' Inspection ID: DataProviderReturnType", + "markdown": "Reports methods marked with `@DataProvider` annotation that doesn't return `Object[][]` or `Iterator`. If another type is returned, TestNG throws an exception.\n\nExample:\n\n\n public class TestNgTest {\n @DataProvider(name = \"Languages\")\n List getData() {\n return List.of(\"Java\", \"Kotlin\");\n }\n\n @Test(dataProvider = \"Languages\")\n public void testData(String language) {\n System.out.println(language);\n }\n }\n\nInspection ID: DataProviderReturnType" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "DataProviderReturnType", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExpectedExceptionNeverThrownTestNG", + "shortDescription": { + "text": "Expected exception never thrown in test method body" + }, + "fullDescription": { + "text": "Reports checked exceptions expected by a TestNG test method that are never thrown inside the method body. Example: '@Test(expectedExceptions = Exception.class) // warning: Expected 'Exception' never thrown\n public void testEngineIsRunning() {\n assertTrue(engine.isRunning());\n }'\n Inspection ID: ExpectedExceptionNeverThrownTestNG", + "markdown": "Reports checked exceptions expected by a TestNG test method that are never thrown inside the method body.\n\n**Example:**\n\n\n @Test(expectedExceptions = Exception.class) // warning: Expected 'Exception' never thrown\n public void testEngineIsRunning() {\n assertTrue(engine.isRunning());\n }\n \nInspection ID: ExpectedExceptionNeverThrownTestNG" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExpectedExceptionNeverThrownTestNG", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UndeclaredTests", + "shortDescription": { + "text": "Undeclared test" + }, + "fullDescription": { + "text": "Reports test classes that are not registered in 'testing.xml'. This is often a mistake because such tests won't be executed. Inspection ID: UndeclaredTests", + "markdown": "Reports test classes that are not registered in `testing.xml`. This is often a mistake because such tests won't be executed.\n\nInspection ID: UndeclaredTests" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UndeclaredTests", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ConvertOldAnnotations", + "shortDescription": { + "text": "Old TestNG annotation @Configuration is used" + }, + "fullDescription": { + "text": "Reports TestNG 'org.testng.annotations.Configuration' annotations. It's better to configure a test suite with the modern '@BeforeXXX'/'@AfterXXX' annotations. Example: 'public class Test {\n @Configuration(beforeSuite = true, afterTest = true)\n public void afterBefore(){\n }\n }' After the quick-fix is applied: 'public class Test {\n @AfterTest()\n @BeforeSuite()\n public void afterBefore(){\n }\n }' Inspection ID: ConvertOldAnnotations", + "markdown": "Reports TestNG `org.testng.annotations.Configuration` annotations.\n\nIt's better to configure a test suite with the modern `@BeforeXXX`/`@AfterXXX` annotations.\n\nExample:\n\n\n public class Test {\n @Configuration(beforeSuite = true, afterTest = true)\n public void afterBefore(){\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class Test {\n @AfterTest()\n @BeforeSuite()\n public void afterBefore(){\n }\n }\n\nInspection ID: ConvertOldAnnotations" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ConvertOldAnnotations", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicatedDataProviderNames", + "shortDescription": { + "text": "Duplicated data provider names" + }, + "fullDescription": { + "text": "Reports 'TestNG' data providers with equal names if 'org.testng.TestNGException' has occurred. Example: 'public class DuplicatedDataProviders {\n @DataProvider\n public Object[][] intTestData() { // duplicate 1\n return new Integer[][]{\n new Integer[]{1, 1},\n };\n }\n\n @DataProvider(name = \"intTestData\")\n public Object[][] someTestData() { // duplicate 2\n return new Integer[][]{\n new Integer[]{1, 1},\n };\n }\n\n @Test(dataProvider = \"intTestData\")\n public void testIsOK(Integer key, Integer value) {\n assertEquals(key, value);\n }\n }' Inspection ID: DuplicatedDataProviderNames", + "markdown": "Reports `TestNG` data providers with equal names if `org.testng.TestNGException` has occurred.\n\nExample:\n\n\n public class DuplicatedDataProviders {\n @DataProvider\n public Object[][] intTestData() { // duplicate 1\n return new Integer[][]{\n new Integer[]{1, 1},\n };\n }\n\n @DataProvider(name = \"intTestData\")\n public Object[][] someTestData() { // duplicate 2\n return new Integer[][]{\n new Integer[]{1, 1},\n };\n }\n\n @Test(dataProvider = \"intTestData\")\n public void testIsOK(Integer key, Integer value) {\n assertEquals(key, value);\n }\n }\n\n\nInspection ID: DuplicatedDataProviderNames" + }, + "defaultConfiguration": { + "enabled": true, + "level": "error", + "parameters": { + "suppressToolId": "DuplicatedDataProviderNames", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "dependsOnMethodTestNG", + "shortDescription": { + "text": "Illegal method name passed to 'dependsOnMethods'" + }, + "fullDescription": { + "text": "Reports illegal method names passed to the 'dependsOnMethods' attribute in the '@Test' annotation. A method name is considered illegal if it can't be resolved into a valid, accessible '@Test' annotated method in the current class or any of its parent classes. Example: 'public class SampleTest {\n @Test(dependsOnMethods = \"testSpellignError\")\n public void testSample() {}\n @Test\n public void testSpellingError(){}\n }' Inspection ID: dependsOnMethodTestNG", + "markdown": "Reports illegal method names passed to the `dependsOnMethods` attribute in the `@Test` annotation.\n\nA method name is considered illegal if it can't be resolved into a valid, accessible `@Test` annotated method in the current class\nor any of its parent classes.\n\nExample:\n\n\n public class SampleTest {\n @Test(dependsOnMethods = \"testSpellignError\")\n public void testSample() {}\n @Test\n public void testSpellingError(){}\n }\n\nInspection ID: dependsOnMethodTestNG" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "dependsOnMethodTestNG", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MalformedDataProvider", + "shortDescription": { + "text": "Data provider problems" + }, + "fullDescription": { + "text": "Reports references to data provider methods that do not exist or are not accessible. Example: 'public class InstanceDataProviderFromForeignClass {\n // method data() doesn't exist in class A\n @Test(dataProvider = \"data\", dataProviderClass = A.class)\n public void test() {\n }\n}\nclass A { }' After the quick-fix is applied: '//the needed data() method is created in class A\nclass A {\n @DataProvider\n public Object[][] data() {\n return new Object[][]{};\n }\n}' Inspection ID: MalformedDataProvider", + "markdown": "Reports references to data provider methods that do not exist or are not accessible.\n\nExample:\n\n\n public class InstanceDataProviderFromForeignClass {\n // method data() doesn't exist in class A\n @Test(dataProvider = \"data\", dataProviderClass = A.class)\n public void test() {\n }\n }\n class A { }\n\nAfter the quick-fix is applied:\n\n\n //the needed data() method is created in class A\n class A {\n @DataProvider\n public Object[][] data() {\n return new Object[][]{};\n }\n }\n\nInspection ID: MalformedDataProvider" + }, + "defaultConfiguration": { + "enabled": true, + "level": "warning", + "parameters": { + "suppressToolId": "MalformedDataProvider", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Java/TestNG", + "index": 73, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "JUnit", + "version": "252.28459.0", + "rules": [ + { + "id": "MultipleExceptionsDeclaredOnTestMethod", + "shortDescription": { + "text": "Multiple exceptions declared on test method" + }, + "fullDescription": { + "text": "Reports JUnit test method 'throws' clauses with more than one exception. Such clauses are unnecessarily verbose. Test methods will not be called from other project code, so there is no need to handle these exceptions separately. For example: '@Test\n public void testReflection() throws NoSuchMethodException,\n InvocationTargetException, IllegalAccessException {\n String result = (String) String.class.getMethod(\"trim\")\n .invoke(\" hello \");\n assertEquals(\"hello\", result);\n }' A quick fix is provided to replace the exception declarations with a single exception: '@Test\n public void testReflection() throws Exception {\n String result = (String) String.class.getMethod(\"trim\")\n .invoke(\" hello \");\n assertEquals(\"hello\", result);\n }' Inspection ID: MultipleExceptionsDeclaredOnTestMethod", + "markdown": "Reports JUnit test method `throws` clauses with more than one exception. Such clauses are unnecessarily verbose. Test methods will not be called from other project code, so there is no need to handle these exceptions separately.\n\nFor example:\n\n\n @Test\n public void testReflection() throws NoSuchMethodException,\n InvocationTargetException, IllegalAccessException {\n String result = (String) String.class.getMethod(\"trim\")\n .invoke(\" hello \");\n assertEquals(\"hello\", result);\n }\n\nA quick fix is provided to replace the exception declarations with a single exception:\n\n\n @Test\n public void testReflection() throws Exception {\n String result = (String) String.class.getMethod(\"trim\")\n .invoke(\" hello \");\n assertEquals(\"hello\", result);\n }\n\nInspection ID: MultipleExceptionsDeclaredOnTestMethod" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MultipleExceptionsDeclaredOnTestMethod", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ExpectedExceptionNeverThrown", + "shortDescription": { + "text": "Expected exception never thrown in test method body" + }, + "fullDescription": { + "text": "Reports checked exceptions expected by a JUnit 4 test-method that are never thrown inside the method body. Such test methods will never succeed. Example: '@Test(expected = CloneNotSupportedException.class)\n public void testIt() { }' Inspection ID: ExpectedExceptionNeverThrown", + "markdown": "Reports checked exceptions expected by a JUnit 4 test-method that are never thrown inside the method body. Such test methods will never succeed.\n\n**Example:**\n\n\n @Test(expected = CloneNotSupportedException.class)\n public void testIt() { }\n\nInspection ID: ExpectedExceptionNeverThrown" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ExpectedExceptionNeverThrown", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UseOfObsoleteAssert", + "shortDescription": { + "text": "Usage of obsolete 'junit.framework.Assert' method" + }, + "fullDescription": { + "text": "Reports any calls to methods from the 'junit.framework.Assert' class. This class is obsolete and the calls can be replaced by calls to methods from the 'org.junit.Assert' class. For example: 'import org.junit.*;\n public class NecessaryTest {\n @Test\n public void testIt() {\n junit.framework.Assert.assertEquals(\"expected\", \"actual\");\n }\n }' After the quick fix is applied, the result looks like the following: 'import org.junit;\n public class NecessaryTest {\n\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }' Inspection ID: UseOfObsoleteAssert", + "markdown": "Reports any calls to methods from the `junit.framework.Assert` class. This class is obsolete and the calls can be replaced by calls to methods from the `org.junit.Assert` class.\n\nFor example:\n\n\n import org.junit.*;\n public class NecessaryTest {\n @Test\n public void testIt() {\n junit.framework.Assert.assertEquals(\"expected\", \"actual\");\n }\n }\n\nAfter the quick fix is applied, the result looks like the following:\n\n\n import org.junit;\n public class NecessaryTest {\n\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }\n\n\nInspection ID: UseOfObsoleteAssert" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseOfObsoleteAssert", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JUnitMixedFramework", + "shortDescription": { + "text": "JUnit API usage from multiple versions in a single TestCase" + }, + "fullDescription": { + "text": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case. Example (JUnit 4 annotation in JUnit 3 test case): 'public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }' After the quick-fix is applied: 'public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }' Example (JUnit 5 annotation in JUnit 4 test case): 'public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }' After the quick-fix is applied: 'public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }' Inspection ID: JUnitMixedFramework", + "markdown": "Reports JUnit annotated methods when used in a test case from a different JUnit version. To determine the framework version for a test case the inspection checks the framework version of the super class when available. When a super class is not available it will use the most used framework in the test case.\n\nExample (JUnit 4 annotation in JUnit 3 test case):\n\n\n public class MyTest extends TestCase {\n @Test\n public void foo() { }\n\n @Test\n @Ignore\n public void testBar() { }\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest extends TestCase {\n public void testFoo() {}\n\n public void _testBar() {}\n }\n\nExample (JUnit 5 annotation in JUnit 4 test case):\n\n\n public class MyTest {\n @BeforeAll // JUnit 5 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n\nAfter the quick-fix is applied:\n\n\n public class MyTest {\n @BeforeClass // JUnit 4 lifecycle method\n public void initialize() { }\n\n @org.junit.Test // JUnit 4 test annotation\n public void test() {}\n\n @org.junit.Test // JUnit 4 test annotation\n public void testWouldBeExecuted() {}\n }\n\nInspection ID: JUnitMixedFramework" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JUnitMixedFramework", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JUnit3StyleTestMethodInJUnit4Class", + "shortDescription": { + "text": "Old style JUnit test method in JUnit 4 class" + }, + "fullDescription": { + "text": "Reports JUnit 3 style test methods that are located inside a class that does not extend the JUnit 3 'TestCase' class and contains JUnit 4 or JUnit 5 '@Test' annotated methods. Such test methods cannot be run. Inspection ID: JUnit3StyleTestMethodInJUnit4Class", + "markdown": "Reports JUnit 3 style test methods that are located inside a class that does not extend the JUnit 3 `TestCase` class and contains JUnit 4 or JUnit 5 `@Test` annotated methods. Such test methods cannot be run.\n\nInspection ID: JUnit3StyleTestMethodInJUnit4Class" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JUnit3StyleTestMethodInJUnit4Class", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssertEqualsMayBeAssertSame", + "shortDescription": { + "text": "'assertEquals()' may be 'assertSame()'" + }, + "fullDescription": { + "text": "Reports JUnit 'assertEquals()' calls that can be replaced with an equivalent 'assertSame()' call. This is possible when the arguments are instances of a 'final' class that does not override the 'Object.equals()' method and makes it explicit that the object identity is compared. Suggests replacing 'assertEquals()' with 'assertSame()'. Example: '@Test\n public void testObjectType() {\n Object o = getObject();\n Assert.assertEquals(String.class, o.getClass());\n }' After the quick fix is applied: '@Test\n public void testSort() {\n Object o = getObject();\n Assert.assertSame(String.class, o.getClass());\n }' Inspection ID: AssertEqualsMayBeAssertSame", + "markdown": "Reports JUnit `assertEquals()` calls that can be replaced with an equivalent `assertSame()` call. This is possible when the arguments are instances of a `final` class that does not override the `Object.equals()` method and makes it explicit that the object identity is compared.\n\nSuggests replacing `assertEquals()` with `assertSame()`.\n\n**Example:**\n\n\n @Test\n public void testObjectType() {\n Object o = getObject();\n Assert.assertEquals(String.class, o.getClass());\n }\n\nAfter the quick fix is applied:\n\n\n @Test\n public void testSort() {\n Object o = getObject();\n Assert.assertSame(String.class, o.getClass());\n }\n\nInspection ID: AssertEqualsMayBeAssertSame" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssertEqualsMayBeAssertSame", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "SuperTearDownInFinally", + "shortDescription": { + "text": "JUnit 3 'super.tearDown()' is not called from 'finally' block" + }, + "fullDescription": { + "text": "Reports calls of the JUnit 3's 'super.tearDown()' method that are not performed inside a 'finally' block. If an exception is thrown before 'super.tearDown()' is called it could lead to inconsistencies and leaks. Example: 'public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n Files.delete(path);\n super.tearDown();\n }\n }' Improved code: 'public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n try {\n Files.delete(path);\n } finally {\n super.tearDown();\n }\n }\n }' Inspection ID: SuperTearDownInFinally", + "markdown": "Reports calls of the JUnit 3's `super.tearDown()` method that are not performed inside a `finally` block. If an exception is thrown before `super.tearDown()` is called it could lead to inconsistencies and leaks.\n\n**Example:**\n\n\n public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n Files.delete(path);\n super.tearDown();\n }\n }\n\nImproved code:\n\n\n public class AnotherTest extends CompanyTestCase {\n private Path path;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n path = Files.createTempFile(\"File\", \".tmp\");\n }\n\n @Override\n protected void tearDown() throws Exception {\n try {\n Files.delete(path);\n } finally {\n super.tearDown();\n }\n }\n }\n\nInspection ID: SuperTearDownInFinally" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "SuperTearDownInFinally", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JUnitMalformedDeclaration", + "shortDescription": { + "text": "JUnit malformed declaration" + }, + "fullDescription": { + "text": "Reports JUnit test member declarations that are malformed and are likely not recognized by the JUnit test framework. The following problems are reported by this inspection: Test classes that can't be constructed Fields annotated by '@RegisterExtension' that have the wrong type or are not declared as static when it is required Static or private inner classes annotated with '@Nested' Parameterized tests that are defined without a source Parameterized tests with a '@MethodSource' that has an unknown, non-static or no-arg target Mismatched types between parameterized test method parameter and the specified '@ValueSource' or '@EnumSource' values Tests that are annotated by more than one of '@Test', '@ParameterizedTest' or '@RepeatedTest' 'setup()' or 'tearDown()' methods that are not public, whose return type is not void or take arguments 'suite()' methods that are private, take arguments or are not static Methods annotated by '@BeforeClass', '@AfterClass', '@BeforeAll' or '@AfterAll' that are not public, not static, whose return type is not void or do not have a valid parameter list Methods annotated by '@Before', '@After', '@BeforeEach' or '@AfterEach' that are not public, whose return type is not void or take arguments Injected 'RepetitionInfo' in '@BeforeAll' or '@AfterAll' methods Injected 'RepetitionInfo' in '@BeforeEach' or '@AfterEach' methods that are used by '@Test' annotated tests Fields and methods annotated by '@DataPoint' or '@DataPoints' that are not public or not static Fields and methods annotated by '@Rule' that are not public or not a subtype of 'TestRule' or 'MethodRule' Fields and methods annotated by '@ClassRule' that are not public, not static or not a subtype of 'TestRule' Methods inside a subclass of 'TestCase' with a 'test' prefix that are not public, whose return type is not void, take arguments or are static Methods annotated by '@Test' that are not public, whose return type is not void, take arguments or are static Note that in Kotlin, suspending functions do have arguments and a non-void return type. Therefore, they also will not be executed by the JUnit test runner. This inspection will also report about this problem. Malformed '@Before' method example: '@Before private int foo(int arg) { }' After the quick-fix is applied: '@Before public void foo() { }' Missing method source example (Kotlin): 'class Example {\n @MethodSource(\"parameters\")\n @ParameterizedTest\n fun foo(param: String) { ... }\n }' After the quick-fix is applied: 'class Example {\n @MethodSource(\"parameters\")\n @ParameterizedTest\n fun foo(param: String) { ... }\n\n companion object {\n @JvmStatic\n fun parameters(): Stream {\n TODO(\"Not yet implemented\")\n }\n }\n }' Use the inspection options to specify annotations. Any parameter annotated with one of these annotations will not be reported. Inspection ID: JUnitMalformedDeclaration", + "markdown": "Reports JUnit test member declarations that are malformed and are likely not recognized by the JUnit test framework. The following problems are reported by this inspection:\n\n* Test classes that can't be constructed\n* Fields annotated by `@RegisterExtension` that have the wrong type or are not declared as static when it is required\n* Static or private inner classes annotated with `@Nested`\n* Parameterized tests that are defined without a source\n* Parameterized tests with a `@MethodSource` that has an unknown, non-static or no-arg target\n* Mismatched types between parameterized test method parameter and the specified `@ValueSource` or `@EnumSource` values\n* Tests that are annotated by more than one of `@Test`, `@ParameterizedTest` or `@RepeatedTest`\n* `setup()` or `tearDown()` methods that are not public, whose return type is not void or take arguments\n* `suite()` methods that are private, take arguments or are not static\n* Methods annotated by `@BeforeClass`, `@AfterClass`, `@BeforeAll` or `@AfterAll` that are not public, not static, whose return type is not void or do not have a valid parameter list\n* Methods annotated by `@Before`, `@After`, `@BeforeEach` or `@AfterEach` that are not public, whose return type is not void or take arguments\n* Injected `RepetitionInfo` in `@BeforeAll` or `@AfterAll` methods\n* Injected `RepetitionInfo` in `@BeforeEach` or `@AfterEach` methods that are used by `@Test` annotated tests\n* Fields and methods annotated by `@DataPoint` or `@DataPoints` that are not public or not static\n* Fields and methods annotated by `@Rule` that are not public or not a subtype of `TestRule` or `MethodRule`\n* Fields and methods annotated by `@ClassRule` that are not public, not static or not a subtype of `TestRule`\n* Methods inside a subclass of `TestCase` with a `test` prefix that are not public, whose return type is not void, take arguments or are static\n* Methods annotated by `@Test` that are not public, whose return type is not void, take arguments or are static\n\nNote that in Kotlin, suspending functions do have arguments and a non-void return type. Therefore, they also will not be executed by the JUnit test runner. This inspection will also report about this problem.\n\n**Malformed `@Before` method example:**\n\n\n @Before private int foo(int arg) { }\n\nAfter the quick-fix is applied:\n\n\n @Before public void foo() { }\n\n**Missing method source example (Kotlin):**\n\n\n class Example {\n @MethodSource(\"parameters\")\n @ParameterizedTest\n fun foo(param: String) { ... }\n }\n\nAfter the quick-fix is applied:\n\n\n class Example {\n @MethodSource(\"parameters\")\n @ParameterizedTest\n fun foo(param: String) { ... }\n\n companion object {\n @JvmStatic\n fun parameters(): Stream {\n TODO(\"Not yet implemented\")\n }\n }\n }\n\nUse the inspection options to specify annotations. Any parameter annotated with one of these annotations will not be reported.\n\nInspection ID: JUnitMalformedDeclaration" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JUnitMalformedDeclaration", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AssertEqualsCalledOnArray", + "shortDescription": { + "text": "'assertEquals()' called on array" + }, + "fullDescription": { + "text": "Reports JUnit 'assertEquals()' calls with arguments of an array type. Such methods compare the arrays' identities instead of the arrays' contents. Array contents should be checked with the 'assertArrayEquals()' method. Example: '@Test\n public void testSort() {\n int[] actual = {248, 496, 0, 56};\n Arrays.sort(actual);\n Assert.assertEquals(new int[] {0, 56, 248, 496}, actual);\n }' After the quick-fix is applied: '@Test\n public void testSort() {\n int[] actual = {248, 496, 0, 56};\n Arrays.sort(actual);\n Assert.assertArrayEquals(new int[] {0, 56, 248, 496}, actual);\n }' Inspection ID: AssertEqualsCalledOnArray", + "markdown": "Reports JUnit `assertEquals()` calls with arguments of an array type. Such methods compare the arrays' identities instead of the arrays' contents. Array contents should be checked with the `assertArrayEquals()` method.\n\n**Example:**\n\n\n @Test\n public void testSort() {\n int[] actual = {248, 496, 0, 56};\n Arrays.sort(actual);\n Assert.assertEquals(new int[] {0, 56, 248, 496}, actual);\n }\n\nAfter the quick-fix is applied:\n\n\n @Test\n public void testSort() {\n int[] actual = {248, 496, 0, 56};\n Arrays.sort(actual);\n Assert.assertArrayEquals(new int[] {0, 56, 248, 496}, actual);\n }\n\n\nInspection ID: AssertEqualsCalledOnArray" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "AssertEqualsCalledOnArray", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JUnit5AssertionsConverter", + "shortDescription": { + "text": "JUnit 5 obsolete assertions" + }, + "fullDescription": { + "text": "Reports any calls to methods from the 'junit.framework.Assert', 'org.junit.Assert', or 'org.junit.Assume' classes inside JUnit 5 tests. Although the tests work properly, migration to 'org.junit.jupiter.api.Assertions'/'org.junit.jupiter.api.Assumptions' will help you avoid dependencies on old JUnit version. Example: 'import org.junit.Assert;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assert.assertEquals(4, 2 + 2);\n }\n }' After the quick-fix is applied: 'import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assertions.assertEquals(4, 2 + 2);\n }\n }' Inspection ID: JUnit5AssertionsConverter", + "markdown": "Reports any calls to methods from the `junit.framework.Assert`, `org.junit.Assert`, or `org.junit.Assume`\nclasses inside JUnit 5 tests.\n\nAlthough the tests work properly, migration to `org.junit.jupiter.api.Assertions`/`org.junit.jupiter.api.Assumptions`\nwill help you avoid dependencies on old JUnit version.\n\n**Example:**\n\n\n import org.junit.Assert;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assert.assertEquals(4, 2 + 2);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class MyTest {\n @Test\n public void simpleTest() {\n Assertions.assertEquals(4, 2 + 2);\n }\n }\n\nInspection ID: JUnit5AssertionsConverter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JUnit5AssertionsConverter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "ParameterizedParametersStaticCollection", + "shortDescription": { + "text": "Parameterized test class without data provider method" + }, + "fullDescription": { + "text": "Reports JUnit 4 parameterized test classes that are annotated with '@RunWith(Parameterized.class)' but either do not include a data provider method annotated with '@Parameterized.Parameters' or this method has an incorrect signature. Such test classes cannot be run. The data provider method should be 'public' and 'static' and have a return type of 'Iterable' or 'Object[]'. Suggests creating an empty parameter provider method or changing the signature of the incorrect data provider method. Example: '@RunWith(Parameterized.class)\n public class ImportantTest {\n private int input;\n private int expected;\n\n ImportantTest(int input, int expected) {\n this.input = input;\n this.expected = expected;\n }\n\n // ... test cases\n }' After the quick-fix is applied: '@RunWith(Parameterized.class)\n public class ImportantTest {\n private int input;\n private int expected;\n\n ImportantTest(int input, int expected) {\n this.input = input;\n this.expected = expected;\n }\n\n @Parameters\n public static Iterable parameters() {\n return null;\n }\n\n // ... test cases\n }' Inspection ID: ParameterizedParametersStaticCollection", + "markdown": "Reports JUnit 4 [parameterized test](https://github.com/junit-team/junit4/wiki/parameterized-tests) classes that are annotated with `@RunWith(Parameterized.class)` but either do not include a data provider method annotated with `@Parameterized.Parameters` or this method has an incorrect signature. Such test classes cannot be run. The data provider method should be `public` and `static` and have a return type of `Iterable` or `Object[]`.\n\nSuggests creating an empty parameter provider method or changing the signature of the incorrect data provider method.\n\n**Example:**\n\n\n\n @RunWith(Parameterized.class)\n public class ImportantTest {\n private int input;\n private int expected;\n\n ImportantTest(int input, int expected) {\n this.input = input;\n this.expected = expected;\n }\n\n // ... test cases\n }\n\nAfter the quick-fix is applied:\n\n\n @RunWith(Parameterized.class)\n public class ImportantTest {\n private int input;\n private int expected;\n\n ImportantTest(int input, int expected) {\n this.input = input;\n this.expected = expected;\n }\n\n @Parameters\n public static Iterable parameters() {\n return null;\n }\n\n // ... test cases\n }\n\nInspection ID: ParameterizedParametersStaticCollection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "ParameterizedParametersStaticCollection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Junit4RunWithInspection", + "shortDescription": { + "text": "'@RunWith' annotation already exists in a parent class" + }, + "fullDescription": { + "text": "Reports when parent and child classes in a JUnit test hierarchy are annotated with '@RunWith'. It can lead to unexpected testing behavior. Example: '@RunWith(Suite.class)\n @SuiteClasses(MySuiteClass.class)\n public abstract Parent {\n }\n\n @RunWith(Parameterized.class)\n public MyTest {\n }' New in 2024.1 Inspection ID: Junit4RunWithInspection", + "markdown": "Reports when parent and child classes in a JUnit test hierarchy are annotated with `@RunWith`. It can lead to unexpected testing behavior.\n\n**Example:**\n\n\n @RunWith(Suite.class)\n @SuiteClasses(MySuiteClass.class)\n public abstract Parent {\n }\n\n @RunWith(Parameterized.class)\n public MyTest {\n }\n\n\nNew in 2024.1\n\nInspection ID: Junit4RunWithInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "Junit4RunWithInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JUnit5Converter", + "shortDescription": { + "text": "JUnit 4 test can be JUnit 5" + }, + "fullDescription": { + "text": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes. Example: 'import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }' After the quick-fix is applied: 'import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }' This inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project. Inspection ID: JUnit5Converter", + "markdown": "Reports JUnit 4 tests that can be automatically migrated to JUnit 5. While default runners are automatically convertible, custom runners, method- and field- rules are not and require manual changes.\n\n**Example:**\n\n\n import org.junit.Assert;\n import org.junit.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }\n\nAfter the quick-fix is applied:\n\n\n import org.junit.jupiter.api.Assertions;\n import org.junit.jupiter.api.Test;\n\n public class RelevantTest {\n @Test\n public void testIt() {\n Assertions.assertEquals(\"expected\", \"actual\");\n }\n }\n\nThis inspection requires that the JUnit 5 library is available in the classpath, and JDK 1.8 or later is configured for the project.\n\nInspection ID: JUnit5Converter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JUnit5Converter", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "Junit4Converter", + "shortDescription": { + "text": "JUnit 3 test can be JUnit 4" + }, + "fullDescription": { + "text": "Reports JUnit 3 test classes that can be converted to JUnit 4 test classes. Example: 'public class MainTestCase extends junit.framework.TestCase {\n public void test() {\n Assert.assertTrue(true);\n }\n }' After the quick-fix is applied: 'public class MainTestCase {\n @org.junit.Test\n public void test() {\n Assert.assertTrue(true);\n }\n }' This inspection only reports if the language level of the project or module is 5 or higher, and JUnit 4 is available on the classpath. Inspection ID: Junit4Converter", + "markdown": "Reports JUnit 3 test classes that can be converted to JUnit 4 test classes.\n\n**Example:**\n\n\n public class MainTestCase extends junit.framework.TestCase {\n public void test() {\n Assert.assertTrue(true);\n }\n }\n\nAfter the quick-fix is applied:\n\n\n public class MainTestCase {\n @org.junit.Test\n public void test() {\n Assert.assertTrue(true);\n }\n }\n\nThis inspection only reports if the language level of the project or module is 5 or higher, and JUnit 4 is available on the classpath.\n\nInspection ID: Junit4Converter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "Junit4Converter", + "ideaSeverity": "INFORMATION", + "qodanaSeverity": "Info", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "IgnoredJUnitTest", + "shortDescription": { + "text": "JUnit test annotated with '@Ignore'/'@Disabled'" + }, + "fullDescription": { + "text": "Reports usages of JUnit 4's '@Ignore' or JUnit 5's '@Disabled' annotations. It is considered a code smell to have tests annotated with these annotations for a long time, especially when no reason is specified. Example: '@Ignore\n public class UrgentTest {\n\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }' Configure the inspection: Use the Only report annotations without reason option to only report the cases when no reason is specified as the annotation's 'value' attribute. Inspection ID: IgnoredJUnitTest", + "markdown": "Reports usages of JUnit 4's `@Ignore` or JUnit 5's `@Disabled` annotations. It is considered a code smell to have tests annotated with these annotations for a long time, especially when no reason is specified.\n\n**Example:**\n\n\n @Ignore\n public class UrgentTest {\n\n @Test\n public void testIt() {\n Assert.assertEquals(\"expected\", \"actual\");\n }\n }\n\n\nConfigure the inspection:\n\n* Use the **Only report annotations without reason** option to only report the cases when no reason is specified as the annotation's `value` attribute.\n\nInspection ID: IgnoredJUnitTest" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "IgnoredJUnitTest", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MigrateAssertToMatcherAssert", + "shortDescription": { + "text": "JUnit assertion can be 'assertThat()' call" + }, + "fullDescription": { + "text": "Reports calls to 'Assert.assertEquals()', 'Assert.assertTrue()', etc. methods which can be migrated to Hamcrest declarative style 'Assert.assertThat()' calls. For example: 'public class SubstantialTest {\n @Test\n public void testContents(Collection c, String s) {\n Assert.assertTrue(c.contains(s));\n Assert.assertEquals(c, s);\n Assert.assertNotNull(c);\n Assert.assertNull(c);\n Assert.assertFalse(c.contains(s));\n }\n }' A quick-fix is provided to perform the migration: 'public class SubstantialTest {\n @Test\n public void testContents(Collection c, String s) {\n assertThat(c, hasItem(o));\n assertThat(o, is(c));\n assertThat(c, notNullValue());\n assertThat(c, nullValue());\n assertThat(c, not(hasItem(o)));\n }\n }' This inspection requires that the Hamcrest library is available on the classpath. Use the Statically import matcher's methods option to specify if you want the quick-fix to statically import the Hamcrest matcher methods. Inspection ID: MigrateAssertToMatcherAssert", + "markdown": "Reports calls to `Assert.assertEquals()`, `Assert.assertTrue()`, etc. methods which can be migrated to Hamcrest declarative style `Assert.assertThat()` calls.\n\nFor example:\n\n\n public class SubstantialTest {\n @Test\n public void testContents(Collection c, String s) {\n Assert.assertTrue(c.contains(s));\n Assert.assertEquals(c, s);\n Assert.assertNotNull(c);\n Assert.assertNull(c);\n Assert.assertFalse(c.contains(s));\n }\n }\n\nA quick-fix is provided to perform the migration:\n\n\n public class SubstantialTest {\n @Test\n public void testContents(Collection c, String s) {\n assertThat(c, hasItem(o));\n assertThat(o, is(c));\n assertThat(c, notNullValue());\n assertThat(c, nullValue());\n assertThat(c, not(hasItem(o)));\n }\n }\n\nThis inspection requires that the Hamcrest library is available on the classpath.\n\nUse the **Statically import matcher's methods** option to specify if you want the quick-fix to statically import the Hamcrest matcher methods.\n\nInspection ID: MigrateAssertToMatcherAssert" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MigrateAssertToMatcherAssert", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JUnit", + "index": 74, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.properties", + "version": "252.28459.0", + "rules": [ + { + "id": "UseEllipsisInPropertyInspection", + "shortDescription": { + "text": "Three dot characters instead of the ellipsis" + }, + "fullDescription": { + "text": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files. Inspection ID: UseEllipsisInPropertyInspection", + "markdown": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files.\n\nInspection ID: UseEllipsisInPropertyInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UseEllipsisInPropertyInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "AlphaUnsortedPropertiesFile", + "shortDescription": { + "text": "Properties file or resource bundle is alphabetically unsorted" + }, + "fullDescription": { + "text": "Reports alphabetically unsorted resource bundles or .properties files. Inspection ID: AlphaUnsortedPropertiesFile", + "markdown": "Reports alphabetically unsorted resource bundles or .properties files.\n\nInspection ID: AlphaUnsortedPropertiesFile" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "AlphaUnsortedPropertiesFile", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "TrailingSpacesInProperty", + "shortDescription": { + "text": "Trailing spaces in property" + }, + "fullDescription": { + "text": "Reports properties whose keys or values end with a whitespace. Inspection ID: TrailingSpacesInProperty", + "markdown": "Reports properties whose keys or values end with a whitespace.\n\nInspection ID: TrailingSpacesInProperty" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "TrailingSpacesInProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "UnusedProperty", + "shortDescription": { + "text": "Unused property" + }, + "fullDescription": { + "text": "Reports properties that are not referenced outside of the .properties file they are contained in. Inspection ID: UnusedProperty", + "markdown": "Reports properties that are not referenced outside of the .properties file they are contained in.\n\nInspection ID: UnusedProperty" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "UnusedProperty", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "WrongPropertyKeyValueDelimiter", + "shortDescription": { + "text": "Property key/value delimiter doesn't match code style settings" + }, + "fullDescription": { + "text": "Reports properties in which key or value delimiters do not match code style settings. Inspection ID: WrongPropertyKeyValueDelimiter", + "markdown": "Reports properties in which key or value delimiters do not match code style settings.\n\nInspection ID: WrongPropertyKeyValueDelimiter" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "WrongPropertyKeyValueDelimiter", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicatePropertyInspection", + "shortDescription": { + "text": "Duplicate property" + }, + "fullDescription": { + "text": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values. Example: 'property1=value;\nproperty2=value;' The Options list allows selecting the area in which the inspection should search for duplicates. Inspection ID: DuplicatePropertyInspection", + "markdown": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values.\n\nExample:\n\n\n property1=value;\n property2=value;\n\nThe **Options** list allows selecting the area in which the inspection should search for duplicates.\n\nInspection ID: DuplicatePropertyInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicatePropertyInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "Properties files", + "index": 32, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.uiDesigner", + "version": "252.28459.0", + "rules": [ + { + "id": "NoLabelFor", + "shortDescription": { + "text": "No label for component" + }, + "fullDescription": { + "text": "Reports components that do not have any static text and do not have any label marked with 'setLabelFor' for this component. Components that do not have static text include edit fields and combo boxes. Such components cannot be activated with a keyboard shortcut. The quick-fix for this inspection allows you to automatically associate an adjacent label with the problematic component. Inspection ID: NoLabelFor", + "markdown": "Reports components that do not have any static text and do not have any label marked with `setLabelFor` for this component.\n\nComponents that do not have static text include edit fields and combo boxes.\nSuch components cannot be activated with a keyboard shortcut. The quick-fix for this inspection\nallows you to automatically associate an adjacent label with the problematic component.\n\nInspection ID: NoLabelFor" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NoLabelFor", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "InvalidPropertyKeyForm", + "shortDescription": { + "text": "Invalid property key in a UI form" + }, + "fullDescription": { + "text": "Reports unresolved references to .properties files. Inspection ID: InvalidPropertyKeyForm", + "markdown": "Reports unresolved references to .properties files.\n\nInspection ID: InvalidPropertyKeyForm" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "InvalidPropertyKeyForm", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "MissingMnemonic", + "shortDescription": { + "text": "Missing mnemonics" + }, + "fullDescription": { + "text": "Reports focusable components with the 'text' property or labels with the assigned 'labelFor' property that do not have a mnemonic character. The quick-fix assigns a unique mnemonic to such a component. Inspection ID: MissingMnemonic", + "markdown": "Reports focusable components with the `text` property or labels with the assigned `labelFor` property that do not have a mnemonic character. The quick-fix assigns a unique mnemonic to such a component.\n\nInspection ID: MissingMnemonic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "MissingMnemonic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "OneButtonGroup", + "shortDescription": { + "text": "Button group with one button" + }, + "fullDescription": { + "text": "Reports 'ButtonGroup' instances that contain only one 'JRadioButton'. Inspection ID: OneButtonGroup", + "markdown": "Reports `ButtonGroup` instances that contain only one `JRadioButton`.\n\nInspection ID: OneButtonGroup" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "OneButtonGroup", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NoScrollPane", + "shortDescription": { + "text": "Scrollable component not in JScrollPane" + }, + "fullDescription": { + "text": "Reports 'Scrollable' components, except for 'JTextField', that are not placed in 'JScrollPane'. The quick-fix surrounds the problematic component with a scroll pane. Inspection ID: NoScrollPane", + "markdown": "Reports `Scrollable` components, except for `JTextField`, that are not placed in `JScrollPane`. The quick-fix surrounds the problematic component with a scroll pane.\n\nInspection ID: NoScrollPane" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NoScrollPane", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "FormSpellChecking", + "shortDescription": { + "text": "Typo in a UI form" + }, + "fullDescription": { + "text": "Reports typos and misspelling in your UI forms (for example, in a 'JLabel' text or 'JPanel' title) and fixes them with one click. Inspection ID: FormSpellChecking", + "markdown": "Reports typos and misspelling in your UI forms (for example, in a `JLabel` text or `JPanel` title) and fixes them\nwith one click.\n\nInspection ID: FormSpellChecking" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "FormSpellChecking", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "DuplicateMnemonic", + "shortDescription": { + "text": "Duplicate mnemonics" + }, + "fullDescription": { + "text": "Reports components that have duplicated mnemonic characters. The quick-fix assigns a unique mnemonic character to each of the components. Inspection ID: DuplicateMnemonic", + "markdown": "Reports components that have duplicated mnemonic characters.\n\nThe quick-fix assigns a unique mnemonic character to each of the components.\n\nInspection ID: DuplicateMnemonic" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "DuplicateMnemonic", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "I18nForm", + "shortDescription": { + "text": "Hardcoded string literal in a UI form" + }, + "fullDescription": { + "text": "Reports any instances of hardcoded strings in your UI forms. Hardcoded string literals are usually errors in an internationalized environment. This inspection does not report empty strings and strings consisting of only whitespace. The quick-fix transforms a string literal into a reference to a property in a resource bundle. Inspection ID: I18nForm", + "markdown": "Reports any instances of hardcoded strings in your UI forms.\n\nHardcoded string literals are usually errors in\nan internationalized environment.\nThis inspection does not report empty strings and strings consisting of only whitespace.\n\nThe quick-fix transforms a string literal\ninto a reference to a property in a resource bundle.\n\nInspection ID: I18nForm" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "I18nForm", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "NoButtonGroup", + "shortDescription": { + "text": "Radio button not in a group" + }, + "fullDescription": { + "text": "Reports 'JRadioButton' components that are not placed in 'ButtonGroup'. A quick-fix is available to group radio buttons placed in adjacent grid cells. Inspection ID: NoButtonGroup", + "markdown": "Reports `JRadioButton` components that are not placed in `ButtonGroup`. A quick-fix is available to group radio buttons placed in adjacent grid cells.\n\nInspection ID: NoButtonGroup" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "NoButtonGroup", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "BoundFieldAssignment", + "shortDescription": { + "text": "Assignment to UI-bound field" + }, + "fullDescription": { + "text": "Reports assignments to fields which are bound to components in UI Designer forms. Such assignments will cause the component setup code generated by UI Designer for such fields to be ignored. Inspection ID: BoundFieldAssignment", + "markdown": "Reports assignments to fields which are bound to components in UI Designer forms.\n\nSuch assignments will cause the component setup code generated by UI Designer\nfor such fields to be ignored.\n\nInspection ID: BoundFieldAssignment" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "BoundFieldAssignment", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "UI form", + "index": 88, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "org.intellij.qodana", + "version": "252.28459.0", + "rules": [ + { + "id": "QodanaJavaSanity", + "shortDescription": { + "text": "Java sanity" + }, + "fullDescription": { + "text": "Reports unresolved references in Java code. Inspection ID: QodanaJavaSanity", + "markdown": "Reports unresolved references in Java code.\n\nInspection ID: QodanaJavaSanity" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "QodanaJavaSanity", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JavaAnnotator", + "shortDescription": { + "text": "Java annotator" + }, + "fullDescription": { + "text": "Allows viewing the problems reported by the Java annotator: compilation problems, unresolved by IDEA references, and so on. Inspection ID: JavaAnnotator", + "markdown": "Allows viewing the problems reported by the Java annotator: compilation problems, unresolved by IDEA references, and so on.\n\nInspection ID: JavaAnnotator" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JavaAnnotator", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "QodanaKotlinSanity", + "shortDescription": { + "text": "Kotlin sanity" + }, + "fullDescription": { + "text": "Reports unresolved references in Kotlin code. Inspection ID: QodanaKotlinSanity", + "markdown": "Reports unresolved references in Kotlin code.\n\nInspection ID: QodanaKotlinSanity" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "QodanaKotlinSanity", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "General", + "index": 44, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "CyclomaticComplexityInspection", + "shortDescription": { + "text": "Code metrics" + }, + "fullDescription": { + "text": "Calculates cyclomatic complexity. Inspection ID: CyclomaticComplexityInspection", + "markdown": "Calculates cyclomatic complexity.\n\nInspection ID: CyclomaticComplexityInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "CyclomaticComplexityInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Qodana", + "index": 126, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JvmLinesOfCodeInspection", + "shortDescription": { + "text": "Calculate Kotlin and Java code metrics" + }, + "fullDescription": { + "text": "Counts the number of code lines. Inspection ID: JvmLinesOfCodeInspection", + "markdown": "Counts the number of code lines.\n\nInspection ID: JvmLinesOfCodeInspection" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JvmLinesOfCodeInspection", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Unspecified" + } + }, + "relationships": [ + { + "target": { + "id": "Code metrics", + "index": 127, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + }, + { + "name": "com.intellij.modules.json", + "version": "252.28459.0", + "rules": [ + { + "id": "Json5StandardCompliance", + "shortDescription": { + "text": "Compliance with JSON5 standard" + }, + "fullDescription": { + "text": "Reports inconsistency with the language specification in a JSON5 file. Inspection ID: Json5StandardCompliance", + "markdown": "Reports inconsistency with [the language specification](http://json5.org) in a JSON5 file.\n\nInspection ID: Json5StandardCompliance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "Json5StandardCompliance", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 111, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonSchemaCompliance", + "shortDescription": { + "text": "Compliance with JSON schema" + }, + "fullDescription": { + "text": "Reports inconsistence between a JSON file and the JSON schema that is assigned to it. Inspection ID: JsonSchemaCompliance", + "markdown": "Reports inconsistence between a JSON file and the [JSON schema](https://json-schema.org) that is assigned to it. \n\nInspection ID: JsonSchemaCompliance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsonSchemaCompliance", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 111, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonStandardCompliance", + "shortDescription": { + "text": "Compliance with JSON standard" + }, + "fullDescription": { + "text": "Reports the following discrepancies of a JSON file with the language specification: A line or block comment (configurable). Multiple top-level values (expect for JSON Lines files, configurable for others). A trailing comma in an object or array (configurable). A single quoted string. A property key is a not a double quoted strings. A NaN or Infinity/-Infinity numeric value as a floating point literal (configurable). Inspection ID: JsonStandardCompliance", + "markdown": "Reports the following discrepancies of a JSON file with [the language specification](https://tools.ietf.org/html/rfc7159):\n\n* A line or block comment (configurable).\n* Multiple top-level values (expect for JSON Lines files, configurable for others).\n* A trailing comma in an object or array (configurable).\n* A single quoted string.\n* A property key is a not a double quoted strings.\n* A NaN or Infinity/-Infinity numeric value as a floating point literal (configurable).\n\nInspection ID: JsonStandardCompliance" + }, + "defaultConfiguration": { + "enabled": false, + "level": "error", + "parameters": { + "suppressToolId": "JsonStandardCompliance", + "ideaSeverity": "ERROR", + "qodanaSeverity": "Critical", + "codeQualityCategory": "Code Style" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 111, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonSchemaDeprecation", + "shortDescription": { + "text": "Deprecated JSON property" + }, + "fullDescription": { + "text": "Reports a deprecated property in a JSON file. Note that deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard extension 'deprecationMessage'. Inspection ID: JsonSchemaDeprecation", + "markdown": "Reports a deprecated property in a JSON file. \nNote that deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard extension 'deprecationMessage'.\n\nInspection ID: JsonSchemaDeprecation" + }, + "defaultConfiguration": { + "enabled": false, + "level": "note", + "parameters": { + "suppressToolId": "JsonSchemaDeprecation", + "ideaSeverity": "WEAK WARNING", + "qodanaSeverity": "Moderate", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 111, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonSchemaRefReference", + "shortDescription": { + "text": "Unresolved '$ref' and '$schema' references" + }, + "fullDescription": { + "text": "Reports an unresolved '$ref' or '$schema' path in a JSON schema. Inspection ID: JsonSchemaRefReference", + "markdown": "Reports an unresolved `$ref` or `$schema` path in a JSON schema. \n\nInspection ID: JsonSchemaRefReference" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsonSchemaRefReference", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Sanity" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 111, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + }, + { + "id": "JsonDuplicatePropertyKeys", + "shortDescription": { + "text": "Duplicate keys in object literals" + }, + "fullDescription": { + "text": "Reports a duplicate key in an object literal. Inspection ID: JsonDuplicatePropertyKeys", + "markdown": "Reports a duplicate key in an object literal.\n\nInspection ID: JsonDuplicatePropertyKeys" + }, + "defaultConfiguration": { + "enabled": false, + "level": "warning", + "parameters": { + "suppressToolId": "JsonDuplicatePropertyKeys", + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "codeQualityCategory": "Reliability" + } + }, + "relationships": [ + { + "target": { + "id": "JSON and JSON5", + "index": 111, + "toolComponent": { + "name": "QDJVMC" + } + }, + "kinds": [ + "superset" + ] + } + ] + } + ], + "language": "en-US", + "contents": [ + "localizedData", + "nonLocalizedData" + ], + "isComprehensive": false + } + ] + }, + "invocations": [ + { + "startTimeUtc": "2026-02-03T13:06:34.929178525Z", + "exitCode": 0, + "executionSuccessful": true + } + ], + "language": "en-US", + "versionControlProvenance": [ + { + "repositoryUri": "https://github.com/BuildTheEarth/BuildTeamTools.git", + "revisionId": "e52a4dc38ec0887426b8efb2ff324c2198b2b3ab", + "branch": "build", + "properties": { + "repoUrl": "https://github.com/BuildTheEarth/BuildTeamTools.git", + "lastAuthorName": "Zoriot", + "vcsType": "Git", + "lastAuthorEmail": "zoriot@proton.me" + } + } + ], + "results": [ + { + "ruleId": "AutoCloseableResource", + "kind": "fail", + "level": "warning", + "message": { + "text": "'Clipboard' used without 'try'-with-resources statement", + "markdown": "'Clipboard' used without 'try'-with-resources statement" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorCollections.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 67, + "startColumn": 37, + "charOffset": 2702, + "charLength": 4, + "snippet": { + "text": "load" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 65, + "startColumn": 1, + "charOffset": 2528, + "charLength": 224, + "snippet": { + "text": " // For FastAsyncWorldEdit\n if(CommonModule.getInstance().getDependencyComponent().isFastAsyncWorldEditEnabled()) {\n clipboard = FaweAPI.load(myFile);\n\n // For Legacy WorldEdit" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "e762721327c61ef4", + "equalIndicator/v1": "1741d56ed4ddc6c002b8e24dbc9970796f16c149497129addf8e264f1cfd486b" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "ConstantValue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Condition 'e.getOffHandItem() == null' is always 'false'", + "markdown": "Condition `e.getOffHandItem() == null` is always `false`" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/navigator/listeners/NavigatorOpenListener.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 64, + "startColumn": 13, + "charOffset": 2278, + "charLength": 26, + "snippet": { + "text": "e.getOffHandItem() == null" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 62, + "startColumn": 1, + "charOffset": 2209, + "charLength": 128, + "snippet": { + "text": " public void swapHands(PlayerSwapHandItemsEvent e) {\n\n if (e.getOffHandItem() == null) {\n return;\n }" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "5e16d170c8bd25ef", + "equalIndicator/v1": "02eb0a9a1335c4293793ddcb034f7694dad702b59839e7af176a93812860c655" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "ConstantValue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Condition 'materials == null' is always 'false'", + "markdown": "Condition `materials == null` is always `false`" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/Settings.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 69, + "startColumn": 24, + "charOffset": 2100, + "charLength": 17, + "snippet": { + "text": "materials == null" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 67, + "startColumn": 1, + "charOffset": 2005, + "charLength": 208, + "snippet": { + "text": " XMaterial[] materials = (XMaterial[]) valueObject;\n\n if(materials == null || materials.length == 0){\n value = null;\n break;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "06c6634691e226e7", + "equalIndicator/v1": "694d3a1493331b414c3484d423faf92ccd7a6fc0ff684685b1d913ee55dde4b3" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "ConstantValue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Condition 'm == null' is always 'false'", + "markdown": "Condition `m == null` is always `false`" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 117, + "startColumn": 25, + "charOffset": 4776, + "charLength": 9, + "snippet": { + "text": "m == null" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 115, + "startColumn": 1, + "charOffset": 4659, + "charLength": 248, + "snippet": { + "text": " if (it == null) continue;\n Material m = it.getType();\n if (m == null || m.isAir() || !m.isBlock()) continue;\n if (seen.add(m)) out.add(new ItemStack(m));\n }" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "9e8b474de5f239d8", + "equalIndicator/v1": "8cbdf157e7b4538ff349e51c58e83789877576a40e5012a2335d838b50a92785" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.PUMPKIN_SEEDS.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.PUMPKIN_SEEDS.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 48, + "startColumn": 42, + "charOffset": 2243, + "charLength": 39, + "snippet": { + "text": "XMaterial.PUMPKIN_SEEDS.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 46, + "startColumn": 1, + "charOffset": 1847, + "charLength": 896, + "snippet": { + "text": " ItemStack potatoItem = Item.create(XMaterial.POTATO.parseMaterial(), \"§bPotato\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack wheatItem = Item.create(XMaterial.WHEAT.parseMaterial(), \"§bWheat\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack cornItem = Item.create(XMaterial.PUMPKIN_SEEDS.parseMaterial(), \"§bCorn\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack vineyardItem = Item.create(XMaterial.VINE.parseMaterial(), \"§bVineyard\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack pearItem = Item.create(XMaterial.SLIME_BALL.parseMaterial(), \"§bPear\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "23d732f50a209a3d", + "equalIndicator/v1": "025775a2b3b6e2fa24ffe11b3215b8b4f4f196072e1404ba7cea187c03f4c2c9" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NETHER_STAR.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.NETHER_STAR.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 106, + "startColumn": 63, + "charOffset": 4846, + "charLength": 37, + "snippet": { + "text": "XMaterial.NETHER_STAR.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 104, + "startColumn": 1, + "charOffset": 4638, + "charLength": 358, + "snippet": { + "text": " // Set the highlight item\n ArrayList highlightLore = ListUtil.createList(\"\", \"§eIs Highlight: \", \"\" + warp.isHighlight());\n getMenu().getSlot(HIGHLIGHT_SLOT).setItem(Item.create(XMaterial.NETHER_STAR.parseMaterial(), warp.isHighlight() ? \"§6§lMake Normal\" : \"§6§lMake Highlight\", highlightLore));\n\n // Set the delete item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "699a1c1b922452d9", + "equalIndicator/v1": "0dead4d32668fb23fee1717ba3c59df0cd05499054544adfd2eca75e0036d3af" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NAME_TAG.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.NAME_TAG.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 91, + "startColumn": 29, + "charOffset": 3692, + "charLength": 34, + "snippet": { + "text": "XMaterial.NAME_TAG.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 89, + "startColumn": 1, + "charOffset": 3617, + "charLength": 209, + "snippet": { + "text": "\n getMenu().getSlot(NAME_SLOT).setItem(\n Item.create(XMaterial.NAME_TAG.parseMaterial(), \"§eSet Name\",\n new ArrayList<>(List.of(\"§7Current: §f\" + name)))\n );" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "9cd5afe4e147a98d", + "equalIndicator/v1": "0ed5f7ef9b1d873ef9479bc83e3bcea7a47555b2f1fb21df4abbbf02a72f9950" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.OAK_SAPLING.get()' might be null", + "markdown": "Argument `XMaterial.OAK_SAPLING.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 97, + "startColumn": 46, + "charOffset": 5280, + "charLength": 27, + "snippet": { + "text": "XMaterial.OAK_SAPLING.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 95, + "startColumn": 1, + "charOffset": 5016, + "charLength": 379, + "snippet": { + "text": " ArrayList treeLore = ListUtil.createList(\"\", \"§cThe §eTree Pack \" + Tree.TREE_PACK_VERSION + \" §cis not installed\", \"§cTree Generator is disabled\", \"\", \"§8Leftclick for Installation Instructions\");\n\n ItemStack treeItem = Item.create(XMaterial.OAK_SAPLING.get(), \"§aGenerate Tree & Forest §c(DISABLED)\", treeLore);\n\n // Set navigator item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "7ba95e3d47cd863b", + "equalIndicator/v1": "0f88493465b0c3309bfe2b8b40c30b14e05223990c14b7a42df41de53f441442" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NAME_TAG.get()' might be null", + "markdown": "Argument `XMaterial.NAME_TAG.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 132, + "startColumn": 43, + "charOffset": 6201, + "charLength": 24, + "snippet": { + "text": "XMaterial.NAME_TAG.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 130, + "startColumn": 1, + "charOffset": 6102, + "charLength": 255, + "snippet": { + "text": " })\n .text(\"Name\")\n .itemLeft(Item.create(XMaterial.NAME_TAG.get(), \"§6§lChange Name\"))\n .title(\"§8Change the warp name\")\n .plugin(BuildTeamTools.getInstance())" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "10c9548c1d5e7def", + "equalIndicator/v1": "10d9eba9b0a0880d7fa2b9973676db314bf1b1a9df3904d19f3ca2f22742e4a4" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.VINE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.VINE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 49, + "startColumn": 46, + "charOffset": 2429, + "charLength": 30, + "snippet": { + "text": "XMaterial.VINE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 47, + "startColumn": 1, + "charOffset": 2026, + "charLength": 901, + "snippet": { + "text": " ItemStack wheatItem = Item.create(XMaterial.WHEAT.parseMaterial(), \"§bWheat\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack cornItem = Item.create(XMaterial.PUMPKIN_SEEDS.parseMaterial(), \"§bCorn\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack vineyardItem = Item.create(XMaterial.VINE.parseMaterial(), \"§bVineyard\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack pearItem = Item.create(XMaterial.SLIME_BALL.parseMaterial(), \"§bPear\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack cattleItem = Item.create(XMaterial.SPRUCE_FENCE.parseMaterial(), \"§bWheat\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "8ea71aebd036d3f1", + "equalIndicator/v1": "14f5bd2ea67e759ad7c2f4b4fabfc7a040a1a53efb80dafd0e48d4161002e6d5" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.WRITABLE_BOOK.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.WRITABLE_BOOK.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 92, + "startColumn": 29, + "charOffset": 3592, + "charLength": 39, + "snippet": { + "text": "XMaterial.WRITABLE_BOOK.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 90, + "startColumn": 1, + "charOffset": 3510, + "charLength": 270, + "snippet": { + "text": "\n getMenu().getSlot(DESCRIPTION_SLOT).setItem(\n Item.create(XMaterial.WRITABLE_BOOK.parseMaterial(), \"§eSet Description\",\n new ArrayList<>(List.of(\"§7Current: §f\" + (description.isEmpty() ? \"None\" : description))))\n );" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "5e4b0ce21a607730", + "equalIndicator/v1": "14f87954995010ee15b64e212a377ae7d3d82f1f4c10cd93e8ab5149e1faeb8d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.COBBLESTONE_SLAB.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.COBBLESTONE_SLAB.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 41, + "startColumn": 52, + "charOffset": 2302, + "charLength": 42, + "snippet": { + "text": "XMaterial.COBBLESTONE_SLAB.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 39, + "startColumn": 1, + "charOffset": 1781, + "charLength": 978, + "snippet": { + "text": " ItemStack gableRoofItem = Item.create(XMaterial.COBBLESTONE_STAIRS.parseMaterial(), \"§bGable Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using stairs\"));\n ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));\n ItemStack mediumSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bMedium Steep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses by creating\", \"a medium steep roof with slabs\"));\n ItemStack flatterSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bFlatter Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat gable roof for\", \"residential houses by creating\", \"a very flat roof with slabs\"));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "2c12d90386ccc790", + "equalIndicator/v1": "160b1de9ca4a366e0e9db8f9377d3684d4187e7e20336434f86b6d6b9f2b508a" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD)' might be null", + "markdown": "Argument `BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD)` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 35, + "startColumn": 41, + "charOffset": 1593, + "charLength": 75, + "snippet": { + "text": "BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD)" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 33, + "startColumn": 1, + "charOffset": 1495, + "charLength": 269, + "snippet": { + "text": " //Creates the location\n Location location;\n World tpWorld = Bukkit.getWorld(BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD));\n if (tpWorld == null)\n location = new Location(null, x, 64, z, yaw, pitch);" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "75d02248d3f91eb8", + "equalIndicator/v1": "164d3b504dee30ac90534deda4b9e1e02811d17fdcb759ba7899f89456504ccc" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BARRIER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 106, + "startColumn": 29, + "charOffset": 4396, + "charLength": 33, + "snippet": { + "text": "XMaterial.BARRIER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 104, + "startColumn": 1, + "charOffset": 4319, + "charLength": 295, + "snippet": { + "text": "\n getMenu().getSlot(DELETE_SLOT).setItem(\n Item.create(XMaterial.BARRIER.parseMaterial(), \"§cDelete Palette\",\n new ArrayList<>(List.of(\"§7Click to delete this palette\" + (isPredefinedFilter() ? \" (Cannot delete predefined filter)\" : \"\"))))\n );" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "5c4ea66d66b91f15", + "equalIndicator/v1": "1673e54672b445f24eda4578bfcb995d1b49282fb8861e6e189975331f04ad89" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.COMPASS.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.COMPASS.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 79, + "startColumn": 66, + "charOffset": 3214, + "charLength": 33, + "snippet": { + "text": "XMaterial.COMPASS.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 77, + "startColumn": 1, + "charOffset": 2913, + "charLength": 385, + "snippet": { + "text": " if(alreadyExists){\n ArrayList locationLore = ListUtil.createList(\"\", \"§eWorld: §7\" + warp.getWorldName(), \"§eLatitude: §7\" + warp.getLat(), \"§eLongitude: §7\" + warp.getLon(), \"§eElevation: §7\" + warp.getY());\n getMenu().getSlot(LOCATION_SLOT).setItem(Item.create(XMaterial.COMPASS.parseMaterial(), \"§6§lChange Location\", locationLore));\n\n }" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "3e4555cecadb95a1", + "equalIndicator/v1": "16bb6d5f9fe832d6ae9d7b97d569c353bd68359879f37e28069ca3cc88624b41" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.WHITE_CARPET.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.WHITE_CARPET.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 38, + "startColumn": 46, + "charOffset": 1622, + "charLength": 38, + "snippet": { + "text": "XMaterial.WHITE_CARPET.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 36, + "startColumn": 1, + "charOffset": 1537, + "charLength": 713, + "snippet": { + "text": " protected void setPreviewItems() {\n\n ItemStack flatRoofItem = Item.create(XMaterial.WHITE_CARPET.parseMaterial(), \"§bFlat Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat roof for\", \"skyscrapers using carpets\", \"or slabs\"));\n ItemStack gableRoofItem = Item.create(XMaterial.COBBLESTONE_STAIRS.parseMaterial(), \"§bGable Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using stairs\"));\n ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "8a35cfcb58b32097", + "equalIndicator/v1": "181d174f6f500345eaa16d319f9438b32c1a3ceac11554a6af24d22a04f81738" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'is' might be null", + "markdown": "Argument `is` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ConformalEstimate.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 29, + "startColumn": 127, + "charOffset": 924, + "charLength": 2, + "snippet": { + "text": "is" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 27, + "startColumn": 1, + "charOffset": 748, + "charLength": 233, + "snippet": { + "text": " double[][] ys = new double[xs.length][];\n\n try(InputStream is = this.getClass().getClassLoader().getResourceAsStream(\"conformal.txt\") ; Scanner sc = new Scanner(is)) {\n\n for (int u = 0; u < xs.length; u++) {" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "8e41d8b1294c80fc", + "equalIndicator/v1": "21f58d5f6117314170c2e8017db1d23d4054978571739975bfe39043582f6f9f" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.WRITABLE_BOOK.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.WRITABLE_BOOK.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 96, + "startColumn": 29, + "charOffset": 3909, + "charLength": 39, + "snippet": { + "text": "XMaterial.WRITABLE_BOOK.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 94, + "startColumn": 1, + "charOffset": 3827, + "charLength": 270, + "snippet": { + "text": "\n getMenu().getSlot(DESCRIPTION_SLOT).setItem(\n Item.create(XMaterial.WRITABLE_BOOK.parseMaterial(), \"§eSet Description\",\n new ArrayList<>(List.of(\"§7Current: §f\" + (description.isEmpty() ? \"None\" : description))))\n );" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "ec5272f0ba9a8f83", + "equalIndicator/v1": "25a1f5518800f4bdbbc1e7c4efffd36c5c40197133c539fccd751c4fdb75bba2" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Method invocation 'getKeys' may produce 'NullPointerException'", + "markdown": "Method invocation `getKeys` may produce `NullPointerException`" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 272, + "startColumn": 77, + "charOffset": 11120, + "charLength": 7, + "snippet": { + "text": "getKeys" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 270, + "startColumn": 1, + "charOffset": 11033, + "charLength": 293, + "snippet": { + "text": " }\n\n for (String key : paletteConfig.getConfigurationSection(\"palettes\").getKeys(false)) {\n String name = paletteConfig.getString(\"palettes.\" + key + \".name\", \"Unnamed\");\n String description = paletteConfig.getString(\"palettes.\" + key + \".description\", \"\");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "b306e899fa627bb7", + "equalIndicator/v1": "2cc41bdee1eba0798702a45ed2f022af873eff9752df2f75632a3b69d9f878d7" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.SHORT_GRASS.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.SHORT_GRASS.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 52, + "startColumn": 44, + "charOffset": 2971, + "charLength": 37, + "snippet": { + "text": "XMaterial.SHORT_GRASS.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 50, + "startColumn": 1, + "charOffset": 2565, + "charLength": 914, + "snippet": { + "text": " ItemStack pearItem = Item.create(XMaterial.SLIME_BALL.parseMaterial(), \"§bPear\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack cattleItem = Item.create(XMaterial.SPRUCE_FENCE.parseMaterial(), \"§bWheat\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack meadowItem = Item.create(XMaterial.SHORT_GRASS.parseMaterial(), \"§bMeadow\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack harvestedItem = Item.create(XMaterial.HAY_BLOCK.parseMaterial(), \"§bHarvested\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack otherItem = Item.create(XMaterial.DEAD_BUSH.parseMaterial(), \"§bOther\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "0de51859a5a97848", + "equalIndicator/v1": "2e9e95bbd30cbbf643ac0a2f0be9615961a71dd0eb2c9ee2dbb2ceb02a1f6d4d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.PAPER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.PAPER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 98, + "startColumn": 66, + "charOffset": 4227, + "charLength": 31, + "snippet": { + "text": "XMaterial.PAPER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 96, + "startColumn": 1, + "charOffset": 3960, + "charLength": 379, + "snippet": { + "text": " // Set the address type item\n ArrayList addressTypeLore = ListUtil.createList(\"\", \"§eAddress Type: \", warp.getAddressType() == null ? \"§7City\" : warp.getAddressType().getName());\n getMenu().getSlot(ADDRESS_TYPE_SLOT).setItem(Item.create(XMaterial.PAPER.parseMaterial(), \"§6§lChange Address Type\", addressTypeLore));\n\n // Set the material item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a8aa04ddee9bb2a9", + "equalIndicator/v1": "36b0de65e91543f503c55df57e2ce461ff25b0e4acd0cc634f8e6683be51fe8e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.STONE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.STONE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 30, + "startColumn": 53, + "charOffset": 1541, + "charLength": 31, + "snippet": { + "text": "XMaterial.STONE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 28, + "startColumn": 1, + "charOffset": 1321, + "charLength": 344, + "snippet": { + "text": " private final byte ACHIEVEMENT_HEAD_SLOT = 24;\n private final ItemStack PLAYER_HEAD = Item.createPlayerHead(\"&ePersonal Statistics\", getMenuPlayer().getName());\n private final ItemStack TEAM_HEAD = Item.create(XMaterial.STONE.parseMaterial(), \"Placeholder\", ListUtil.createList(\"placeholder\")); //TODO GET HEAD BASED ON COUNTRY/TEAM\n\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a05a78dcbd81a74d", + "equalIndicator/v1": "36c7c2ab02b4f52c70475ecc7f0e76745d954713899c11d857d306535f9dff59" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BARRIER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 107, + "startColumn": 31, + "charOffset": 4254, + "charLength": 33, + "snippet": { + "text": "XMaterial.BARRIER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 105, + "startColumn": 1, + "charOffset": 4077, + "charLength": 264, + "snippet": { + "text": " menu.getSlot(50).setItem(hasNextPage()\n ? Item.createCustomHeadBase64(BlockPaletteManager.RIGHT_ARROW, \"§eNext Page\", null)\n : Item.create(XMaterial.BARRIER.parseMaterial(), \"§cNo Next Page\", null));\n\n // Page indicator" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "de71d8db188b26c4", + "equalIndicator/v1": "39b0855fcbb38cc2c566b3e476820f594cd4b537019f8b3ed2de037c0a35e880" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.SEA_LANTERN.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.SEA_LANTERN.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 198, + "startColumn": 28, + "charOffset": 9611, + "charLength": 37, + "snippet": { + "text": "XMaterial.SEA_LANTERN.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 196, + "startColumn": 1, + "charOffset": 9529, + "charLength": 218, + "snippet": { + "text": "\n protected ItemStack getStreetLampItem(String id){\n return Item.create(XMaterial.SEA_LANTERN.parseMaterial(), \"§eStreet Lamp #\" + id, ListUtil.createList(\"§7Click to select this street lamp type.\"));\n }\n}" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "553eed6d80f55c25", + "equalIndicator/v1": "3c37c3143dce937cd357687188ee2c39e21ac4cf2ce7f1cf36ede11abfbd5736" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NAME_TAG.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.NAME_TAG.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 127, + "startColumn": 43, + "charOffset": 6989, + "charLength": 34, + "snippet": { + "text": "XMaterial.NAME_TAG.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 125, + "startColumn": 1, + "charOffset": 6887, + "charLength": 268, + "snippet": { + "text": " })\n .text(\"Address\")\n .itemLeft(Item.create(XMaterial.NAME_TAG.parseMaterial(), \"§6§lChange Address\"))\n .title(\"§8Enter the address\")\n .plugin(BuildTeamTools.getInstance())" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "b00e6103de2c3757", + "equalIndicator/v1": "3c52aa15d7fe3d590945fad81686fa0270d258a475a87eba846c12f03a45040e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.OAK_SAPLING.get()' might be null", + "markdown": "Argument `XMaterial.OAK_SAPLING.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 105, + "startColumn": 46, + "charOffset": 5799, + "charLength": 27, + "snippet": { + "text": "XMaterial.OAK_SAPLING.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 103, + "startColumn": 1, + "charOffset": 5503, + "charLength": 398, + "snippet": { + "text": " ArrayList treeLore = ListUtil.createList(\"\", \"§eDescription:\", \"Generate trees from a set of\", \"hundreds of different types\", \"\", \"§eFeatures:\", \"- Custom Tree Type\", \"\", \"§8Left-click to generate\", \"§8Right-click for Tutorial\");\n\n ItemStack treeItem = Item.create(XMaterial.OAK_SAPLING.get(), \"§aGenerate Tree & Forest\", treeLore);\n\n // Set navigator item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "355106d0d48ebdb1", + "equalIndicator/v1": "3ed44b3aeb5c975706e6c311cf3c9514928f41af9191f6662a5c436136b47217" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NAME_TAG.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.NAME_TAG.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/AddressTypeSelectionMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 67, + "startColumn": 60, + "charOffset": 3798, + "charLength": 34, + "snippet": { + "text": "XMaterial.NAME_TAG.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 65, + "startColumn": 1, + "charOffset": 3433, + "charLength": 615, + "snippet": { + "text": " getMenu().getSlot(STATE_SLOT).setItem(new Item(XMaterial.LIGHT_BLUE_DYE.parseItem()).setDisplayName(\"§6§lState\").setLore(stateLore).build());\n getMenu().getSlot(COUNTRY_SLOT).setItem(new Item(XMaterial.LIGHT_BLUE_DYE.parseItem()).setDisplayName(\"§6§lCountry\").setLore(countryLore).build());\n getMenu().getSlot(CUSTOM_SLOT).setItem(Item.create(XMaterial.NAME_TAG.parseMaterial(), \"§6§lCustom Address\", ListUtil.createList(\"\", \"§7If no other address type fits,\", \"§7enter a custom address.\")));\n\n setBackItem(BACK_ITEM_SLOT, new WarpEditMenu(getMenuPlayer(), warp, alreadyExists, false));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "571bfbf15516e6d7", + "equalIndicator/v1": "47a19e622d7a6e5235cd2407eb74abe1b45d7de49d1fe2a38246b94be57d9f07" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.WHEAT.get()' might be null", + "markdown": "Argument `XMaterial.WHEAT.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 117, + "startColumn": 43, + "charOffset": 6479, + "charLength": 21, + "snippet": { + "text": "XMaterial.WHEAT.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 115, + "startColumn": 1, + "charOffset": 6262, + "charLength": 315, + "snippet": { + "text": " fieldLore = ListUtil.createList(\"\", \"§cThis §eGenerator §cis currently broken\", \"§cField Generator is disabled\", \"\", \"§8If you want to help fixing ask on Dev Hub!\");\n\n ItemStack fieldItem = Item.create(XMaterial.WHEAT.get(), \"§6Generate Field §c(DISABLED)\", fieldLore);\n\n // Set navigator item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "b071580af6e8dd5f", + "equalIndicator/v1": "4df463a6728a996c31421a4cd20976e89cd1f9b49566121d1019179514684ce7" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.COBBLESTONE_SLAB.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.COBBLESTONE_SLAB.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 40, + "startColumn": 51, + "charOffset": 2038, + "charLength": 42, + "snippet": { + "text": "XMaterial.COBBLESTONE_SLAB.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 38, + "startColumn": 1, + "charOffset": 1577, + "charLength": 1181, + "snippet": { + "text": " ItemStack flatRoofItem = Item.create(XMaterial.WHITE_CARPET.parseMaterial(), \"§bFlat Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat roof for\", \"skyscrapers using carpets\", \"or slabs\"));\n ItemStack gableRoofItem = Item.create(XMaterial.COBBLESTONE_STAIRS.parseMaterial(), \"§bGable Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using stairs\"));\n ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));\n ItemStack mediumSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bMedium Steep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses by creating\", \"a medium steep roof with slabs\"));\n ItemStack flatterSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bFlatter Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat gable roof for\", \"residential houses by creating\", \"a very flat roof with slabs\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "73e40c8803eadcf5", + "equalIndicator/v1": "4f263bf6e06781f0cf51add69d7a1df3a77aeef9a0b627ec4d528f13207cdfc6" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.WATER_BUCKET.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.WATER_BUCKET.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropStageMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 63, + "startColumn": 39, + "charOffset": 3035, + "charLength": 38, + "snippet": { + "text": "XMaterial.WATER_BUCKET.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 61, + "startColumn": 1, + "charOffset": 2878, + "charLength": 249, + "snippet": { + "text": " case OTHER:\n itemOne = Item.create(XMaterial.DEAD_BUSH.parseMaterial(), \"§bDry\", typeLore);\n itemTwo = Item.create(XMaterial.WATER_BUCKET.parseMaterial(), \"§bWet\", typeLore);\n break;\n }" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "e7b4751a31510715", + "equalIndicator/v1": "561be94d14f71ea9753176aa5e9e88f4135add3ce9cad5e9371289534bd906c9" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.DIAMOND_SWORD.get()' might be null", + "markdown": "Argument `XMaterial.DIAMOND_SWORD.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/TreeScripts.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 22, + "startColumn": 86, + "charOffset": 1121, + "charLength": 29, + "snippet": { + "text": "XMaterial.DIAMOND_SWORD.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 20, + "startColumn": 1, + "charOffset": 885, + "charLength": 327, + "snippet": { + "text": " // In case the player is holding no item, give him a diamond sword\n if (p.getInventory().getItemInMainHand().getType() == Material.AIR)\n p.getInventory().setItem(p.getInventory().getHeldItemSlot(), Item.create(XMaterial.DIAMOND_SWORD.get()));\n\n if (treeType.getName().equalsIgnoreCase(\"any\")) {" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "125175ca21706752", + "equalIndicator/v1": "5a9aaadf2ab9feaa4fda2f7a6a9ec0dddcb7651693a101c2e855fd11d37b1cba" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Dereference of 'files' may produce 'NullPointerException'", + "markdown": "Dereference of `files` may produce `NullPointerException`" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/RoadSettings.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 23, + "startColumn": 25, + "charOffset": 722, + "charLength": 5, + "snippet": { + "text": "files" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 21, + "startColumn": 1, + "charOffset": 651, + "charLength": 236, + "snippet": { + "text": " File[] files = directory.listFiles();\n\n for(File file : files)\n if(file.getName().contains(\"streetlamp\"))\n streetLampTypes.add(file.getName().replace(\".schematic\", \"\").replace(\"streetlamp\", \"\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "15a23ac42de5993a", + "equalIndicator/v1": "690a47b4fd5d8c7ea3c3abd112b7471a9c8bf2a55f8347f60e25281fa25ab3f2" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.HAY_BLOCK.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.HAY_BLOCK.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 53, + "startColumn": 47, + "charOffset": 3158, + "charLength": 35, + "snippet": { + "text": "XMaterial.HAY_BLOCK.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 51, + "startColumn": 1, + "charOffset": 2744, + "charLength": 736, + "snippet": { + "text": " ItemStack cattleItem = Item.create(XMaterial.SPRUCE_FENCE.parseMaterial(), \"§bWheat\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack meadowItem = Item.create(XMaterial.SHORT_GRASS.parseMaterial(), \"§bMeadow\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack harvestedItem = Item.create(XMaterial.HAY_BLOCK.parseMaterial(), \"§bHarvested\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack otherItem = Item.create(XMaterial.DEAD_BUSH.parseMaterial(), \"§bOther\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "b6853e5e6399b92f", + "equalIndicator/v1": "6b6224a3ef73853d69e49370e26187778dbc63e131d88919642aa3ac13a6f59f" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BOOK.get()' might be null", + "markdown": "Argument `XMaterial.BOOK.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 80, + "startColumn": 65, + "charOffset": 3231, + "charLength": 20, + "snippet": { + "text": "XMaterial.BOOK.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 78, + "startColumn": 1, + "charOffset": 3130, + "charLength": 212, + "snippet": { + "text": "\n // Set the Description item\n getMenu().getSlot(DESCRIPTION_SLOT).setItem(Item.create(XMaterial.BOOK.get(), \"§6§lChange Description\", warpGroup.getDescriptionLore()));\n\n // Set the Slot item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "db2d45b3d6b1c684", + "equalIndicator/v1": "74e4ec16810226ac12595ecbb3e0cf15c722d1298d9603a3e4d2a91bc735793a" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BIRCH_DOOR.get()' might be null", + "markdown": "Argument `XMaterial.BIRCH_DOOR.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 58, + "startColumn": 43, + "charOffset": 2894, + "charLength": 26, + "snippet": { + "text": "XMaterial.BIRCH_DOOR.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 56, + "startColumn": 1, + "charOffset": 2490, + "charLength": 494, + "snippet": { + "text": " ArrayList houseLore = ListUtil.createList(\"\", \"§eDescription:\", \"Generate basic building shells\", \"with multiple floors, windows and roofs\", \"\", \"§eFeatures:\", \"- \" + RoofType.values().length + \" Roof Types\", \"- Custom Wall, Base and Roof Color\", \"- Custom Floor and Window Sizes\", \"\", \"§8Left-click to generate\", \"§8Right-click for Tutorial\");\n\n ItemStack houseItem = Item.create(XMaterial.BIRCH_DOOR.get(), \"§cGenerate House\", houseLore);\n\n // Set navigator item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "eb3a32304d1d2e28", + "equalIndicator/v1": "773a3669168d251a21454ea090cbc9d8f7714889c59765c4834fb3e86bf803f4" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BARRIER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 110, + "startColumn": 64, + "charOffset": 5086, + "charLength": 33, + "snippet": { + "text": "XMaterial.BARRIER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 108, + "startColumn": 1, + "charOffset": 4966, + "charLength": 238, + "snippet": { + "text": " // Set the delete item\n if(alreadyExists)\n getMenu().getSlot(DELETE_SLOT).setItem(Item.create(XMaterial.BARRIER.parseMaterial(), \"§c§lDelete Warp\", ListUtil.createList(\"\", \"§8Click to delete the warp.\")));\n }\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "92fc14e9d4f07d90", + "equalIndicator/v1": "79224bcdaa38cd62bffffd0790baa532b128c954e39e32aae17ab427689d53d1" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BARRIER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 267, + "startColumn": 31, + "charOffset": 10861, + "charLength": 33, + "snippet": { + "text": "XMaterial.BARRIER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 265, + "startColumn": 1, + "charOffset": 10653, + "charLength": 340, + "snippet": { + "text": " menu.getSlot(PREVIOUS_SLOT).setItem(hasPreviousPage()\n ? Item.createCustomHeadBase64(BlockPaletteManager.LEFT_ARROW, \"§ePrevious Page\", new ArrayList<>())\n : Item.create(XMaterial.BARRIER.parseMaterial(), \"§cNo Previous Page\", new ArrayList<>()));\n\n menu.getSlot(NEXT_SLOT).setItem(hasNextPage()" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "9bc43f8bc4ba4fff", + "equalIndicator/v1": "7dba9b4f92cee759c1bdbdc4a7ccaf7025efdbddf5c2660bd0efb2950724a4c1" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.get()' might be null", + "markdown": "Argument `XMaterial.BARRIER.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 92, + "startColumn": 60, + "charOffset": 4096, + "charLength": 23, + "snippet": { + "text": "XMaterial.BARRIER.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 90, + "startColumn": 1, + "charOffset": 4005, + "charLength": 211, + "snippet": { + "text": "\n // Set the delete item\n getMenu().getSlot(DELETE_SLOT).setItem(Item.create(XMaterial.BARRIER.get(), \"§c§lDelete Warp Group\", ListUtil.createList(\"\", \"§8Click to delete the warp group.\")));\n }\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "20be61e0e9109b28", + "equalIndicator/v1": "8043f024fbe4f18638a29d53e44c14cec32978dce93a6063395fe393c9da3516" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.POTATO.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.POTATO.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 46, + "startColumn": 44, + "charOffset": 1890, + "charLength": 32, + "snippet": { + "text": "XMaterial.POTATO.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 44, + "startColumn": 1, + "charOffset": 1807, + "charLength": 576, + "snippet": { + "text": " protected void setPreviewItems() {\n\n ItemStack potatoItem = Item.create(XMaterial.POTATO.parseMaterial(), \"§bPotato\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack wheatItem = Item.create(XMaterial.WHEAT.parseMaterial(), \"§bWheat\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack cornItem = Item.create(XMaterial.PUMPKIN_SEEDS.parseMaterial(), \"§bCorn\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "aaea683e6a7aa2c6", + "equalIndicator/v1": "820b6d1d308a771e426a96861995fd3988ea47496669dde44b5447627c3c7f7a" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.STONE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.STONE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 101, + "startColumn": 29, + "charOffset": 4175, + "charLength": 31, + "snippet": { + "text": "XMaterial.STONE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 99, + "startColumn": 1, + "charOffset": 4098, + "charLength": 220, + "snippet": { + "text": "\n getMenu().getSlot(BLOCKS_SLOT).setItem(\n Item.create(XMaterial.STONE.parseMaterial(), \"§eSet Blocks\",\n new ArrayList<>(List.of(\"§7Selected: §f\" + blocks.size())))\n );" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "c2143d3826f4c406", + "equalIndicator/v1": "87cd30f61415d4bae01e324c830436dcb0735ec7b150a029111845c56d7c8d1d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NAME_TAG.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.NAME_TAG.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 87, + "startColumn": 29, + "charOffset": 3375, + "charLength": 34, + "snippet": { + "text": "XMaterial.NAME_TAG.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 85, + "startColumn": 1, + "charOffset": 3300, + "charLength": 209, + "snippet": { + "text": "\n getMenu().getSlot(NAME_SLOT).setItem(\n Item.create(XMaterial.NAME_TAG.parseMaterial(), \"§eSet Name\",\n new ArrayList<>(List.of(\"§7Current: §f\" + name)))\n );" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "ce6853ba86c8b71d", + "equalIndicator/v1": "8a17f466529eeca8d0818fcd0de433179f7e33b23b1ba08e91da916f37775583" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.DARK_OAK_FENCE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.DARK_OAK_FENCE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropStageMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 55, + "startColumn": 39, + "charOffset": 2498, + "charLength": 40, + "snippet": { + "text": "XMaterial.DARK_OAK_FENCE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 53, + "startColumn": 1, + "charOffset": 2337, + "charLength": 269, + "snippet": { + "text": " case WHEAT:\n itemOne = Item.create(XMaterial.BIRCH_FENCE.parseMaterial(), \"§bLight\", typeLore);\n itemTwo = Item.create(XMaterial.DARK_OAK_FENCE.parseMaterial(), \"§bDark\", typeLore);\n break;\n case CORN:" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d3af45a375f1fc4e", + "equalIndicator/v1": "9f841f617f5c7bf04b322adb88406c828980d340b393c9aa928ab17592dbd9ce" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NAME_TAG.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.NAME_TAG.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 101, + "startColumn": 43, + "charOffset": 5268, + "charLength": 34, + "snippet": { + "text": "XMaterial.NAME_TAG.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 99, + "startColumn": 1, + "charOffset": 5165, + "charLength": 276, + "snippet": { + "text": " })\n .text(\"Material\")\n .itemLeft(Item.create(XMaterial.NAME_TAG.parseMaterial(), \"§6§lEnter Material Name\"))\n .title(\"§8Enter Material Name\")\n .plugin(BuildTeamTools.getInstance())" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "7ea1a8ba214774e5", + "equalIndicator/v1": "a053d1eef1423fc0f606646379a2461d7bfe943089307e31334e307527841aa3" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.SPRUCE_FENCE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.SPRUCE_FENCE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 51, + "startColumn": 44, + "charOffset": 2787, + "charLength": 38, + "snippet": { + "text": "XMaterial.SPRUCE_FENCE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 49, + "startColumn": 1, + "charOffset": 2384, + "charLength": 915, + "snippet": { + "text": " ItemStack vineyardItem = Item.create(XMaterial.VINE.parseMaterial(), \"§bVineyard\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack pearItem = Item.create(XMaterial.SLIME_BALL.parseMaterial(), \"§bPear\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack cattleItem = Item.create(XMaterial.SPRUCE_FENCE.parseMaterial(), \"§bWheat\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack meadowItem = Item.create(XMaterial.SHORT_GRASS.parseMaterial(), \"§bMeadow\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack harvestedItem = Item.create(XMaterial.HAY_BLOCK.parseMaterial(), \"§bHarvested\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "97c9eca0d9d5e61e", + "equalIndicator/v1": "a20e5d6156d046aa794479ce2e3e66f93317e7f9180471c8897d59ef7c622efd" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.OAK_SAPLING.get()' might be null", + "markdown": "Argument `XMaterial.OAK_SAPLING.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 89, + "startColumn": 46, + "charOffset": 4718, + "charLength": 27, + "snippet": { + "text": "XMaterial.OAK_SAPLING.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 87, + "startColumn": 1, + "charOffset": 4477, + "charLength": 356, + "snippet": { + "text": " ArrayList treeLore = ListUtil.createList(\"\", \"§cPlugin §eSchematicBrush §cis not installed\", \"§cTree Generator is disabled\", \"\", \"§8Leftclick for Installation Instructions\");\n\n ItemStack treeItem = Item.create(XMaterial.OAK_SAPLING.get(), \"§aGenerate Tree & Forest §c(DISABLED)\", treeLore);\n\n // Set navigator item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a8922ec647e0c1d9", + "equalIndicator/v1": "a500132e54e2f00aea7770b4c2829443cd4e6f1906048fe0df98c66f47032801" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.RAIL.get()' might be null", + "markdown": "Argument `XMaterial.RAIL.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 79, + "startColumn": 45, + "charOffset": 4187, + "charLength": 20, + "snippet": { + "text": "XMaterial.RAIL.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 77, + "startColumn": 1, + "charOffset": 3964, + "charLength": 324, + "snippet": { + "text": " railwayLore = ListUtil.createList(\"\", \"§cThis §eGenerator §cis currently broken\", \"§cRailway Generator is disabled\", \"\", \"§8If you want to help fixing ask on Dev Hub!\");\n\n ItemStack railwayItem = Item.create(XMaterial.RAIL.get(), \"§9Generate Railway §c(DISABLED)\", railwayLore);\n\n // Set navigator item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "6458cf43d598aa6f", + "equalIndicator/v1": "a57212dc34b9c8d6cd550516d65b204426966f7299c0d5f3e5c7d74c28b794f2" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.WRITABLE_BOOK.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.WRITABLE_BOOK.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/menus/BookMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 63, + "startColumn": 38, + "charOffset": 2002, + "charLength": 39, + "snippet": { + "text": "XMaterial.WRITABLE_BOOK.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 61, + "startColumn": 1, + "charOffset": 1944, + "charLength": 207, + "snippet": { + "text": " }, 20, 20);\n\n ItemStack item = Item.create(XMaterial.WRITABLE_BOOK.parseMaterial(), bookTitle);\n BookMeta bookMeta = (BookMeta) item.getItemMeta();\n bookMeta.setTitle(bookTitle);" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "cdd760e8271230ba", + "equalIndicator/v1": "b181f21f9d562c66b6537ade24c885fb769bec7fdd4546a37bf17d153c034309" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.COMPASS.get()' might be null", + "markdown": "Argument `XMaterial.COMPASS.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/menu/ExploreMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 37, + "startColumn": 72, + "charOffset": 1565, + "charLength": 23, + "snippet": { + "text": "XMaterial.COMPASS.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 35, + "startColumn": 1, + "charOffset": 1263, + "charLength": 388, + "snippet": { + "text": " for (Continent continent : Continent.values()) {\n ArrayList continentLore = new ArrayList<>(Collections.singletonList(ChatHelper.getStandardString(false, \"Visit countries in %s\", continent.getLabel())));\n getMenu().getSlot(continent.getSlot()).setItem(Item.create(XMaterial.COMPASS.get(), \"§e§l\" + continent.getLabel(), 1, continentLore));\n }\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "9c8acdd91c2b197c", + "equalIndicator/v1": "b26027ac54dd675e4a1a9b857dea0e448a4974df9286eb48c588113760000436" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.ITEM_FRAME.get()' might be null", + "markdown": "Argument `XMaterial.ITEM_FRAME.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 221, + "startColumn": 43, + "charOffset": 11318, + "charLength": 26, + "snippet": { + "text": "XMaterial.ITEM_FRAME.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 219, + "startColumn": 1, + "charOffset": 11190, + "charLength": 286, + "snippet": { + "text": " })\n .text(\"Enter slot 0-26. Set -1 for auto.\")\n .itemLeft(Item.create(XMaterial.ITEM_FRAME.get(), \"§6§lChange Slot\"))\n .title(\"§8Change the warp slot\")\n .plugin(BuildTeamTools.getInstance())" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1908fd8b287f4ad3", + "equalIndicator/v1": "b6975e2817c3a1b00f681e20ececde747ca8662c0506507a4ffa657d811532b3" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.JUNGLE_SAPLING.get()' might be null", + "markdown": "Argument `XMaterial.JUNGLE_SAPLING.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeWidthMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 38, + "startColumn": 52, + "charOffset": 1648, + "charLength": 30, + "snippet": { + "text": "XMaterial.JUNGLE_SAPLING.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 36, + "startColumn": 1, + "charOffset": 1541, + "charLength": 235, + "snippet": { + "text": "\n for (TreeWidth treeWidth : TreeWidth.values())\n treeWidths.add(new Tuple<>(Item.create(XMaterial.JUNGLE_SAPLING.get(), StringUtils.capitalize(treeWidth.getName())), treeWidth.getName()));\n\n return treeWidths;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "bdb384df3db4351c", + "equalIndicator/v1": "b7e16b9287b241838884ec4ee021d257f447a4d89b6e84c3f6cc5e541e6eedbd" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BARRIER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropStageMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 44, + "startColumn": 41, + "charOffset": 1780, + "charLength": 33, + "snippet": { + "text": "XMaterial.BARRIER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 42, + "startColumn": 1, + "charOffset": 1601, + "charLength": 291, + "snippet": { + "text": " CropType cropType = (CropType) field.getPlayerSettings().get(getMenuPlayer().getUniqueId()).getValues().get(FieldFlag.CROP_TYPE);\n\n ItemStack itemOne = Item.create(XMaterial.BARRIER.parseMaterial());\n ItemStack itemTwo = Item.create(XMaterial.BARRIER.parseMaterial());\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "0e8899bf50fb670b", + "equalIndicator/v1": "bda9a655f6b769ab885e1f82d8e7b8cc81a35d466530cbed6573774e6f085386" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.SLIME_BALL.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.SLIME_BALL.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 50, + "startColumn": 42, + "charOffset": 2606, + "charLength": 36, + "snippet": { + "text": "XMaterial.SLIME_BALL.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 48, + "startColumn": 1, + "charOffset": 2202, + "charLength": 909, + "snippet": { + "text": " ItemStack cornItem = Item.create(XMaterial.PUMPKIN_SEEDS.parseMaterial(), \"§bCorn\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack vineyardItem = Item.create(XMaterial.VINE.parseMaterial(), \"§bVineyard\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack pearItem = Item.create(XMaterial.SLIME_BALL.parseMaterial(), \"§bPear\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack cattleItem = Item.create(XMaterial.SPRUCE_FENCE.parseMaterial(), \"§bWheat\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack meadowItem = Item.create(XMaterial.SHORT_GRASS.parseMaterial(), \"§bMeadow\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "0727c93f3c11d48a", + "equalIndicator/v1": "c1e99bb5174fbac3eed65f7fae129090c5e4dffcf082de4d050ca34b278f5aca" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BARRIER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 137, + "startColumn": 67, + "charOffset": 5439, + "charLength": 33, + "snippet": { + "text": "XMaterial.BARRIER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 135, + "startColumn": 1, + "charOffset": 5335, + "charLength": 201, + "snippet": { + "text": "\n // Set current page item\n getMenu().getSlot(sliderItemSlot).setItem(Item.create(XMaterial.BARRIER.parseMaterial(), sliderName + \": §c§lOFF\"));\n\n // Set next page item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "f1090832d249c148", + "equalIndicator/v1": "c530bba61f2cc1aa610a0ae6db748c01af5480f785fa78d218a8b2c18c35ada9" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD)' might be null", + "markdown": "Argument `BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD)` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 66, + "startColumn": 41, + "charOffset": 3021, + "charLength": 75, + "snippet": { + "text": "BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD)" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 64, + "startColumn": 1, + "charOffset": 2923, + "charLength": 205, + "snippet": { + "text": " //Creates the location\n Location location;\n World tpWorld = Bukkit.getWorld(BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD));\n\n if (tpWorld == null)" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "6cc8ed395d1aaf03", + "equalIndicator/v1": "c63fd5a733b76c9c165c3101ec08c2db8ddfaf2a5f4e6bc597d8c43b21100cd6" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NAME_TAG.get()' might be null", + "markdown": "Argument `XMaterial.NAME_TAG.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 77, + "startColumn": 58, + "charOffset": 3073, + "charLength": 24, + "snippet": { + "text": "XMaterial.NAME_TAG.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 75, + "startColumn": 1, + "charOffset": 2884, + "charLength": 282, + "snippet": { + "text": " // Set the name item\n ArrayList nameLore = ListUtil.createList(\"\", \"§eCurrent Name: \", warpGroup.getName());\n getMenu().getSlot(NAME_SLOT).setItem(Item.create(XMaterial.NAME_TAG.get(), \"§6§lChange Name\", nameLore));\n\n // Set the Description item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "2257d4dec008d1a2", + "equalIndicator/v1": "c82da2c53b279fb19142afa02c5e0eab325488670c417de6bf1ba0146b881231" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.OAK_SAPLING.get()' might be null", + "markdown": "Argument `XMaterial.OAK_SAPLING.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 37, + "startColumn": 51, + "charOffset": 1701, + "charLength": 27, + "snippet": { + "text": "XMaterial.OAK_SAPLING.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 35, + "startColumn": 1, + "charOffset": 1599, + "charLength": 224, + "snippet": { + "text": "\n for(TreeType treeType : TreeType.values())\n treeTypes.add(new Tuple<>(Item.create(XMaterial.OAK_SAPLING.get(), StringUtils.capitalize(treeType.getName())), treeType.getName()));\n\n return treeTypes;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "0dd3db561eacd7c3", + "equalIndicator/v1": "cba828e084c075f637f98e85772c84f04ad3f0eb975c3c5c3c90be7c8b74ebdc" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.STONE.get()' might be null", + "markdown": "Argument `XMaterial.STONE.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 50, + "startColumn": 62, + "charOffset": 2091, + "charLength": 21, + "snippet": { + "text": "XMaterial.STONE.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 48, + "startColumn": 1, + "charOffset": 1975, + "charLength": 556, + "snippet": { + "text": " @Override\n protected void setMenuItemsAsync() {\n getMenu().getSlot(MATERIAL_SLOT).setItem(Item.create(XMaterial.STONE.get(), \"§6§lItem\", ListUtil.createList(\"\", \"Change the material of the warp\", \"to a minecraft item.\", \"\", \"§eExample:\", \"Stone\")));\n getMenu().getSlot(CUSTOM_HEAD_SLOT).setItem(CustomHeads.getLetterHead(\"?\", CustomHeads.LetterType.WOODEN, \"§6§lCustom Head\", ListUtil.createList(\"\", \"Change the material of the warp\", \"to a custom head texture URL.\", \"\", \"§eExample:\", \"https://textures.minecraft.net/texture/...\")));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "441aa82a0f0ebc03", + "equalIndicator/v1": "cef8e3fd782f66765859da33eb63dd3b9fc576763e3b862e85c2532a4f61845a" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BARRIER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropStageMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 45, + "startColumn": 41, + "charOffset": 1856, + "charLength": 33, + "snippet": { + "text": "XMaterial.BARRIER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 43, + "startColumn": 1, + "charOffset": 1739, + "charLength": 279, + "snippet": { + "text": "\n ItemStack itemOne = Item.create(XMaterial.BARRIER.parseMaterial());\n ItemStack itemTwo = Item.create(XMaterial.BARRIER.parseMaterial());\n\n ArrayList typeLore = ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a34343690d1b52a5", + "equalIndicator/v1": "d119f49fc5ae9cc53b3a9b1dfed6ba2a690ea0f87e9367c67f54a449f451875c" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/EditPaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 77, + "startColumn": 40, + "charOffset": 3165, + "charLength": 49, + "snippet": { + "text": "XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 75, + "startColumn": 1, + "charOffset": 3081, + "charLength": 215, + "snippet": { + "text": " @Override\n protected Mask getMask() {\n ItemStack filler = Item.create(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial(), \" \");\n return BinaryMask.builder(getMenu())\n .item(filler)" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "c74da2fe5fc327ec", + "equalIndicator/v1": "d2218ddcc38aa35ebc94489e6a74870820c1626b9e1f0aa3cf06377c788d1f0e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.WHEAT.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.WHEAT.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 47, + "startColumn": 43, + "charOffset": 2068, + "charLength": 31, + "snippet": { + "text": "XMaterial.WHEAT.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 45, + "startColumn": 1, + "charOffset": 1846, + "charLength": 718, + "snippet": { + "text": "\n ItemStack potatoItem = Item.create(XMaterial.POTATO.parseMaterial(), \"§bPotato\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack wheatItem = Item.create(XMaterial.WHEAT.parseMaterial(), \"§bWheat\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack cornItem = Item.create(XMaterial.PUMPKIN_SEEDS.parseMaterial(), \"§bCorn\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack vineyardItem = Item.create(XMaterial.VINE.parseMaterial(), \"§bVineyard\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "f9ff1d36c363da4d", + "equalIndicator/v1": "d258d4e32ab572e806a540e5bc84bf3b2577937f48b1406c1dc453e30f3328d1" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.COBBLESTONE_STAIRS.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.COBBLESTONE_STAIRS.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 39, + "startColumn": 47, + "charOffset": 1827, + "charLength": 44, + "snippet": { + "text": "XMaterial.COBBLESTONE_STAIRS.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 37, + "startColumn": 1, + "charOffset": 1576, + "charLength": 929, + "snippet": { + "text": "\n ItemStack flatRoofItem = Item.create(XMaterial.WHITE_CARPET.parseMaterial(), \"§bFlat Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat roof for\", \"skyscrapers using carpets\", \"or slabs\"));\n ItemStack gableRoofItem = Item.create(XMaterial.COBBLESTONE_STAIRS.parseMaterial(), \"§bGable Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using stairs\"));\n ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));\n ItemStack mediumSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bMedium Steep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses by creating\", \"a medium steep roof with slabs\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "3a658dbadba216a1", + "equalIndicator/v1": "d99d4e9fed3118efcc0a1b451bc53d09f73a1a1804dea40f8373e1777da091aa" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BIRCH_FENCE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BIRCH_FENCE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropStageMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 54, + "startColumn": 39, + "charOffset": 2399, + "charLength": 37, + "snippet": { + "text": "XMaterial.BIRCH_FENCE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 52, + "startColumn": 1, + "charOffset": 2314, + "charLength": 269, + "snippet": { + "text": " break;\n case WHEAT:\n itemOne = Item.create(XMaterial.BIRCH_FENCE.parseMaterial(), \"§bLight\", typeLore);\n itemTwo = Item.create(XMaterial.DARK_OAK_FENCE.parseMaterial(), \"§bDark\", typeLore);\n break;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "6854eed283b4ca9f", + "equalIndicator/v1": "dafa06c4b7383b436dd88a52f0a322e5dba67fbe35c3ed96b5fd8ad0ad5dd4c8" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.DEAD_BUSH.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.DEAD_BUSH.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 54, + "startColumn": 43, + "charOffset": 3342, + "charLength": 35, + "snippet": { + "text": "XMaterial.DEAD_BUSH.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 52, + "startColumn": 1, + "charOffset": 2928, + "charLength": 573, + "snippet": { + "text": " ItemStack meadowItem = Item.create(XMaterial.SHORT_GRASS.parseMaterial(), \"§bMeadow\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack harvestedItem = Item.create(XMaterial.HAY_BLOCK.parseMaterial(), \"§bHarvested\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n ItemStack otherItem = Item.create(XMaterial.DEAD_BUSH.parseMaterial(), \"§bOther\", ListUtil.createList(\"\", \"§8Left-click to select\", \"§8Right-click for more information\"));\n\n // Set items" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "cbd3f8fa5939e5bc", + "equalIndicator/v1": "e0f913284f7659bf23353dbac1afd9546f18876d4c9ed55fc165f960cc1bc5ec" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NAME_TAG.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.NAME_TAG.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 85, + "startColumn": 58, + "charOffset": 3484, + "charLength": 34, + "snippet": { + "text": "XMaterial.NAME_TAG.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 83, + "startColumn": 1, + "charOffset": 3300, + "charLength": 281, + "snippet": { + "text": " // Set the name item\n ArrayList nameLore = ListUtil.createList(\"\", \"§eCurrent Name: \", warp.getName());\n getMenu().getSlot(NAME_SLOT).setItem(Item.create(XMaterial.NAME_TAG.parseMaterial(), \"§6§lChange Name\", nameLore));\n\n // Set the group item" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d19bcb3a85e5175f", + "equalIndicator/v1": "e2f4596b1d8748f82e70e5e2b7ffeeefea39c3d7ef3cd8e071412a23167819db" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BARRIER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 103, + "startColumn": 31, + "charOffset": 4011, + "charLength": 33, + "snippet": { + "text": "XMaterial.BARRIER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 101, + "startColumn": 1, + "charOffset": 3827, + "charLength": 296, + "snippet": { + "text": " menu.getSlot(48).setItem(hasPreviousPage()\n ? Item.createCustomHeadBase64(BlockPaletteManager.LEFT_ARROW, \"§ePrevious Page\", null)\n : Item.create(XMaterial.BARRIER.parseMaterial(), \"§cNo Previous Page\", null));\n\n menu.getSlot(50).setItem(hasNextPage()" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "aaa8a9cf0a78bda8", + "equalIndicator/v1": "e42135870bf9b7e223ebcb4b50b50f5b7141e25267ed46dfdf956075ad18bf8e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.NAME_TAG.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.NAME_TAG.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 192, + "startColumn": 43, + "charOffset": 9124, + "charLength": 34, + "snippet": { + "text": "XMaterial.NAME_TAG.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 190, + "startColumn": 1, + "charOffset": 9025, + "charLength": 265, + "snippet": { + "text": " })\n .text(\"Name\")\n .itemLeft(Item.create(XMaterial.NAME_TAG.parseMaterial(), \"§6§lChange Name\"))\n .title(\"§8Change the warp name\")\n .plugin(BuildTeamTools.getInstance())" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "675d3709752436b2", + "equalIndicator/v1": "e6e1e17da1fc3dfda80a581194007cfc6a8da40f8ab24ffc4776a2f940f1f380" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'cfg.getString(place + \".World\")' might be null", + "markdown": "Argument `cfg.getString(place + \".World\")` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/Config.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 148, + "startColumn": 39, + "charOffset": 4543, + "charLength": 31, + "snippet": { + "text": "cfg.getString(place + \".World\")" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 146, + "startColumn": 1, + "charOffset": 4415, + "charLength": 246, + "snippet": { + "text": " int y = cfg.getInt(place + \".Y\");\n double z = cfg.getDouble(place + \".Z\");\n World world = Bukkit.getWorld(cfg.getString(place + \".World\"));\n\n if (cfg.getInt(place + \".Yaw\") != 0 || cfg.getInt(place + \".Pitch\") != 0) {" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "ff3a6ecbc02eb264", + "equalIndicator/v1": "ea9a11c3067dfb611d93abb3a5a1acc0d9566c45898beddcbb3e48648ce87a6e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.PAPER.get()' might be null", + "markdown": "Argument `XMaterial.PAPER.get()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/tree/menu/TreeHeightMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 37, + "startColumn": 57, + "charOffset": 1593, + "charLength": 21, + "snippet": { + "text": "XMaterial.PAPER.get()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 35, + "startColumn": 1, + "charOffset": 1462, + "charLength": 216, + "snippet": { + "text": "\n GeneratorModule.getInstance().getTree().getHeights().forEach(h ->\n treeHeights.add(new Tuple<>(Item.create(XMaterial.PAPER.get(), StringUtils.capitalize(h)), h)));\n\n return treeHeights;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "eb24d1538ba58bfd", + "equalIndicator/v1": "f3e914c81881f087b7f364ef2125e5cfaccf348362fe360c193f85e56bcbcbce" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.COBBLESTONE_SLAB.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.COBBLESTONE_SLAB.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 42, + "startColumn": 53, + "charOffset": 2558, + "charLength": 42, + "snippet": { + "text": "XMaterial.COBBLESTONE_SLAB.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 40, + "startColumn": 1, + "charOffset": 1988, + "charLength": 792, + "snippet": { + "text": " ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));\n ItemStack mediumSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bMedium Steep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses by creating\", \"a medium steep roof with slabs\"));\n ItemStack flatterSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bFlatter Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat gable roof for\", \"residential houses by creating\", \"a very flat roof with slabs\"));\n\n // Set items" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d1eed39726ef7d5f", + "equalIndicator/v1": "f5c23f968f5ae6eaf546ffaf539de04d6284b83d6769027becc59fce9b7615a0" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BOOK.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BOOK.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 215, + "startColumn": 51, + "charOffset": 8735, + "charLength": 30, + "snippet": { + "text": "XMaterial.BOOK.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 213, + "startColumn": 1, + "charOffset": 8661, + "charLength": 152, + "snippet": { + "text": " }\n }\n getMenu().getSlot(46).setItem(Item.create(XMaterial.BOOK.parseMaterial(), \"§bSelection\", new ArrayList<>(lore)));\n }\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "04c14fe2f5942edb", + "equalIndicator/v1": "f6ea734acb5160a4383211e702c5788e9394f0f07ca0f5a8b349ee3ca0eeec36" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.BARRIER.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.BARRIER.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 271, + "startColumn": 31, + "charOffset": 11137, + "charLength": 33, + "snippet": { + "text": "XMaterial.BARRIER.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 269, + "startColumn": 1, + "charOffset": 10940, + "charLength": 277, + "snippet": { + "text": " menu.getSlot(NEXT_SLOT).setItem(hasNextPage()\n ? Item.createCustomHeadBase64(BlockPaletteManager.RIGHT_ARROW, \"§eNext Page\", new ArrayList<>())\n : Item.create(XMaterial.BARRIER.parseMaterial(), \"§cNo Next Page\", new ArrayList<>()));\n }\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "c44cbf66fb1558bb", + "equalIndicator/v1": "f7312e8369cc6a3555a46277dd24e94174933abe7d22538d8c9cca82a1c4ff10" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 73, + "startColumn": 40, + "charOffset": 2846, + "charLength": 49, + "snippet": { + "text": "XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 71, + "startColumn": 1, + "charOffset": 2762, + "charLength": 215, + "snippet": { + "text": " @Override\n protected Mask getMask() {\n ItemStack filler = Item.create(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial(), \" \");\n return BinaryMask.builder(getMenu())\n .item(filler)" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "9689a104e7eb1e48", + "equalIndicator/v1": "f8b19e73a6041c03d5e5bc35cdc42c6813afdca2d1fd19226a89c2bf3b039bfc" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.DEAD_BUSH.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.DEAD_BUSH.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/field/menu/CropStageMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 39, + "charOffset": 2940, + "charLength": 35, + "snippet": { + "text": "XMaterial.DEAD_BUSH.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2855, + "charLength": 262, + "snippet": { + "text": " break;\n case OTHER:\n itemOne = Item.create(XMaterial.DEAD_BUSH.parseMaterial(), \"§bDry\", typeLore);\n itemTwo = Item.create(XMaterial.WATER_BUCKET.parseMaterial(), \"§bWet\", typeLore);\n break;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "aec283a4d255d74c", + "equalIndicator/v1": "fc974c5d8ddb6182ba0a57fdc3df012fdd8f665fa28dfc58f7b4c468f578eee1" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/PaletteBlockListMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 33, + "startColumn": 35, + "charOffset": 1243, + "charLength": 49, + "snippet": { + "text": "XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 31, + "startColumn": 1, + "charOffset": 1133, + "charLength": 242, + "snippet": { + "text": " protected Mask getMask() {\n return BinaryMask.builder(getMenu())\n .item(Item.create(XMaterial.GRAY_STAINED_GLASS_PANE.parseMaterial(), \" \"))\n .pattern(\"111111111\")\n .pattern(\"000000000\")" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "bcfd598c85903dda", + "equalIndicator/v1": "fe2acb1d10da6036ffe5e8ac3a7aee455ef7e29cac81b525b4b5f5d3d77f9774" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DataFlowIssue", + "kind": "fail", + "level": "warning", + "message": { + "text": "Argument 'XMaterial.STONE.parseMaterial()' might be null", + "markdown": "Argument `XMaterial.STONE.parseMaterial()` might be null" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/CreatePaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 97, + "startColumn": 29, + "charOffset": 3858, + "charLength": 31, + "snippet": { + "text": "XMaterial.STONE.parseMaterial()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 95, + "startColumn": 1, + "charOffset": 3781, + "charLength": 220, + "snippet": { + "text": "\n getMenu().getSlot(BLOCKS_SLOT).setItem(\n Item.create(XMaterial.STONE.parseMaterial(), \"§eSet Blocks\",\n new ArrayList<>(List.of(\"§7Selected: §f\" + blocks.size())))\n );" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "ffa5f4358063ef0e", + "equalIndicator/v1": "ff4dd73864d09e768f891cc49b7c5dbc53fb5dd43eebd6d338f5ba2b2f188075" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DefaultNotLastCaseInSwitch", + "kind": "fail", + "level": "warning", + "message": { + "text": "'default' branch not last case in 'switch' statement", + "markdown": "'default' branch not last case in 'switch' statement" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 205, + "startColumn": 13, + "charOffset": 28336, + "charLength": 7, + "snippet": { + "text": "default" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 203, + "startColumn": 1, + "charOffset": 28212, + "charLength": 233, + "snippet": { + "text": " public static ItemStack getBlankItem(SliderColor sliderColor, String name) {\n switch (sliderColor) {\n default:\n case WHITE:\n return Item.createCustomHeadBase64(WHITE_BLANK, name, null);" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "0c78acefdc45d3a3", + "equalIndicator/v1": "4fe6286c3d1e338a435c6cb7bafe7203b8fdba1d1d04c364c89a0ad43ee23147" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasCleanup": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DefaultNotLastCaseInSwitch", + "kind": "fail", + "level": "warning", + "message": { + "text": "'default' branch not last case in 'switch' statement", + "markdown": "'default' branch not last case in 'switch' statement" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 149, + "startColumn": 13, + "charOffset": 26192, + "charLength": 7, + "snippet": { + "text": "default" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 147, + "startColumn": 1, + "charOffset": 26148, + "charLength": 144, + "snippet": { + "text": "\n switch (sliderColor) {\n default:\n case WHITE:\n return getWhiteNumberHead(value, sliderName, null);" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "6a94c9cf8a34de5a", + "equalIndicator/v1": "a0045aab7a54dfaeda204c8559125c3b64664ee0b1eaa3a19fceb506b6ca5454" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasCleanup": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DefaultNotLastCaseInSwitch", + "kind": "fail", + "level": "warning", + "message": { + "text": "'default' branch not last case in 'switch' statement", + "markdown": "'default' branch not last case in 'switch' statement" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 167, + "startColumn": 13, + "charOffset": 26873, + "charLength": 7, + "snippet": { + "text": "default" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 165, + "startColumn": 1, + "charOffset": 26829, + "charLength": 165, + "snippet": { + "text": "\n switch (sliderColor) {\n default:\n case WHITE:\n return Item.createCustomHeadBase64(WHITE_PLUS, \"§a§l+ §e\" + name, null);" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "51895b8a365d2794", + "equalIndicator/v1": "b969356c6eea47e5b67ef62aae6b2db826338894ce7cb199d7f180d7ed55ebec" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasCleanup": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DefaultNotLastCaseInSwitch", + "kind": "fail", + "level": "warning", + "message": { + "text": "'default' branch not last case in 'switch' statement", + "markdown": "'default' branch not last case in 'switch' statement" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 185, + "startColumn": 13, + "charOffset": 27598, + "charLength": 7, + "snippet": { + "text": "default" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 183, + "startColumn": 1, + "charOffset": 27554, + "charLength": 166, + "snippet": { + "text": "\n switch (sliderColor) {\n default:\n case WHITE:\n return Item.createCustomHeadBase64(WHITE_MINUS, \"§c§l- §e\" + name, null);" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a573a19d9faaaa64", + "equalIndicator/v1": "d5268c4c725f299475b6e80014c41f4f88881f5ea61c4037ed32b52d3dfcdda8" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasCleanup": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "DefaultNotLastCaseInSwitch", + "kind": "fail", + "level": "warning", + "message": { + "text": "'default' branch not last case in 'switch' statement", + "markdown": "'default' branch not last case in 'switch' statement" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 195, + "startColumn": 13, + "charOffset": 27982, + "charLength": 7, + "snippet": { + "text": "default" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 193, + "startColumn": 1, + "charOffset": 27862, + "charLength": 225, + "snippet": { + "text": " public static ItemStack getXItem(SliderColor sliderColor, String name) {\n switch (sliderColor) {\n default:\n case WHITE:\n return Item.createCustomHeadBase64(WHITE_X, name, null);" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "37548dffaf3a5714", + "equalIndicator/v1": "e490faab167eb3a5568f6d20a2498c4ca2175a488c2c9e55fc127fe3b0249ea7" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasCleanup": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "EmptyStatementBody", + "kind": "fail", + "level": "warning", + "message": { + "text": "'if' statement has empty body", + "markdown": "`if` statement has empty body" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/common/components/pluginmessaging/PluginMessagingComponent.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 45, + "startColumn": 13, + "charOffset": 2282, + "charLength": 2, + "snippet": { + "text": "if" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 43, + "startColumn": 1, + "charOffset": 2159, + "charLength": 230, + "snippet": { + "text": " ChatHelper.logDebug(\"Plugin Message received: %s from Player: %s\", subChannel, player.getName());\n\n if (subChannel.equalsIgnoreCase(\"Ping\")) {\n // Do something? not sure what tbh\n }" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "16e4d35ad6ff56ce", + "equalIndicator/v1": "fd27eff150c61622c812172edb0ea2627bdb7912314dd0cad0f745e89e2536df" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "IgnoreResultOfCall", + "kind": "fail", + "level": "warning", + "message": { + "text": "Result of 'File.mkdirs()' is ignored", + "markdown": "Result of `File.mkdirs()` is ignored" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/common/components/updater/UpdaterComponent.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 306, + "startColumn": 30, + "charOffset": 10550, + "charLength": 6, + "snippet": { + "text": "mkdirs" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 304, + "startColumn": 1, + "charOffset": 10426, + "charLength": 215, + "snippet": { + "text": " in = new BufferedInputStream(inputStream);\n if (!updateFolder.exists())\n updateFolder.mkdirs();\n fout = new FileOutputStream(new File(updateFolder, file.getName()));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "88b6c3b3e52811c4", + "equalIndicator/v1": "3eb5f039d080ddc716560203b932732f3bad23ad7045c481dc33fe5b0a1e3e2f" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "IgnoreResultOfCall", + "kind": "fail", + "level": "warning", + "message": { + "text": "Result of 'JsonReader.nextName()' is ignored", + "markdown": "Result of `JsonReader.nextName()` is ignored" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/JsonUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 126, + "startColumn": 36, + "charOffset": 4909, + "charLength": 8, + "snippet": { + "text": "nextName" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 124, + "startColumn": 1, + "charOffset": 4812, + "charLength": 172, + "snippet": { + "text": " break;\n case NAME:\n jsonReader.nextName();\n break;\n case STRING:" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a8ff4164311b1e2c", + "equalIndicator/v1": "88ab3a35709685d84c087ae68807fc15b837be4f45ebe201b315b54476b68628" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "IgnoreResultOfCall", + "kind": "fail", + "level": "warning", + "message": { + "text": "Result of 'File.createNewFile()' is ignored", + "markdown": "Result of `File.createNewFile()` is ignored" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 259, + "startColumn": 29, + "charOffset": 10564, + "charLength": 13, + "snippet": { + "text": "createNewFile" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 257, + "startColumn": 1, + "charOffset": 10482, + "charLength": 239, + "snippet": { + "text": " if (parent != null) parent.mkdirs();\n\n paletteFile.createNewFile();\n plugin.getLogger().info(\"Created new palettes.yml file at: \" + paletteFile.getPath());\n } catch (IOException e) {" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a88bb8c493728568", + "equalIndicator/v1": "c5c22e1a7e88177751e8f87189ddf395aa7656fd9c7514cbab28b7ae3b54c170" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "IgnoreResultOfCall", + "kind": "fail", + "level": "warning", + "message": { + "text": "Result of 'File.mkdirs()' is ignored", + "markdown": "Result of `File.mkdirs()` is ignored" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteManager.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 257, + "startColumn": 44, + "charOffset": 10525, + "charLength": 6, + "snippet": { + "text": "mkdirs" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 255, + "startColumn": 1, + "charOffset": 10405, + "charLength": 175, + "snippet": { + "text": " try {\n File parent = paletteFile.getParentFile();\n if (parent != null) parent.mkdirs();\n\n paletteFile.createNewFile();" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "4f953868863986b1", + "equalIndicator/v1": "e5ffcaaaedffffa3b82d92f3c896e604a6b0a97a97bd34c1b52b9b417941b4a6" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "InnerClassMayBeStatic", + "kind": "fail", + "level": "warning", + "message": { + "text": "Inner class 'BlockModification' may be 'static'", + "markdown": "Inner class `BlockModification` may be 'static'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/ChangeTransaction.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 25, + "startColumn": 18, + "charOffset": 739, + "charLength": 17, + "snippet": { + "text": "BlockModification" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 23, + "startColumn": 1, + "charOffset": 688, + "charLength": 143, + "snippet": { + "text": "public class ChangeTransaction {\n\n public class BlockModification{\n public BlockModification(Block block, Material newType)\n {" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "4901a6074a46195c", + "equalIndicator/v1": "f28eb6019b8dcc7ef3febae0929e2a6f2c75aed25c136b65c8b68b2080058227" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "JavaReflectionMemberAccess", + "kind": "fail", + "level": "warning", + "message": { + "text": "Cannot resolve method 'findByFile'", + "markdown": "Cannot resolve method 'findByFile'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/model/GeneratorCollections.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 72, + "startColumn": 59, + "charOffset": 2969, + "charLength": 12, + "snippet": { + "text": "\"findByFile\"" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 70, + "startColumn": 1, + "charOffset": 2753, + "charLength": 343, + "snippet": { + "text": " }else if(CommonModule.getInstance().getDependencyComponent().isLegacyWorldEdit()) {\n Class formatClass = ClipboardFormat.class;\n Method findByFile = formatClass.getMethod(\"findByFile\", File.class);\n Method getReader = ClipboardFormat.class.getMethod(\"getReader\", InputStream.class);\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "05fedd2d7768aa80", + "equalIndicator/v1": "155b517e5c16f4ca63b3766e7f915309be1942d9bf84a772e05e11e97e6536eb" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "JavaReflectionMemberAccess", + "kind": "fail", + "level": "warning", + "message": { + "text": "Cannot resolve constructor with specified argument types", + "markdown": "Cannot resolve constructor with specified argument types" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/MiscModule.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 97, + "startColumn": 44, + "charOffset": 3182, + "charLength": 2, + "snippet": { + "text": "()" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 95, + "startColumn": 1, + "charOffset": 3083, + "charLength": 231, + "snippet": { + "text": " } catch (NoSuchMethodException ignored) {}\n\n return c.getDeclaredConstructor().newInstance();\n } catch (Exception t) {\n throw new RuntimeException(\"Cannot construct BlockPaletteCommand\", t);" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "ba291725cfce4d93", + "equalIndicator/v1": "d5df351eb4a6430789e00458680fd0b1b9af52ff263409004787bfa4548fd85d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "JavaReflectionMemberAccess", + "kind": "fail", + "level": "warning", + "message": { + "text": "Cannot resolve constructor with specified argument types", + "markdown": "Cannot resolve constructor with specified argument types" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/MiscModule.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 93, + "startColumn": 37, + "charOffset": 3017, + "charLength": 18, + "snippet": { + "text": "(JavaPlugin.class)" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 91, + "startColumn": 1, + "charOffset": 2962, + "charLength": 175, + "snippet": { + "text": "\n try {\n k = c.getConstructor(JavaPlugin.class);\n return k.newInstance(plugin);\n } catch (NoSuchMethodException ignored) {}" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "2fdad9614ce49955", + "equalIndicator/v1": "ee4d7a1e912a641567151c8a478962706e2d64dbdbc4c3f4857d718a9e9cd9ab" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "JavaReflectionMemberAccess", + "kind": "fail", + "level": "warning", + "message": { + "text": "Cannot resolve constructor with specified argument types", + "markdown": "Cannot resolve constructor with specified argument types" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/MiscModule.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 88, + "startColumn": 37, + "charOffset": 2831, + "charLength": 27, + "snippet": { + "text": "(BlockPaletteManager.class)" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 86, + "startColumn": 1, + "charOffset": 2776, + "charLength": 185, + "snippet": { + "text": "\n try {\n k = c.getConstructor(BlockPaletteManager.class);\n return k.newInstance(manager);\n } catch (NoSuchMethodException ignored) {}" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1fae3a73eade289c", + "equalIndicator/v1": "f656b1c08b4921cd8cf15ce44185d962d013360a4a126616e33bade5ed0f0f07" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "StaticInitializerReferencesSubClass", + "kind": "fail", + "level": "warning", + "message": { + "text": "Referencing subclass ModifiedAirocean from superclass GeographicProjection initializer might lead to class loading deadlock", + "markdown": "Referencing subclass ModifiedAirocean from superclass GeographicProjection initializer might lead to class loading deadlock" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/GeographicProjection.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 36, + "startColumn": 44, + "charOffset": 1494, + "charLength": 16, + "snippet": { + "text": "ModifiedAirocean" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 34, + "startColumn": 1, + "charOffset": 1335, + "charLength": 186, + "snippet": { + "text": " projections.put(\"airocean\", new Airocean());\n projections.put(\"conformal\", new ConformalEstimate());\n projections.put(\"bteairocean\", new ModifiedAirocean());\n }\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "57c4be24a9160db1", + "equalIndicator/v1": "ad033e809461eb22e068a7f177d876a8c115975144b9dd0f580d15c25ca72154" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "UnstableApiUsage", + "kind": "fail", + "level": "warning", + "message": { + "text": "'getRepositoriesMode()' is marked unstable with @Incubating", + "markdown": "'getRepositoriesMode()' is marked unstable with @Incubating" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "settings.gradle.kts", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 8, + "startColumn": 5, + "charOffset": 136, + "charLength": 16, + "snippet": { + "text": "repositoriesMode" + }, + "sourceLanguage": "kotlin" + }, + "contextRegion": { + "startLine": 6, + "startColumn": 1, + "charOffset": 98, + "charLength": 140, + "snippet": { + "text": "\ndependencyResolutionManagement {\n repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n repositories {\n mavenCentral()" + }, + "sourceLanguage": "kotlin" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "0fd8a4921789a886", + "equalIndicator/v1": "0512b895ad0aac53daeca8fde714bf46bb8f0766556d6e3966601ad7c4bb9edf" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "kotlin" + ] + } + }, + { + "ruleId": "UnstableApiUsage", + "kind": "fail", + "level": "warning", + "message": { + "text": "'repositories(org.gradle.api.Action)' is marked unstable with @Incubating", + "markdown": "'repositories(org.gradle.api.Action)' is marked unstable with @Incubating" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "settings.gradle.kts", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 9, + "startColumn": 5, + "charOffset": 201, + "charLength": 12, + "snippet": { + "text": "repositories" + }, + "sourceLanguage": "kotlin" + }, + "contextRegion": { + "startLine": 7, + "startColumn": 1, + "charOffset": 99, + "charLength": 198, + "snippet": { + "text": "dependencyResolutionManagement {\n repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n repositories {\n mavenCentral()\n //mavenLocal() // NEVER use in Production/Commits!" + }, + "sourceLanguage": "kotlin" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "c91e3a699b5af69c", + "equalIndicator/v1": "1b19f2a1b7d2fa1f6a7d80add6893742cc54923f4ffa97457d74fc0ee65d1b68" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "kotlin" + ] + } + }, + { + "ruleId": "UnstableApiUsage", + "kind": "fail", + "level": "warning", + "message": { + "text": "'FAIL_ON_PROJECT_REPOS' is declared in unstable enum 'org.gradle.api.initialization.resolve.RepositoriesMode' marked with @Incubating", + "markdown": "'FAIL_ON_PROJECT_REPOS' is declared in unstable enum 'org.gradle.api.initialization.resolve.RepositoriesMode' marked with @Incubating" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "settings.gradle.kts", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 8, + "startColumn": 43, + "charOffset": 174, + "charLength": 21, + "snippet": { + "text": "FAIL_ON_PROJECT_REPOS" + }, + "sourceLanguage": "kotlin" + }, + "contextRegion": { + "startLine": 6, + "startColumn": 1, + "charOffset": 98, + "charLength": 140, + "snippet": { + "text": "\ndependencyResolutionManagement {\n repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n repositories {\n mavenCentral()" + }, + "sourceLanguage": "kotlin" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1cdc49455faef659", + "equalIndicator/v1": "409f34faddd2d6e2b4a1752dca7153adad719248a0b972b0747befb0801b87fd" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "kotlin" + ] + } + }, + { + "ruleId": "UnstableApiUsage", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.gradle.api.initialization.resolve.RepositoriesMode' is marked unstable with @Incubating", + "markdown": "'org.gradle.api.initialization.resolve.RepositoriesMode' is marked unstable with @Incubating" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "settings.gradle.kts", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 8, + "startColumn": 26, + "charOffset": 157, + "charLength": 16, + "snippet": { + "text": "RepositoriesMode" + }, + "sourceLanguage": "kotlin" + }, + "contextRegion": { + "startLine": 6, + "startColumn": 1, + "charOffset": 98, + "charLength": 140, + "snippet": { + "text": "\ndependencyResolutionManagement {\n repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n repositories {\n mavenCentral()" + }, + "sourceLanguage": "kotlin" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1f54c87a45679b9c", + "equalIndicator/v1": "8499dffb3100cab9d74a313647e28b5154b6ee202954d78359ccea49cf838031" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "kotlin" + ] + } + }, + { + "ruleId": "UnusedAssignment", + "kind": "fail", + "level": "warning", + "message": { + "text": "Variable 'railwayLore' initializer 'ListUtil.createList(\"\", \"§eDescription:\", \"Generate railways with multiple tracks\", \"and many differ...' is redundant", + "markdown": "Variable `railwayLore` initializer `ListUtil.createList(\"\", \"§eDescription:\", \"Generate railways with multiple tracks\", \"and many differ...` is redundant" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 75, + "startColumn": 41, + "charOffset": 3693, + "charLength": 268, + "snippet": { + "text": "ListUtil.createList(\"\", \"§eDescription:\", \"Generate railways with multiple tracks\", \"and many different designs\", \"\", \"§eFeatures:\", \"- Custom Railway Width and Color (TODO)\", \"- Custom Track Count (TODO)\", \"\", \"§8Left-click to generate\", \"§8Right-click for Tutorial\")" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 73, + "startColumn": 1, + "charOffset": 3628, + "charLength": 513, + "snippet": { + "text": "\n // RAILWAY ITEM\n ArrayList railwayLore = ListUtil.createList(\"\", \"§eDescription:\", \"Generate railways with multiple tracks\", \"and many different designs\", \"\", \"§eFeatures:\", \"- Custom Railway Width and Color (TODO)\", \"- Custom Track Count (TODO)\", \"\", \"§8Left-click to generate\", \"§8Right-click for Tutorial\");\n\n railwayLore = ListUtil.createList(\"\", \"§cThis §eGenerator §cis currently broken\", \"§cRailway Generator is disabled\", \"\", \"§8If you want to help fixing ask on Dev Hub!\");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "c0a250071c11a70d", + "equalIndicator/v1": "2f4259ae20578ea5456c4ec5c70842789e46ed895f30f46e105c7d467bad29ab" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "UnusedAssignment", + "kind": "fail", + "level": "warning", + "message": { + "text": "Variable 'fieldLore' initializer 'ListUtil.createList(\"\", \"§eDescription:\", \"Generate fields with different\", \"crops and plants\", \"\", ...' is redundant", + "markdown": "Variable `fieldLore` initializer `ListUtil.createList(\"\", \"§eDescription:\", \"Generate fields with different\", \"crops and plants\", \"\", ...` is redundant" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/menu/GeneratorMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 113, + "startColumn": 39, + "charOffset": 6039, + "charLength": 220, + "snippet": { + "text": "ListUtil.createList(\"\", \"§eDescription:\", \"Generate fields with different\", \"crops and plants\", \"\", \"§eFeatures:\", \"- Custom Crop Type\", \"- Custom Crop Size\", \"\", \"§8Left-click to generate\", \"§8Right-click for Tutorial\")" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 111, + "startColumn": 1, + "charOffset": 5978, + "charLength": 457, + "snippet": { + "text": "\n // FIELD ITEM\n ArrayList fieldLore = ListUtil.createList(\"\", \"§eDescription:\", \"Generate fields with different\", \"crops and plants\", \"\", \"§eFeatures:\", \"- Custom Crop Type\", \"- Custom Crop Size\", \"\", \"§8Left-click to generate\", \"§8Right-click for Tutorial\");\n\n fieldLore = ListUtil.createList(\"\", \"§cThis §eGenerator §cis currently broken\", \"§cField Generator is disabled\", \"\", \"§8If you want to help fixing ask on Dev Hub!\");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "76ae52a112ce97ea", + "equalIndicator/v1": "48b52f8b60463de6af562259caaafe8522e60c8b2e425e49e4ccca0db37ea863" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "UnusedAssignment", + "kind": "fail", + "level": "warning", + "message": { + "text": "Variable 'resultMessage' initializer '\"\"' is redundant", + "markdown": "Variable `resultMessage` initializer `\"\"` is redundant" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/common/components/updater/UpdaterComponent.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 81, + "startColumn": 32, + "charOffset": 2615, + "charLength": 2, + "snippet": { + "text": "\"\"" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 79, + "startColumn": 1, + "charOffset": 2559, + "charLength": 110, + "snippet": { + "text": " thread.start();\n\n String resultMessage = \"\";\n switch (result) {\n case BAD_ID:" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1038351354d50e8d", + "equalIndicator/v1": "8859d6b717638ea81133da3ef34fb9ed0c8e5dfe91f5d8ff7367d0195b41e1ce" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + } + ], + "automationDetails": { + "id": "BuildTeamTools/qodana/2026-02-03", + "guid": "e943b4a0-6339-44b0-9f41-8feedafcd376", + "properties": { + "jobUrl": "https://github.com/BuildTheEarth/BuildTeamTools/actions/runs/21631365086", + "analysisKind": "regular" + } + }, + "newlineSequences": [ + "\r\n", + "\n" + ], + "properties": { + "qodana.promo.results": [ + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'parseMaterial()' is deprecated", + "markdown": "'parseMaterial()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 41, + "startColumn": 79, + "charOffset": 2329, + "charLength": 13, + "snippet": { + "text": "parseMaterial" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 39, + "startColumn": 1, + "charOffset": 1781, + "charLength": 978, + "snippet": { + "text": " ItemStack gableRoofItem = Item.create(XMaterial.COBBLESTONE_STAIRS.parseMaterial(), \"§bGable Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using stairs\"));\n ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));\n ItemStack mediumSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bMedium Steep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses by creating\", \"a medium steep roof with slabs\"));\n ItemStack flatterSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bFlatter Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat gable roof for\", \"residential houses by creating\", \"a very flat roof with slabs\"));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1f2e1c64ec2923fc", + "equalIndicator/v1": "083dcd90e7dc73ad025b6f055e058e0554393f605a1d7f771d255b45edd48365" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'net.md_5.bungee.api.chat.ClickEvent' is deprecated", + "markdown": "'net.md_5.bungee.api.chat.ClickEvent' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 61, + "startColumn": 43, + "charOffset": 3046, + "charLength": 10, + "snippet": { + "text": "ClickEvent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 59, + "startColumn": 1, + "charOffset": 2809, + "charLength": 407, + "snippet": { + "text": " public static void sendNotConnectedMessage(@NotNull Player player, String serverIP, String teamName) {\n TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a4959a6710392f86", + "equalIndicator/v1": "0baba49fe64dfdafcb3c942ee3809cc72971175d0f8cf5ad2fdedca40cae28c2" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.bukkit.ChatColor' is deprecated", + "markdown": "'org.bukkit.ChatColor' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 218, + "startColumn": 76, + "charOffset": 7892, + "charLength": 9, + "snippet": { + "text": "ChatColor" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 216, + "startColumn": 1, + "charOffset": 7567, + "charLength": 606, + "snippet": { + "text": " Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"Made by §bBuildTheEarth\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"GitHub:\" + ChatColor.WHITE + \" https://github.com/BuildTheEarth/BuildTeamTools\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(\" \");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "6323ec8dfbb8c025", + "equalIndicator/v1": "1da757c5261d24bad0cc9c65caf2df1b99352bdf185d512fc06b2a01d9a566e5" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'setLore(java.util.@org.jetbrains.annotations.Nullable List)' is deprecated", + "markdown": "'setLore(java.util.@org.jetbrains.annotations.Nullable List)' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 241, + "startColumn": 22, + "charOffset": 10846, + "charLength": 7, + "snippet": { + "text": "setLore" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 239, + "startColumn": 1, + "charOffset": 10744, + "charLength": 171, + "snippet": { + "text": " ItemMeta meta = stack.getItemMeta();\n if (meta != null) {\n meta.setLore(lore);\n stack.setItemMeta(meta);\n }" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "30c7c212e195c3e5", + "equalIndicator/v1": "1f57b0d15ca2d85cf89636c9840eb8e9d98573b62c8334fb03d75800974af7ec" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.bukkit.ChatColor' is deprecated", + "markdown": "'org.bukkit.ChatColor' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 219, + "startColumn": 47, + "charOffset": 8038, + "charLength": 9, + "snippet": { + "text": "ChatColor" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 217, + "startColumn": 1, + "charOffset": 7697, + "charLength": 482, + "snippet": { + "text": " Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"Made by §bBuildTheEarth\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"GitHub:\" + ChatColor.WHITE + \" https://github.com/BuildTheEarth/BuildTeamTools\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(\" \");\n }" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "6e43f12dbeef9f19", + "equalIndicator/v1": "220909c3772e39d3f3ea428233ac4af1d7ed2f94f7afbcba12a5b425b970be21" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'create()' is deprecated", + "markdown": "'create()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 112, + "charOffset": 3204, + "charLength": 6, + "snippet": { + "text": "create" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2916, + "charLength": 506, + "snippet": { + "text": " TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n\n String notConnected = \"§cThe team \" + teamName + \" does not run on Minecraft Version 1.20.5+ yet & is not connected to the network. Meanwhile please use this Server IP to connect to their server:\";" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "585e0e80de08563d", + "equalIndicator/v1": "29291840a24d4be9826a72972a734b6ccb22d66a85f73af4287ba7f9c3abafff" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'ComponentBuilder(java.lang.String)' is deprecated", + "markdown": "'ComponentBuilder(java.lang.String)' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 76, + "charOffset": 3168, + "charLength": 16, + "snippet": { + "text": "ComponentBuilder" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2916, + "charLength": 506, + "snippet": { + "text": " TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n\n String notConnected = \"§cThe team \" + teamName + \" does not run on Minecraft Version 1.20.5+ yet & is not connected to the network. Meanwhile please use this Server IP to connect to their server:\";" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "dd87e44f47667a0c", + "equalIndicator/v1": "2cf2f5760ceb852172cf9031ce7066ec134d03d338b42dfb50eec74dd753e83a" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.bukkit.ChatColor' is deprecated", + "markdown": "'org.bukkit.ChatColor' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 200, + "startColumn": 47, + "charOffset": 6744, + "charLength": 9, + "snippet": { + "text": "ChatColor" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 198, + "startColumn": 1, + "charOffset": 6586, + "charLength": 349, + "snippet": { + "text": " private void sendBuildTeamToolsConsoleStartupMessage(){\n Bukkit.getConsoleSender().sendMessage(\" \");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"--------------- BuildTeamTools V\" + BuildTeamTools.getInstance().getDescription().getVersion() + \" ----------------\");\n Bukkit.getConsoleSender().sendMessage(\" \");\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "882ad890a75dabc5", + "equalIndicator/v1": "3f63276a66214367258a77efb43b9d7f3bf4ab23954ab13cb7aa0f95e70025d6" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.bukkit.ChatColor' is deprecated", + "markdown": "'org.bukkit.ChatColor' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 217, + "startColumn": 47, + "charOffset": 7743, + "charLength": 9, + "snippet": { + "text": "ChatColor" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 215, + "startColumn": 1, + "charOffset": 7515, + "charLength": 606, + "snippet": { + "text": " Bukkit.getConsoleSender().sendMessage(\" \");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"Made by §bBuildTheEarth\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"GitHub:\" + ChatColor.WHITE + \" https://github.com/BuildTheEarth/BuildTeamTools\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "cde35ba3d45b7f33", + "equalIndicator/v1": "418173c3cbfbb02da59bcf620190de5933572d2bd875ced167b02068d4a450e5" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'parseMaterial()' is deprecated", + "markdown": "'parseMaterial()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 39, + "startColumn": 76, + "charOffset": 1856, + "charLength": 13, + "snippet": { + "text": "parseMaterial" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 37, + "startColumn": 1, + "charOffset": 1576, + "charLength": 929, + "snippet": { + "text": "\n ItemStack flatRoofItem = Item.create(XMaterial.WHITE_CARPET.parseMaterial(), \"§bFlat Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat roof for\", \"skyscrapers using carpets\", \"or slabs\"));\n ItemStack gableRoofItem = Item.create(XMaterial.COBBLESTONE_STAIRS.parseMaterial(), \"§bGable Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using stairs\"));\n ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));\n ItemStack mediumSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bMedium Steep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses by creating\", \"a medium steep roof with slabs\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d0d2e2efc4610842", + "equalIndicator/v1": "4184e21357b56c76b487fe826ad9b3d40bb7dccc468e5bf672e33cc06fafe65b" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'getLore()' is deprecated", + "markdown": "'getLore()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 250, + "startColumn": 83, + "charOffset": 11199, + "charLength": 7, + "snippet": { + "text": "getLore" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 248, + "startColumn": 1, + "charOffset": 11014, + "charLength": 250, + "snippet": { + "text": " try {\n if (stack != null && stack.hasItemMeta() && stack.getItemMeta().hasLore()) {\n return new ArrayList<>(Objects.requireNonNull(stack.getItemMeta().getLore()));\n }\n } catch (Exception ignored) {}" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "0edfd999548fe931", + "equalIndicator/v1": "541f065e625840ef0f116bad0b57f2f2e364c35664aa9824305aaada6d1edd4e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.bukkit.UnsafeValues' is deprecated since version 1.7.2", + "markdown": "'org.bukkit.UnsafeValues' is deprecated since version 1.7.2" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 37, + "startColumn": 9, + "charOffset": 1643, + "charLength": 12, + "snippet": { + "text": "UnsafeValues" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 35, + "startColumn": 1, + "charOffset": 1512, + "charLength": 250, + "snippet": { + "text": " // Must be 1.20.5 / 766 or higher for transfer capability\n int playerVersion = player.getProtocolVersion();\n UnsafeValues unsafeValues = Bukkit.getUnsafe();\n int serverProtocolVersion = unsafeValues.getProtocolVersion();\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "3f7449273e890330", + "equalIndicator/v1": "56257e6a35802d3627c4336d0450b9b3b6985a847d2f9da89c08be477420ac70" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.bukkit.ChatColor' is deprecated", + "markdown": "'org.bukkit.ChatColor' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 217, + "startColumn": 76, + "charOffset": 7772, + "charLength": 9, + "snippet": { + "text": "ChatColor" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 215, + "startColumn": 1, + "charOffset": 7515, + "charLength": 606, + "snippet": { + "text": " Bukkit.getConsoleSender().sendMessage(\" \");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"Made by §bBuildTheEarth\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"GitHub:\" + ChatColor.WHITE + \" https://github.com/BuildTheEarth/BuildTeamTools\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "1af8b78ba28aab69", + "equalIndicator/v1": "5e0876b9abd92062c5ff7ee23a1e8efc614087c9ae4cb0d2bad4c3f8d957c796" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'SHOW_TEXT' is deprecated", + "markdown": "'SHOW_TEXT' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 61, + "charOffset": 3153, + "charLength": 9, + "snippet": { + "text": "SHOW_TEXT" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2916, + "charLength": 506, + "snippet": { + "text": " TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n\n String notConnected = \"§cThe team \" + teamName + \" does not run on Minecraft Version 1.20.5+ yet & is not connected to the network. Meanwhile please use this Server IP to connect to their server:\";" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "5fa1bb7732d1c785", + "equalIndicator/v1": "680513134fc840411e6c140640daa1644656bc6d126fdaa9ecfdc34ab3c6027b" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'net.md_5.bungee.api.chat.HoverEvent' is deprecated", + "markdown": "'net.md_5.bungee.api.chat.HoverEvent' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 32, + "charOffset": 3124, + "charLength": 10, + "snippet": { + "text": "HoverEvent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2916, + "charLength": 506, + "snippet": { + "text": " TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n\n String notConnected = \"§cThe team \" + teamName + \" does not run on Minecraft Version 1.20.5+ yet & is not connected to the network. Meanwhile please use this Server IP to connect to their server:\";" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "15c10f53d98d6bac", + "equalIndicator/v1": "68821a047dee735859eb94681fecd68788db30b0b2dd80dea141b3d899d3b13d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'parseMaterial()' is deprecated", + "markdown": "'parseMaterial()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 283, + "startColumn": 31, + "charOffset": 12395, + "charLength": 13, + "snippet": { + "text": "parseMaterial" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 281, + "startColumn": 1, + "charOffset": 12285, + "charLength": 205, + "snippet": { + "text": " private Material safeMat(XMaterial xmat, Material fallback) {\n try {\n Material m = xmat.parseMaterial();\n return (m != null) ? m : fallback;\n } catch (Throwable t) {" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "e5303e828076f0ed", + "equalIndicator/v1": "6c779ce8801c6f1f1ba9751ef015500b3ce2d1073b77ab010621383a1a78d192" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'net.md_5.bungee.api.chat.TextComponent' is deprecated", + "markdown": "'net.md_5.bungee.api.chat.TextComponent' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 60, + "startColumn": 34, + "charOffset": 2949, + "charLength": 13, + "snippet": { + "text": "TextComponent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 58, + "startColumn": 1, + "charOffset": 2801, + "charLength": 414, + "snippet": { + "text": " */\n public static void sendNotConnectedMessage(@NotNull Player player, String serverIP, String teamName) {\n TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "7f5188b1d2d49224", + "equalIndicator/v1": "6ca5ebd426323a5fa3827a6dadb49ec0ab228c74331221a7618a49b7a6d7db85" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'net.md_5.bungee.api.chat.HoverEvent.Action' is deprecated", + "markdown": "'net.md_5.bungee.api.chat.HoverEvent.Action' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 54, + "charOffset": 3146, + "charLength": 6, + "snippet": { + "text": "Action" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2916, + "charLength": 506, + "snippet": { + "text": " TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n\n String notConnected = \"§cThe team \" + teamName + \" does not run on Minecraft Version 1.20.5+ yet & is not connected to the network. Meanwhile please use this Server IP to connect to their server:\";" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "f36f10d3a59dea91", + "equalIndicator/v1": "71d4a1934d48d4eb1695bba8fc0202816f86a2058b164829065f52b3404ff2bb" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'setClickEvent(net.md_5.bungee.api.chat.ClickEvent)' is deprecated", + "markdown": "'setClickEvent(net.md_5.bungee.api.chat.ClickEvent)' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 61, + "startColumn": 14, + "charOffset": 3017, + "charLength": 13, + "snippet": { + "text": "setClickEvent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 59, + "startColumn": 1, + "charOffset": 2809, + "charLength": 407, + "snippet": { + "text": " public static void sendNotConnectedMessage(@NotNull Player player, String serverIP, String teamName) {\n TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "bcfe8effbb45c083", + "equalIndicator/v1": "7a91ec1864c08b61e3717696015f09471624388d09a04db53f6dc3fda2d90e14" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'parseMaterial()' is deprecated", + "markdown": "'parseMaterial()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 38, + "startColumn": 69, + "charOffset": 1645, + "charLength": 13, + "snippet": { + "text": "parseMaterial" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 36, + "startColumn": 1, + "charOffset": 1537, + "charLength": 713, + "snippet": { + "text": " protected void setPreviewItems() {\n\n ItemStack flatRoofItem = Item.create(XMaterial.WHITE_CARPET.parseMaterial(), \"§bFlat Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat roof for\", \"skyscrapers using carpets\", \"or slabs\"));\n ItemStack gableRoofItem = Item.create(XMaterial.COBBLESTONE_STAIRS.parseMaterial(), \"§bGable Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using stairs\"));\n ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "7d6d7972dda202fc", + "equalIndicator/v1": "8054c1908da52c3c71b43f5fcc9cc7bb7c17bd794a35e20ca9bf42fea47b8c03" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'net.md_5.bungee.api.chat.ClickEvent' is deprecated", + "markdown": "'net.md_5.bungee.api.chat.ClickEvent' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 61, + "startColumn": 32, + "charOffset": 3035, + "charLength": 10, + "snippet": { + "text": "ClickEvent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 59, + "startColumn": 1, + "charOffset": 2809, + "charLength": 407, + "snippet": { + "text": " public static void sendNotConnectedMessage(@NotNull Player player, String serverIP, String teamName) {\n TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "90ee531512669858", + "equalIndicator/v1": "806aca422d7bfaf05c9823c2efec6f36c9ff1fe3fc95e1f7cbdaa85689b097e0" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'sendMessage(net.md_5.bungee.api.chat.BaseComponent)' is deprecated", + "markdown": "'sendMessage(net.md_5.bungee.api.chat.BaseComponent)' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 69, + "startColumn": 25, + "charOffset": 3555, + "charLength": 11, + "snippet": { + "text": "sendMessage" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 67, + "startColumn": 1, + "charOffset": 3457, + "charLength": 302, + "snippet": { + "text": " player.sendMessage(notConnected);\n player.sendMessage(\"\");\n player.spigot().sendMessage(comp);\n player.sendMessage(\"\");\n player.sendMessage(\"§cPress Ctrl + A and Ctrl + C to copy the ip → Press ESC → Back to Menu → Multiplayer → Add Server → Ctrl+V → Done → Join.\");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "084e7ae9c4e93f01", + "equalIndicator/v1": "806e0efee3bd731310a8bf859282d18e25fa2275641990ce2caa25739c0e5829" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'net.md_5.bungee.api.chat.ComponentBuilder' is deprecated", + "markdown": "'net.md_5.bungee.api.chat.ComponentBuilder' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 76, + "charOffset": 3168, + "charLength": 16, + "snippet": { + "text": "ComponentBuilder" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2916, + "charLength": 506, + "snippet": { + "text": " TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n\n String notConnected = \"§cThe team \" + teamName + \" does not run on Minecraft Version 1.20.5+ yet & is not connected to the network. Meanwhile please use this Server IP to connect to their server:\";" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "dd87e44f47667a0c", + "equalIndicator/v1": "82310de953e613403f169950baf590ac3404c7e72fc45094bc6cc08ee2f1a839" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'ClickEvent(net.md_5.bungee.api.chat.ClickEvent.Action, java.lang.String)' is deprecated", + "markdown": "'ClickEvent(net.md_5.bungee.api.chat.ClickEvent.Action, java.lang.String)' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 61, + "startColumn": 32, + "charOffset": 3035, + "charLength": 10, + "snippet": { + "text": "ClickEvent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 59, + "startColumn": 1, + "charOffset": 2809, + "charLength": 407, + "snippet": { + "text": " public static void sendNotConnectedMessage(@NotNull Player player, String serverIP, String teamName) {\n TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "90ee531512669858", + "equalIndicator/v1": "8372cb30768ea2167c5b74f1c6803b649d39349a92a27a32e2a3e79048966b5d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'SUGGEST_COMMAND' is deprecated", + "markdown": "'SUGGEST_COMMAND' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 61, + "startColumn": 61, + "charOffset": 3064, + "charLength": 15, + "snippet": { + "text": "SUGGEST_COMMAND" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 59, + "startColumn": 1, + "charOffset": 2809, + "charLength": 407, + "snippet": { + "text": " public static void sendNotConnectedMessage(@NotNull Player player, String serverIP, String teamName) {\n TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "7b5140d4819d451b", + "equalIndicator/v1": "86950505534010c7bffcd2982a9a08e7fedf038fa3a798069ff431d308667f5e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'TextComponent(java.lang.String)' is deprecated", + "markdown": "'TextComponent(java.lang.String)' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 60, + "startColumn": 34, + "charOffset": 2949, + "charLength": 13, + "snippet": { + "text": "TextComponent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 58, + "startColumn": 1, + "charOffset": 2801, + "charLength": 414, + "snippet": { + "text": " */\n public static void sendNotConnectedMessage(@NotNull Player player, String serverIP, String teamName) {\n TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "7f5188b1d2d49224", + "equalIndicator/v1": "9600e07a6565cfcf232f32ed686ba30ba04746843b3c877f785944607dcfff7d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'HoverEvent(net.md_5.bungee.api.chat.HoverEvent.Action, net.md_5.bungee.api.chat.BaseComponent[])' is deprecated", + "markdown": "'HoverEvent(net.md_5.bungee.api.chat.HoverEvent.Action, net.md_5.bungee.api.chat.BaseComponent\\[\\])' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 32, + "charOffset": 3124, + "charLength": 10, + "snippet": { + "text": "HoverEvent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2916, + "charLength": 506, + "snippet": { + "text": " TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n\n String notConnected = \"§cThe team \" + teamName + \" does not run on Minecraft Version 1.20.5+ yet & is not connected to the network. Meanwhile please use this Server IP to connect to their server:\";" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "15c10f53d98d6bac", + "equalIndicator/v1": "972654d71b81ba91f3107d0b7ac83c75c9fa19f9434869ee875c28312e2522a6" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.bukkit.ChatColor' is deprecated", + "markdown": "'org.bukkit.ChatColor' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 218, + "startColumn": 105, + "charOffset": 7921, + "charLength": 9, + "snippet": { + "text": "ChatColor" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 216, + "startColumn": 1, + "charOffset": 7567, + "charLength": 606, + "snippet": { + "text": " Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"Made by §bBuildTheEarth\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"GitHub:\" + ChatColor.WHITE + \" https://github.com/BuildTheEarth/BuildTeamTools\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(\" \");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "682c096d400df97e", + "equalIndicator/v1": "98dbc2e95ddfeedbfc860dad5c5a854c8e204efd9d14749ecef3d89858da9a5e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'setHoverEvent(net.md_5.bungee.api.chat.HoverEvent)' is deprecated", + "markdown": "'setHoverEvent(net.md_5.bungee.api.chat.HoverEvent)' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 14, + "charOffset": 3106, + "charLength": 13, + "snippet": { + "text": "setHoverEvent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2916, + "charLength": 506, + "snippet": { + "text": " TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n\n String notConnected = \"§cThe team \" + teamName + \" does not run on Minecraft Version 1.20.5+ yet & is not connected to the network. Meanwhile please use this Server IP to connect to their server:\";" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "b634ccb0bdfa9bd8", + "equalIndicator/v1": "9c444e9ec411187e6837e416ddad89d6db0862072967ba54cb990e0f37a5e784" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'getItem()' is deprecated", + "markdown": "'getItem()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 164, + "startColumn": 65, + "charOffset": 7156, + "charLength": 7, + "snippet": { + "text": "getItem" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 162, + "startColumn": 1, + "charOffset": 7003, + "charLength": 252, + "snippet": { + "text": "\n // Update clicked slot title correctly (palette name if custom)\n ItemStack cur = getMenu().getSlot(slot).getItem();\n if (cur != null) {\n String baseTitle;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "22de6b6ceab8e6f1", + "equalIndicator/v1": "9e99f04282db0a985f90f1e7cfe92ccf9a73521a82ab5eed20811560085e114d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'getDescription()' is deprecated", + "markdown": "'getDescription()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 200, + "startColumn": 132, + "charOffset": 6829, + "charLength": 14, + "snippet": { + "text": "getDescription" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 198, + "startColumn": 1, + "charOffset": 6586, + "charLength": 349, + "snippet": { + "text": " private void sendBuildTeamToolsConsoleStartupMessage(){\n Bukkit.getConsoleSender().sendMessage(\" \");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"--------------- BuildTeamTools V\" + BuildTeamTools.getInstance().getDescription().getVersion() + \" ----------------\");\n Bukkit.getConsoleSender().sendMessage(\" \");\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "21a273c76f1e8dec", + "equalIndicator/v1": "a6537cf727426088a9a3aa796a3eb04a3cace453a046d937567e8fcfc01cf35d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'parseMaterial()' is deprecated", + "markdown": "'parseMaterial()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 42, + "startColumn": 80, + "charOffset": 2585, + "charLength": 13, + "snippet": { + "text": "parseMaterial" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 40, + "startColumn": 1, + "charOffset": 1988, + "charLength": 792, + "snippet": { + "text": " ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));\n ItemStack mediumSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bMedium Steep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses by creating\", \"a medium steep roof with slabs\"));\n ItemStack flatterSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bFlatter Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat gable roof for\", \"residential houses by creating\", \"a very flat roof with slabs\"));\n\n // Set items" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "5a6841e786473e69", + "equalIndicator/v1": "b60033c0b779c856d23300b63721c0400c76840844505759b0fffcee1acb251d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'parseMaterial()' is deprecated", + "markdown": "'parseMaterial()' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/RoofTypeMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 40, + "startColumn": 78, + "charOffset": 2065, + "charLength": 13, + "snippet": { + "text": "parseMaterial" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 38, + "startColumn": 1, + "charOffset": 1577, + "charLength": 1181, + "snippet": { + "text": " ItemStack flatRoofItem = Item.create(XMaterial.WHITE_CARPET.parseMaterial(), \"§bFlat Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat roof for\", \"skyscrapers using carpets\", \"or slabs\"));\n ItemStack gableRoofItem = Item.create(XMaterial.COBBLESTONE_STAIRS.parseMaterial(), \"§bGable Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using stairs\"));\n ItemStack steepSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bSteep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses using the\", \"steepest way you can\", \"create a roof with slabs\"));\n ItemStack mediumSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bMedium Steep Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A gable roof for\", \"residential houses by creating\", \"a medium steep roof with slabs\"));\n ItemStack flatterSlabRoofItem = Item.create(XMaterial.COBBLESTONE_SLAB.parseMaterial(), \"§bFlatter Slab Roof\", ListUtil.createList(\"\", \"§eDescription:\", \"A flat gable roof for\", \"residential houses by creating\", \"a very flat roof with slabs\"));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "04998445c9b35aef", + "equalIndicator/v1": "b6df8d408a580cdd6234aa456caaf2cbff5916c349bdafe384389d9992a1848e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'net.md_5.bungee.api.chat.HoverEvent' is deprecated", + "markdown": "'net.md_5.bungee.api.chat.HoverEvent' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 62, + "startColumn": 43, + "charOffset": 3135, + "charLength": 10, + "snippet": { + "text": "HoverEvent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 60, + "startColumn": 1, + "charOffset": 2916, + "charLength": 506, + "snippet": { + "text": " TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n\n String notConnected = \"§cThe team \" + teamName + \" does not run on Minecraft Version 1.20.5+ yet & is not connected to the network. Meanwhile please use this Server IP to connect to their server:\";" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "9e58277259011c90", + "equalIndicator/v1": "ccd662b34d3062666bef97ad01dbcea42a3f7d5d2969a1c01bdf14e6ac24c7f1" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'net.md_5.bungee.api.chat.ClickEvent.Action' is deprecated", + "markdown": "'net.md_5.bungee.api.chat.ClickEvent.Action' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 61, + "startColumn": 54, + "charOffset": 3057, + "charLength": 6, + "snippet": { + "text": "Action" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 59, + "startColumn": 1, + "charOffset": 2809, + "charLength": 407, + "snippet": { + "text": " public static void sendNotConnectedMessage(@NotNull Player player, String serverIP, String teamName) {\n TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "e7854fd3439e0032", + "equalIndicator/v1": "cf74e876956dd67f06c1ed78fe3e6588dce497e7dec356c41fa18e9e76fd1a2d" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'net.md_5.bungee.api.chat.TextComponent' is deprecated", + "markdown": "'net.md_5.bungee.api.chat.TextComponent' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 60, + "startColumn": 9, + "charOffset": 2924, + "charLength": 13, + "snippet": { + "text": "TextComponent" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 58, + "startColumn": 1, + "charOffset": 2801, + "charLength": 414, + "snippet": { + "text": " */\n public static void sendNotConnectedMessage(@NotNull Player player, String serverIP, String teamName) {\n TextComponent comp = new TextComponent(\"§e\" + serverIP + \" §7(Click to copy)\");\n comp.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, serverIP));\n comp.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(\"§eClick to copy\").create()));" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "7d1d7f07794783fe", + "equalIndicator/v1": "e7339f2e2f49ad7310a4bbf404e7accf36ace6243e0df0483ee55c27b2d6107e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'getUnsafe()' is deprecated since version 1.7.2", + "markdown": "'getUnsafe()' is deprecated since version 1.7.2" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 37, + "startColumn": 44, + "charOffset": 1678, + "charLength": 9, + "snippet": { + "text": "getUnsafe" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 35, + "startColumn": 1, + "charOffset": 1512, + "charLength": 250, + "snippet": { + "text": " // Must be 1.20.5 / 766 or higher for transfer capability\n int playerVersion = player.getProtocolVersion();\n UnsafeValues unsafeValues = Bukkit.getUnsafe();\n int serverProtocolVersion = unsafeValues.getProtocolVersion();\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a6221cdac6c02e64", + "equalIndicator/v1": "ee120c3e5b36889759b01589f6b578fff5e17fce2d5825104bde3460c3773232" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.bukkit.ChatColor' is deprecated", + "markdown": "'org.bukkit.ChatColor' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 216, + "startColumn": 47, + "charOffset": 7613, + "charLength": 9, + "snippet": { + "text": "ChatColor" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 214, + "startColumn": 1, + "charOffset": 7514, + "charLength": 477, + "snippet": { + "text": "\n Bukkit.getConsoleSender().sendMessage(\" \");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"Made by §bBuildTheEarth\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"GitHub:\" + ChatColor.WHITE + \" https://github.com/BuildTheEarth/BuildTeamTools\");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "c775b6b4bdc87f21", + "equalIndicator/v1": "f015f70848beaf1055e001fca767a6c8880c9e441ae0a754d8126dea941ab8de" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "Deprecation", + "kind": "fail", + "level": "warning", + "message": { + "text": "'org.bukkit.ChatColor' is deprecated", + "markdown": "'org.bukkit.ChatColor' is deprecated" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/ModuleHandler.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 218, + "startColumn": 47, + "charOffset": 7863, + "charLength": 9, + "snippet": { + "text": "ChatColor" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 216, + "startColumn": 1, + "charOffset": 7567, + "charLength": 606, + "snippet": { + "text": " Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"Made by §bBuildTheEarth\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + \"> \" + ChatColor.GRAY + \"GitHub:\" + ChatColor.WHITE + \" https://github.com/BuildTheEarth/BuildTeamTools\");\n Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + \"------------------------------------------------------------\");\n Bukkit.getConsoleSender().sendMessage(\" \");" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "ec5bca42cbdf4c01", + "equalIndicator/v1": "fadfc6ee26adeeae6921d61868471453aba80a556f6fbe22bd5d6f089451c40c" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "FieldCanBeLocal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field can be converted to a local variable", + "markdown": "Field can be converted to a local variable" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 46, + "startColumn": 30, + "charOffset": 1890, + "charLength": 6, + "snippet": { + "text": "plugin" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 44, + "startColumn": 1, + "charOffset": 1813, + "charLength": 118, + "snippet": { + "text": "\n private final BlockPaletteManager manager;\n private final JavaPlugin plugin;\n private final Logger logger;\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "97aa861481986500", + "equalIndicator/v1": "33ed71ab74d36682c8ec926d72f721600c3b5cac0e9eca8686a98c78c56d6cef" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "FieldCanBeLocal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field can be converted to a local variable", + "markdown": "Field can be converted to a local variable" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/ChoosePaletteBlocksMenu.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 45, + "startColumn": 39, + "charOffset": 1852, + "charLength": 7, + "snippet": { + "text": "manager" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 43, + "startColumn": 1, + "charOffset": 1751, + "charLength": 179, + "snippet": { + "text": " + \"ZDkwMzcyYWFiMTQwNzgxZjVkZmJjNCJ9fX0=\";\n\n private final BlockPaletteManager manager;\n private final JavaPlugin plugin;\n private final Logger logger;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "e731633d87ceea9a", + "equalIndicator/v1": "e1c3fb5e4948c6430fdeaf185048c00ff9218c8c43e18ffe18c6a403552e5aa5" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'VECTOR_Y' may be 'final'", + "markdown": "Field `VECTOR_Y` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 9, + "startColumn": 24, + "charOffset": 217, + "charLength": 8, + "snippet": { + "text": "VECTOR_Y" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 7, + "startColumn": 1, + "charOffset": 160, + "charLength": 95, + "snippet": { + "text": "\n private double[][] VECTOR_X;\n private double[][] VECTOR_Y;\n private int sideLength;\n" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "72bc66a4eaac3ef4", + "equalIndicator/v1": "0575778094b1cb4196678b30a4cd944cab72fec403b17104468d27537d029c99" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "hasCleanup": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'VECTOR_X' may be 'final'", + "markdown": "Field `VECTOR_X` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 8, + "startColumn": 24, + "charOffset": 184, + "charLength": 8, + "snippet": { + "text": "VECTOR_X" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 6, + "startColumn": 1, + "charOffset": 123, + "charLength": 131, + "snippet": { + "text": "public class InvertableVectorField {\n\n private double[][] VECTOR_X;\n private double[][] VECTOR_Y;\n private int sideLength;" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "74b6128939e7e2c6", + "equalIndicator/v1": "1fbe629612f9b16f9825eb1a3184969307cb6e09d1fb15e5d9dee301d2a8a467" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "hasCleanup": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "FieldMayBeFinal", + "kind": "fail", + "level": "warning", + "message": { + "text": "Field 'sideLength' may be 'final'", + "markdown": "Field `sideLength` may be 'final'" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 10, + "startColumn": 17, + "charOffset": 243, + "charLength": 10, + "snippet": { + "text": "sideLength" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 8, + "startColumn": 1, + "charOffset": 161, + "charLength": 159, + "snippet": { + "text": " private double[][] VECTOR_X;\n private double[][] VECTOR_Y;\n private int sideLength;\n\n public InvertableVectorField(double[][] vx, double[][] vy) {" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "e80de2980f2837b0", + "equalIndicator/v1": "f78fe758df410ba25ccf06f92840cf2601e4c3a2bc4c0f7a53596491d35e1a9e" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "hasCleanup": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "JavadocDeclaration", + "kind": "fail", + "level": "warning", + "message": { + "text": "'@param c' tag description is missing", + "markdown": "`@param c` tag description is missing" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 73, + "startColumn": 15, + "charOffset": 2620, + "charLength": 1, + "snippet": { + "text": "c" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 71, + "startColumn": 1, + "charOffset": 2574, + "charLength": 70, + "snippet": { + "text": " * @param a\n * @param b\n * @param c\n * @return\n */" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "2f22db2c70361171", + "equalIndicator/v1": "059ea4c40e07e41fd501d7dc0a360ef58600370972079a17703d3489d71a5d73" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "JavadocDeclaration", + "kind": "fail", + "level": "warning", + "message": { + "text": "'@param a' tag description is missing", + "markdown": "`@param a` tag description is missing" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 71, + "startColumn": 15, + "charOffset": 2588, + "charLength": 1, + "snippet": { + "text": "a" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 69, + "startColumn": 1, + "charOffset": 2522, + "charLength": 99, + "snippet": { + "text": " * TODO produceZYZRotationMatrix javadoc\n *\n * @param a\n * @param b\n * @param c" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "a16c04cd4f91ffec", + "equalIndicator/v1": "1aadc5efc98d9315b8a9428b40a74790358e6809b73468505bba72db50e78616" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "JavadocDeclaration", + "kind": "fail", + "level": "warning", + "message": { + "text": "'@param b' tag description is missing", + "markdown": "`@param b` tag description is missing" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 72, + "startColumn": 15, + "charOffset": 2604, + "charLength": 1, + "snippet": { + "text": "b" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 70, + "startColumn": 1, + "charOffset": 2567, + "charLength": 69, + "snippet": { + "text": " *\n * @param a\n * @param b\n * @param c\n * @return" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "d6509e40573e88ba", + "equalIndicator/v1": "1f9a9d8ab17fbb5c17b1e379101fde31c98c00316e8806d09616f99d58bb3ef4" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "JavadocDeclaration", + "kind": "fail", + "level": "warning", + "message": { + "text": "'@return' tag description is missing", + "markdown": "`@return` tag description is missing" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 74, + "startColumn": 8, + "charOffset": 2629, + "charLength": 7, + "snippet": { + "text": "@return" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 72, + "startColumn": 1, + "charOffset": 2590, + "charLength": 140, + "snippet": { + "text": " * @param b\n * @param c\n * @return\n */\n public static double[][] produceZYZRotationMatrix(double a, double b, double c) {" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "003b623b866a2d28", + "equalIndicator/v1": "4cdb12876c621dafedbb314aa791ec7949c1c24c1ae3b5afecea0988bde1e29b" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "LombokGetterMayBeUsed", + "kind": "fail", + "level": "warning", + "message": { + "text": "Class 'BlockPaletteMenuType' may use Lombok @Getter", + "markdown": "Class 'BlockPaletteMenuType' may use Lombok @Getter" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/modules/miscellaneous/blockpalettegui/BlockPaletteMenuType.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 10, + "startColumn": 13, + "charOffset": 283, + "charLength": 20, + "snippet": { + "text": "BlockPaletteMenuType" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 8, + "startColumn": 1, + "charOffset": 234, + "charLength": 185, + "snippet": { + "text": "import java.util.stream.Collectors;\n\npublic enum BlockPaletteMenuType {\n SLABS(\"Slabs\", \"slabs\", MenuItems::getSlabsArray),\n STAIRS(\"Stairs\", \"stairs\", MenuItems::getStairsArray)," + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "bde8017d9b73d779", + "equalIndicator/v1": "1c089ca27320f124d9d082a313ded485be45bf118a9fe90302754edb3a969123" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "tags": [ + "JAVA" + ] + } + }, + { + "ruleId": "UnnecessarySemicolon", + "kind": "fail", + "level": "warning", + "message": { + "text": "Unnecessary semicolon ';'", + "markdown": "Unnecessary semicolon `;`" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java", + "uriBaseId": "SRCROOT" + }, + "region": { + "startLine": 548, + "startColumn": 22, + "charOffset": 38465, + "charLength": 1, + "snippet": { + "text": ";" + }, + "sourceLanguage": "JAVA" + }, + "contextRegion": { + "startLine": 546, + "startColumn": 1, + "charOffset": 38414, + "charLength": 60, + "snippet": { + "text": "\n public enum LetterType {\n WOODEN, STONE;\n }\n}" + }, + "sourceLanguage": "JAVA" + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "BuildTeamTools.main", + "kind": "module" + } + ] + } + ], + "partialFingerprints": { + "equalIndicator/v2": "699217e66cb73ea3", + "equalIndicator/v1": "471e3065826251b1539d97cba02ee393fc11f0e281c837832a425b32d7f5c83b" + }, + "properties": { + "ideaSeverity": "WARNING", + "qodanaSeverity": "High", + "problemType": "REGULAR", + "hasFixes": true, + "hasCleanup": true, + "tags": [ + "JAVA" + ] + } + } + ], + "qodana.coverage.files.provided": false, + "configProfile": "absent", + "deviceId": "200820300000000-f884-5c6e-a2d2-7bb75b4edb83", + "qodanaNewResultSummary": { + "high": 98, + "total": 98 + } + } + } + ] +} \ No newline at end of file diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index a313a175..65f7a18d 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -15,14 +15,15 @@ jobs: pull-requests: write checks: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit fetch-depth: 0 # a full history is required for pull request analysis - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2025.2 + uses: JetBrains/qodana-action@v2025.3 with: - pr-mode: false + pr-mode: ${{ github.event_name == 'pull_request' }} + args: '--baseline,.github/workflows/qodana.sarif.json' env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_538010437 }} QODANA_ENDPOINT: 'https://qodana.cloud' \ No newline at end of file diff --git a/qodana.yaml b/qodana.yaml index 014cf3ba..a3baf54c 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,10 +1,13 @@ #################################################################################################################### # WARNING: Do not store sensitive information in this file, as its contents will be included in the Qodana report. # #################################################################################################################### - version: "1.0" -linter: jetbrains/qodana-jvm-community:2025.2 profile: - name: qodana.recommended + name: qodana.starter include: - - name: CheckDependencyLicenses \ No newline at end of file + - name: Deprecation + - name: JavadocDeclaration + - name: FieldMayBeFinal + - name: LombokGetterMayBeUsed + - name: UnnecessarySemicolon + - name: FieldCanBeLocal