The Oracle documentation says that "For example, when a file in a watched directory is modified then it may result in a single ENTRY_MODIFY event in some implementations but several events in other implementations" source: https://docs.oracle.com/javase/7/docs/api/java/nio/file/WatchService.html
In my case WatchService reported correctly one ENTRY_MODIFY per one file modification in different implementations (for example in standalone java programs and in a web application project in Eclipse ) and different environments (laptop vs server) but when I deployed my web application on a Tomcat server always two ENTRY_MODIFY events per one file modification occurred. The reason for this difference was that I had multiple Main classes in my Maven web application which all were started when the web application was deployed on my tomcat server, despite I defined start.class in the pom.xml file:
<start-class>com. ... .Application</start-class>
In Eclipse only the start-class started.
It seems that different file structure in the WAR file compared to the Eclipse Maven project structure causes this difference. My solution was to delete redundant main classes and files and then there was only one ENTRY_MODIFY per one file modification.