Author: dgolovin
Date: 2011-08-03 20:52:19 -0400 (Wed, 03 Aug 2011)
New Revision: 33573
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemPeer.java
Log:
changed(File) method uses file directly without wrapping it with Info object first. For
cdi ui tests it is called about 500000 times and it is one of 4 methods with top execution
time
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemPeer.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemPeer.java 2011-08-04
00:20:33 UTC (rev 33572)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemPeer.java 2011-08-04
00:52:19 UTC (rev 33573)
@@ -64,16 +64,20 @@
long lastModified;
long length;
Info(File f) {
- lastModified = !f.exists() ? 0 : f.lastModified();
- length = f.isFile() && f.exists() ? f.length() : 0;
+ lastModified = f.lastModified();
+ length = f.length();
}
public boolean equals(Info other) {
return lastModified != other.lastModified || length != other.length;
}
-
+
+ public boolean equals(File other) {
+ return lastModified != other.lastModified() || length != other.length();
+ }
+
public boolean changed(File f) {
- return equals(new Info(f));
+ return equals(f);
}
}
Show replies by date