Structural Defects and Relation with Optoelectronic Properties in Highly Mg-Doped GaN