&& file.getName().toLowerCase().endsWith(".class"))));
}
};
+ private static final boolean PERMIT_CVS;
+ static {
+ String name = FileUtil.class.getName() + ".PERMIT_CVS";
+ PERMIT_CVS = LangUtil.getBoolean(name, false);
+ }
/** @return true if file path has a zip/jar suffix */
public static boolean hasZipSuffix(File file) {
return LangUtil.sleepUntil(++delayUntil);
}
-// /** map name to result, removing any fromSuffix and adding any toSuffix */
-// private static String map(String name, String fromSuffix, String toSuffix) {
-// if (null != name) {
-// if (null != fromSuffix) {
-// name = name.substring(0, name.length()-fromSuffix.length());
-// }
-// if (null != toSuffix) {
-// name = name + toSuffix;
-// }
-// }
-// return name;
-// }
-
private static void listFiles(final File baseDir, ArrayList result, FileFilter filter) {
File[] files = baseDir.listFiles();
+ // hack https://bugs.eclipse.org/bugs/show_bug.cgi?id=48650
+ final boolean skipCVS = (! PERMIT_CVS && (filter == aspectjSourceFileFilter));
for (int i = 0; i < files.length; i++) {
File f = files[i];
if (f.isDirectory()) {
+ if (skipCVS) {
+ String name = f.getName().toLowerCase();
+ if ("cvs".equals(name) || "sccs".equals(name)) {
+ continue;
+ }
+ }
listFiles(f, result, filter);
} else {
if (filter.accept(f)) result.add(f);
map.put("1.2", "java.lang.ref.Reference");
map.put("1.3", "java.lang.reflect.Proxy");
map.put("1.4", "java.nio.Buffer");
+ map.put("1.5", "java.lang.annotation.Annotation");
VM_CLASSES = Collections.unmodifiableMap(map);
}
}
return (String[]) result.toArray(new String[0]);
}
-
+
+ /**
+ * Get System property as boolean,
+ * but use default value where the system property is not set.
+ * @return true if value is set to true, false otherwise
+ */
+ public static boolean getBoolean(String propertyName, boolean defaultValue) {
+ if (null != propertyName) {
+ try {
+ String value = System.getProperty(propertyName);
+ if (null != value) {
+ return Boolean.valueOf(value).booleanValue();
+ }
+ } catch (Throwable t) {
+ // default below
+ }
+ }
+ return defaultValue;
+ }
+
/**
* Splits <code>input</code>, removing delimiter and
* trimming any white space.