Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的老板担心我们的 NFS 文件系统不会对 jboss run java 进程对我们正在编写的文件调用 getFD().sync 感到满意。我们注意到,创建文件上的时间戳通常是在日志声称文件完成写入之后的几分钟(有时长达 15 分钟)。我唯一的猜测是 NFS 挂在内存中的文件上,直到感觉像它时才写入它。同步应该可以解决这个问题,对吧?
我还注意到文件上从来没有调用过 close() 。想知道这是否也是原因?
任何想法表示赞赏。
如果您的意思是 Java 代码从不调用close()流,是的,这是一个错误。使用完成后,始终关闭流、输入或输出。好的静态分析工具会警告未能做到这一点的代码。
close()
Actually I want to sort Array List of objects. I am using Comparable interface for this purpose. It is completely working But the problem is that when I am sorting is is giving these two problems.