zoukankan      html  css  js  c++  java
  • IDEA代码里的黄色提示

    #cec726

    提示:String concatenation as argument to 'StringBuilder.append()' 

    详细提示

    String concatenation as argument to 'StringBuilder.append()' call less... (Ctrl+F1)
    Inspection info: 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, which when converted to chained append calls would only worsen performance.

    解释

    append方法就是为了解决String += String的效率问题的,而上面代码在append方法里使用了字符串连接,可能降低性能。解决提示:不要在append方法里写字符串连接代码。

    C-style array declaration of local variable 'arr' less... 

    详细提示

    C-style array declaration of local variable 'arr' less... (Ctrl+F1)
    Inspection info: Reports array declarations made using C-style syntax, with the array indicator brackets positioned after the variable name or after the method parameter list. For example:
    public String process(String value[])[] {
    return value;
    }
    Most code styles prefer Java-style array declarations, with the array indicator brackets attached to the type name.

    解释

    数组对象,把中括号放在变量后面是C语言的风格,而Java习惯放在变量类型后面

    'for' loop replaceable with 'foreach' less... 

    详细提示

    'for' loop replaceable with 'foreach' less... (Ctrl+F1)
    Inspection info: Reports for loops which iterate over collections or arrays, and can be replaced with the foreach iteration syntax, available in Java 5 and newer.

    解释

    循环遍历集合或数组,可以替换为foreach迭代语法

    Local variable 's' is redundant less...

    详细提示

    Local variable 's' is redundant less... (Ctrl+F1)
    Inspection info: Reports unnecessary local variables, which add nothing to the comprehensibility of a method. Variables caught include local variables which are immediately returned, local variables that are immediately assigned to another variable and then not used, and local variables which always have the same value as another local variable or parameter.

    解释

    定义的变量名称是冗余的

    Field injection is not recommended less...

    详细提示

    Field injection is not recommended less... (Ctrl+F1)
    Inspection info: Spring Team recommends: "Always use constructor based dependency injection in your beans. Always use assertions for mandatory dependencies".

    解释

    Spring团队建议:“始终在bean中使用基于构造函数的依赖注入

    Found duplicate code

    鼠标放在重复代码块,Alt+Enter

    查看其它重复代码,可以做比较

  • 相关阅读:
    Kinect关于PlayerIndex和SkeletonId之间的关系。
    记一次“应用程序之间的通信”过程(1/2)
    C# p-Inovke C++动态链接库
    我写了本破书-swift语言实战晋级
    swift语言实战晋级-第9章 游戏实战-跑酷熊猫-9-10 移除平台与视差滚动
    swift语言实战晋级-第9章 游戏实战-跑酷熊猫-7-8 移动平台的算法
    Swift语言实战晋级-第9章 游戏实战-跑酷熊猫-5-6 踩踏平台是怎么炼成的
    Swift语言实战晋级-第9章 游戏实战-跑酷熊猫-4 熊猫的跳和打滚
    Swift语言实战晋级-第9章 游戏实战-跑酷熊猫-3 显示一个动态的熊猫
    Swift语言实战晋级-第9章 游戏实战-跑酷熊猫-2 创建熊猫类
  • 原文地址:https://www.cnblogs.com/LUA123/p/13267466.html
Copyright © 2011-2022 走看看