ConfigParser读取properties
ConfigParser读取properties文件时,properties文件必须有默认的头,例如[default]
,如果没有会报错。
因为ConfigParser默认是读取ini格式文件,ini文件必须有section header。properties虽然也是key=value格式,但是不强制section header。
解决方式是读取内容后手动加上header,然后交给ConfigParser解析。
ConfigParser读取properties文件时,properties文件必须有默认的头,例如[default]
,如果没有会报错。
因为ConfigParser默认是读取ini格式文件,ini文件必须有section header。properties虽然也是key=value格式,但是不强制section header。
解决方式是读取内容后手动加上header,然后交给ConfigParser解析。
final是引用不可变,值还是可以改变的。
1 | public class App { |
known changes - This allows remote repository to accept a safer non-fast-forward push. This can cause the remote repository to lose commits; use it with care. This can prevent from losing unknown changes from other people on the remote. It checks if the server branch points to the same commit as the remote-tracking branch (known changes). If yes, a force push will be performed. Otherwise it will be rejected. Since git does not have remote-tracking tags, tags cannot be overwritten using this option. This passes –force-with-lease option of git push command.
unknown changes - This allows remote repository to accept an unsafe non-fast-forward push. This can cause the remote repository to lose commits; use it with care. This does not check any server commits, so it is possible to lose unknown changes on the remote. Use this option with Include Tags to overwrite tags. This passes the traditional –force option of git push command.
unknown changes 等价于--force
,强行提交时,可能覆盖团队成员在此期间推送的所有更改。
known changes 等价于--force-with-lease
,使用此参数推送,如果远端有其他人推送了新的提交,那么推送将被拒绝。该命令解决的是本地仓库不够新时,依然覆盖了远端新仓库的问题,如果执意想要覆盖远端提交,只需要先 fetch 再push,它也不会拒绝的。