@Test public void testExportPackageHeuristicsForServiceAndAPI() { assertThat(Packages.shouldBeExported("")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.service")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.service.data")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.services")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.services.misc.exception")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.api")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.api.svc")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.apis")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.apis.svc")).isTrue(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.apiculteur.svc")).isFalse(); assertThat(Packages.shouldBeExported("org.apache.felix.ipojo.service4.svc")).isFalse(); }
public static boolean shouldBeExported(String packageName) { boolean service = packageName.endsWith(".service"); service = service || packageName.contains(".service.") || packageName.endsWith(".services") || packageName.contains(".services."); boolean api = packageName.endsWith(".api"); api = api || packageName.contains(".api.") || packageName.endsWith(".apis") || packageName.contains(".apis."); boolean model = packageName.endsWith(".model"); model = model || packageName.contains(".model.") || packageName.endsWith(".models") || packageName.contains(".models."); boolean entity = packageName.endsWith(".entity"); entity = entity || packageName.contains(".entity.") || packageName.endsWith(".entities") || packageName.contains(".entities."); return !packageName.isEmpty() && !packageName.equals(".") && (service || api || model || entity); }
Packages { public static boolean shouldBeExported(String packageName) { boolean service = packageName.endsWith(".service"); service = service || packageName.contains(".service.") || packageName.endsWith(".services") || packageName.contains(".services."); boolean api = packageName.endsWith(".api"); api = api || packageName.contains(".api.") || packageName.endsWith(".apis") || packageName.contains(".apis."); boolean model = packageName.endsWith(".model"); model = model || packageName.contains(".model.") || packageName.endsWith(".models") || packageName.contains(".models."); boolean entity = packageName.endsWith(".entity"); entity = entity || packageName.contains(".entity.") || packageName.endsWith(".entities") || packageName.contains(".entities."); return !packageName.isEmpty() && !packageName.equals(".") && (service || api || model || entity); } }
Packages { public static boolean shouldBeExported(String packageName) { boolean service = packageName.endsWith(".service"); service = service || packageName.contains(".service.") || packageName.endsWith(".services") || packageName.contains(".services."); boolean api = packageName.endsWith(".api"); api = api || packageName.contains(".api.") || packageName.endsWith(".apis") || packageName.contains(".apis."); boolean model = packageName.endsWith(".model"); model = model || packageName.contains(".model.") || packageName.endsWith(".models") || packageName.contains(".models."); boolean entity = packageName.endsWith(".entity"); entity = entity || packageName.contains(".entity.") || packageName.endsWith(".entities") || packageName.contains(".entities."); return !packageName.isEmpty() && !packageName.equals(".") && (service || api || model || entity); } private  Packages(); }
Packages { public static boolean shouldBeExported(String packageName) { boolean service = packageName.endsWith(".service"); service = service || packageName.contains(".service.") || packageName.endsWith(".services") || packageName.contains(".services."); boolean api = packageName.endsWith(".api"); api = api || packageName.contains(".api.") || packageName.endsWith(".apis") || packageName.contains(".apis."); boolean model = packageName.endsWith(".model"); model = model || packageName.contains(".model.") || packageName.endsWith(".models") || packageName.contains(".models."); boolean entity = packageName.endsWith(".entity"); entity = entity || packageName.contains(".entity.") || packageName.endsWith(".entities") || packageName.contains(".entities."); return !packageName.isEmpty() && !packageName.equals(".") && (service || api || model || entity); } private  Packages(); static String toClause(List<String> packages); static String getPackageName(String filePath); static boolean shouldBeExported(String packageName); }
Packages { public static boolean shouldBeExported(String packageName) { boolean service = packageName.endsWith(".service"); service = service || packageName.contains(".service.") || packageName.endsWith(".services") || packageName.contains(".services."); boolean api = packageName.endsWith(".api"); api = api || packageName.contains(".api.") || packageName.endsWith(".apis") || packageName.contains(".apis."); boolean model = packageName.endsWith(".model"); model = model || packageName.contains(".model.") || packageName.endsWith(".models") || packageName.contains(".models."); boolean entity = packageName.endsWith(".entity"); entity = entity || packageName.contains(".entity.") || packageName.endsWith(".entities") || packageName.contains(".entities."); return !packageName.isEmpty() && !packageName.equals(".") && (service || api || model || entity); } private  Packages(); static String toClause(List<String> packages); static String getPackageName(String filePath); static boolean shouldBeExported(String packageName);  }