44import java .util .ArrayList ;
55import java .util .Arrays ;
66import java .util .Collection ;
7+ import java .util .Enumeration ;
78import java .util .List ;
89import java .util .ResourceBundle ;
910
@@ -12,7 +13,16 @@ public class CompilerConfig {
1213 private static final ResourceBundle commandBySuffixRB = ResourceBundle .getBundle ("com.sandwich.util.io.filecompiler.compilationcommands" );
1314
1415 public static boolean isSourceFile (String fileName ) {
15- return commandBySuffixRB .containsKey (getSuffix (fileName ));
16+ // TODO when supporting java > 5, change to return resourcebundle.containsKey(...
17+ Enumeration <String > keys = commandBySuffixRB .getKeys ();
18+ String suffix = getSuffix (fileName ).toLowerCase ();
19+ while (keys .hasMoreElements ()){
20+ String key = keys .nextElement ();
21+ if (key .equals (suffix )){
22+ return true ;
23+ }
24+ }
25+ return false ;
1626 }
1727
1828 public static String [] getCompilationCommand (File src , String destinationPath , String classPath ) {
@@ -39,7 +49,12 @@ public static String[] getCompilationCommand(File src, String destinationPath, S
3949 }
4050
4151 public static Collection <String > getSupportedFileSuffixes () {
42- return commandBySuffixRB .keySet ();
52+ Enumeration <String > keysEnumeration = commandBySuffixRB .getKeys ();
53+ Collection <String > keys = new ArrayList <String >();
54+ while (keysEnumeration .hasMoreElements ()){
55+ keys .add (keysEnumeration .nextElement ());
56+ }
57+ return keys ;
4358 }
4459
4560 public static String getSuffix (String fileName ) {
0 commit comments