langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Util.java
changeset 34991 ff8be37d1164
parent 31751 ec251536a004
child 35356 e919fd8db52c
equal deleted inserted replaced
34918:80f67512daa1 34991:ff8be37d1164
   228 
   228 
   229     public static <I, T> Map<I, T> indexBy(Collection<? extends T> c,
   229     public static <I, T> Map<I, T> indexBy(Collection<? extends T> c,
   230                                            Function<? super T, ? extends I> indexFunction) {
   230                                            Function<? super T, ? extends I> indexFunction) {
   231         return c.stream().collect(Collectors.<T, I, T>toMap(indexFunction, o -> o));
   231         return c.stream().collect(Collectors.<T, I, T>toMap(indexFunction, o -> o));
   232     }
   232     }
       
   233 
       
   234     public static String fileSuffix(Path file) {
       
   235         String fileNameStr = file.getFileName().toString();
       
   236         int dotIndex = fileNameStr.indexOf('.');
       
   237         return dotIndex == -1 ? "" : fileNameStr.substring(dotIndex);
       
   238     }
   233 }
   239 }