Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private List<Class<?>> findImplementationsOf(Class<?> implementationTemplate, UR
List<Class<?>> implementations = Lists.newArrayList();
List<String> classes = FileUtils.getFileNames(classesDirectory, "**/*.class", null, false);
for (String classPath : classes) {
String className = classPath.substring(0, classPath.length() - 6).replace('/', '.');
String className = classPath.substring(0, classPath.length() - 6).replace(File.separatorChar, '.');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaceAll?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wanglinsong No, replace should be used, because it replaces all occurrences:

public String replace(char oldChar, char newChar)
Returns a string resulting from replacing all occurrences of oldChar in this string with newChar.

while replaceAll works with regular expressions.

But I agree that it's confusing naming.

try {
Class<?> implementation = searchRealm.loadClass(implementationTemplate.getName());
Class<?> clazz = searchRealm.loadClass(className);
Expand Down