Skip to content

Commit

Permalink
Minor improvements of the utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmihajlovski committed Oct 30, 2015
1 parent 20bac57 commit e157bb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -278,7 +278,7 @@ private static void scanFile(Collection<Class<?>> classes, Pattern regex, Predic
}

private static String pkgToPath(String pkg) {
return pkg.replace('.', File.separatorChar);
return pkg != null ? pkg.replace('.', File.separatorChar) : null;
}

private static Enumeration<URL> resources(String name) {
Expand All @@ -290,7 +290,7 @@ private static Enumeration<URL> resources(String name) {
}
}

private static List<Class<?>> getClassesFromJAR(String jarName, List<Class<?>> classes, String pkg, Pattern regex,
public static List<Class<?>> getClassesFromJAR(String jarName, List<Class<?>> classes, String pkg, Pattern regex,
Predicate<Class<?>> filter, Class<? extends Annotation> annotated, ClassLoader classLoader) {

ZipInputStream zip = null;
Expand Down
8 changes: 4 additions & 4 deletions rapidoid-u/src/main/java/org/rapidoid/util/U.java
Expand Up @@ -173,15 +173,15 @@ public static String replace(String s, String regex, Mapper<String[], String> re

while (matcher.find()) {
int len = matcher.groupCount() + 1;
String[] gr = new String[len];
String[] groups = new String[len];

for (int i = 0; i < gr.length; i++) {
gr[i] = matcher.group(i);
for (int i = 0; i < groups.length; i++) {
groups[i] = matcher.group(i);
}

Object value;
try {
value = replacer.map(gr);
value = replacer.map(groups);
} catch (Exception e) {
throw rte(e);
}
Expand Down

0 comments on commit e157bb6

Please sign in to comment.