summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
1b93154)
private static Path replaceExtension(Path p, String newExtension) {
String newName = p.getFileName().toString();
private static Path replaceExtension(Path p, String newExtension) {
String newName = p.getFileName().toString();
- if (newName.contains("."))
- newName = newName.split("\\.")[0];
+ int lastDot = newName.lastIndexOf('.');
+ if (lastDot > -1)
+ newName = newName.substring(0, lastDot);
return p.resolveSibling(newName + newExtension);
}
return p.resolveSibling(newName + newExtension);
}