System.getProperty(str)
的用法,并在以下 2 种情况下提出修正建议:
System.getProperty("path.separator")
-> File.pathSeparator
System.getProperty("line.separator")
-> System.lineSeparator()
System.lineSeparator()
返回缓存值,而 System.getProperty("line.separator")
每次都调用属性(Hashtable 或 CHM,具体取决于实现)。