Reports local variable of wrapper type though all usages allowed to be primitive and count of unnece

Posted pz_ww

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Reports local variable of wrapper type though all usages allowed to be primitive and count of unnece相关的知识,希望对你有一定的参考价值。

Reports local variable of wrapper type though all usages allowed to be primitive and count of unnecessary boxing/unboxing operations reduces

报告包装器类型的局部变量,尽管所有使用情况都允许是原始用法,并且不必要的装箱/拆箱操作的次数减少了

 

这个警告是说,尽量使用基本数据类型,这样就能减少装箱/拆箱操作了。

类似的例子:

......

Boolean hs=false;
for(var it:collect){
    if(it.getYear==2020){
       hs=true;
       .....
    }   
}
if(!hs){
......
}
.......

改成基本数据类型就行了,比如int

......

int hs=0;
for(var it:collect){
    if(it.getYear==2020){
       hs=1;
       .....
    }   
}
if(hs==0){
......
}
.......

 

 

以上是关于Reports local variable of wrapper type though all usages allowed to be primitive and count of unnece的主要内容,如果未能解决你的问题,请参考以下文章

Local declaration of 'XXX' hides instance variable

Examples of MIB Variables - SNMP Tutorial

报错:Duplicate local variable

[Daily Coding Problem] Find the total number of solutions of a linear equation of n variables

Crystal Reports 8.5网络文件保存

MySQL: Set user variable from result of query