File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/ch/usi/si/seart/treesitter Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 55import lombok .Generated ;
66import lombok .Getter ;
77import lombok .experimental .FieldDefaults ;
8+ import org .apache .commons .io .FilenameUtils ;
89import org .jetbrains .annotations .NotNull ;
910import org .jetbrains .annotations .TestOnly ;
1011
@@ -459,8 +460,8 @@ public static void validate(@NotNull Language language) {
459460 "Path argument must not be a directory!"
460461 );
461462 String name = path .getFileName ().toString ();
462- int i = name . lastIndexOf ( '.' );
463- return Optional .ofNullable ( i > 0 ? name . substring ( i + 1 ) : null )
463+ String extension = FilenameUtils . getExtension ( name );
464+ return Optional .of ( extension )
464465 .map (EXTENSION_LOOKUP ::get )
465466 .orElseGet (Collections ::emptyList );
466467 }
You can’t perform that action at this time.
0 commit comments