wala / WALA

T.J. Watson Libraries for Analysis, with frontends for Java, Android, and JavaScript, and may common static program analyses
http://github.com/wala/WALA
Eclipse Public License 2.0
762 stars 223 forks source link

Don't leak local variables between switch branches #1450

Closed liblit closed 1 month ago

liblit commented 1 month ago

Declaring and initializing a local variable in one switch branch, then using that same local variable in a different switch branch, is legal but confusing. Even more so if the first switch branch returns rather than falling through. Let's just not do that.