Author: ebourg Date: Mon Aug 19 12:52:42 2013 New Revision: 1515391 URL: http://svn.apache.org/r1515391 Log: Renamed childs -> children
Modified: commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java Modified: commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java?rev=1515391&r1=1515390&r2=1515391&view=diff ============================================================================== --- commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java (original) +++ commons/proper/jci/trunk/fam/src/main/java/org/apache/commons/jci/monitor/FilesystemAlterationObserverImpl.java Mon Aug 19 12:52:42 2013 @@ -58,11 +58,11 @@ public class FilesystemAlterationObserve } public MonitorFile[] listFiles() { - final File[] childs = file.listFiles(); + final File[] children = file.listFiles(); - final MonitorFile[] providers = new MonitorFile[childs.length]; + final MonitorFile[] providers = new MonitorFile[children.length]; for (int i = 0; i < providers.length; i++) { - providers[i] = new MonitorFileImpl(childs[i]); + providers[i] = new MonitorFileImpl(children[i]); } return providers; } @@ -95,7 +95,7 @@ public class FilesystemAlterationObserve private final MonitorFile file; private long lastModified = -1; private int lastType = TYPE_UNKNOWN; - private Map<String, Entry> childs = new HashMap<String, Entry>(); + private Map<String, Entry> children = new HashMap<String, Entry>(); public Entry(final MonitorFile pFile) { file = pFile; @@ -112,28 +112,28 @@ public class FilesystemAlterationObserve } - private void compareChilds() { + private void compareChildren() { if (!file.isDirectory()) { return; } final MonitorFile[] files = file.listFiles(); - final Set<Entry> deleted = new HashSet<Entry>(childs.values()); + final Set<Entry> deleted = new HashSet<Entry>(children.values()); for (MonitorFile f : files) { final String name = f.getName(); - final Entry entry = childs.get(name); + final Entry entry = children.get(name); if (entry != null) { // already recognized as child deleted.remove(entry); if(entry.needsToBeDeleted()) { // we have to delete this one - childs.remove(name); + children.remove(name); } } else { // a new child final Entry newChild = new Entry(f); - childs.put(name, newChild); + children.put(name, newChild); newChild.needsToBeDeleted(); } } @@ -141,17 +141,17 @@ public class FilesystemAlterationObserve // the ones not found on disk anymore for (Entry entry : deleted) { - entry.deleteChildsAndNotify(); - childs.remove(entry.getName()); + entry.deleteChildrenAndNotify(); + children.remove(entry.getName()); } } - private void deleteChildsAndNotify() { - for (Entry entry : childs.values()) { - entry.deleteChildsAndNotify(); + private void deleteChildrenAndNotify() { + for (Entry entry : children.values()) { + entry.deleteChildrenAndNotify(); } - childs.clear(); + children.clear(); if(lastType == TYPE_DIRECTORY) { notifyOnDirectoryDelete(this); @@ -167,7 +167,7 @@ public class FilesystemAlterationObserve // log.debug(file + " does not exist or has been deleted"); - deleteChildsAndNotify(); + deleteChildrenAndNotify(); // mark to be deleted by parent return true; @@ -189,7 +189,7 @@ public class FilesystemAlterationObserve // log.debug(file + " has a new type"); - deleteChildsAndNotify(); + deleteChildrenAndNotify(); lastType = newType; @@ -197,7 +197,7 @@ public class FilesystemAlterationObserve if (newType == TYPE_DIRECTORY) { notifyOnDirectoryCreate(this); - compareChilds(); + compareChildren(); } else { notifyOnFileCreate(this); } @@ -207,7 +207,7 @@ public class FilesystemAlterationObserve if (newType == TYPE_DIRECTORY) { notifyOnDirectoryChange(this); - compareChilds(); + compareChildren(); } else { notifyOnFileChange(this); } @@ -220,7 +220,7 @@ public class FilesystemAlterationObserve // log.debug(file + " does exist and has not changed"); - compareChilds(); + compareChildren(); return false; }