// ĠCopyright Ġ 2 0 0 0 - 2 0 1 9 ĠJetBrains Ġs . r . o . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġorg . jetbrains . plugins . groovy . code Inspection . type . highlight ing Ċ Ċ import Ġcom . intellij . code Inspection . Int ention Wrapper . wrap To Quick Fixes Ċ import Ġcom . intellij . code Inspection . Local Quick Fix Ċ import Ġcom . intellij . lang . jvm . actions . create Constructor Actions Ċ import Ġcom . intellij . psi . Psi Class Ċ import Ġcom . intellij . psi . Psi Element Ċ import Ġcom . intellij . psi . util . Psi Tree Util Ċ import Ġorg . jetbrains . plugins . groovy . code Inspection . unt yped Un resolved Access . requests . Create Constructor From Gro ovy Usage Request Ċ import Ġorg . jetbrains . plugins . groovy . highlight ing . Highlight Sink Ċ import Ġorg . jetbrains . plugins . groovy . lang . psi . api . statements . expressions . Gr New Expression Ċ import Ġorg . jetbrains . plugins . groovy . lang . resolve . api . Gro ovy Call Reference Ċ Ċ class ĠGr New Expression Highlight er ( ĊĠ Ġprivate Ġval Ġnew Expression : ĠGr New Expression , ĊĠ Ġreference : ĠGro ovy Call Reference , ĊĠ Ġsink : ĠHighlight Sink Ċ ) Ġ: ĠConstructor Call Highlight er ( reference , Ġsink ) Ġ{ ĊĊĠ Ġoverride Ġval Ġhighlight Element : ĠPsi Element ĊĠĠĠ Ġget () Ġ= Ġrequire NotNull ( new Expression . argument List Ġ?: Ġnew Expression . reference Element ) Ġ{ ĊĠĠĠĠĠ Ġ" reference Ġof Ġnew Ġexpression Ġshould Ġexist Ġif Ġit Ġis Ġa Ġconstructor Ġcall " ĊĠĠĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġbuild Fixes (): ĠList < Local Quick Fix > Ġ{ ĊĠĠĠ Ġval Ġconstructor Ġ= Ġreference . advanced Resolve (). element ĊĠĠĠ Ġval Ġtarget Class Ġ= ĠPsi Tree Util . getParent OfType ( constructor , ĠPsi Class :: class . java ) Ġ?: Ġreturn Ġempty List () ĊĠĠĠ Ġif Ġ(! target Class . manager . isIn Project ( target Class )) Ġreturn Ġempty List () ĊĠĠĠ Ġval Ġrequest Ġ= ĠCreate Constructor From Gro ovy Usage Request ( new Expression , Ġempty List ()) ĊĊĠĠĠ Ġval Ġcreate Constructor Actions Ġ= Ġcreate Constructor Actions ( target Class , Ġrequest ) ĊĠĠĠ Ġreturn Ġwrap To Quick Fixes ( create Constructor Actions , Ġnew Expression . containing File ) ĊĠ Ġ} Ċ } Ċ