@Test public void testEmptyFilter() { assertTrue(new PackageFilter(null).isAllowedPackage("org.ocpsoft")); assertTrue(new PackageFilter("").isAllowedPackage("org.ocpsoft")); assertTrue(new PackageFilter(" ").isAllowedPackage("org.ocpsoft")); assertTrue(new PackageFilter(" ,, ").isAllowedPackage("org.ocpsoft")); }
public boolean isAllowedPackage(String packageName) { if (packageSet.isEmpty()) { return true; } for (String validPackage : packageSet) { if (packageName.startsWith(validPackage)) { return true; } } return false; }
PackageFilter { public boolean isAllowedPackage(String packageName) { if (packageSet.isEmpty()) { return true; } for (String validPackage : packageSet) { if (packageName.startsWith(validPackage)) { return true; } } return false; } }
PackageFilter { public boolean isAllowedPackage(String packageName) { if (packageSet.isEmpty()) { return true; } for (String validPackage : packageSet) { if (packageName.startsWith(validPackage)) { return true; } } return false; } PackageFilter(String config); }
PackageFilter { public boolean isAllowedPackage(String packageName) { if (packageSet.isEmpty()) { return true; } for (String validPackage : packageSet) { if (packageName.startsWith(validPackage)) { return true; } } return false; } PackageFilter(String config); boolean isAllowedPackage(String packageName); int getNumberOfBasePackages(); @Override String toString(); }
PackageFilter { public boolean isAllowedPackage(String packageName) { if (packageSet.isEmpty()) { return true; } for (String validPackage : packageSet) { if (packageName.startsWith(validPackage)) { return true; } } return false; } PackageFilter(String config); boolean isAllowedPackage(String packageName); int getNumberOfBasePackages(); @Override String toString();  }