Mercurial > 510Connectbot
diff src/ch/ethz/ssh2/compression/CompressionFactory.java @ 307:071eccdff8ea ganymed
fix java formatting
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 14:16:58 -0700 |
parents | 91a31873c42a |
children | 97da8c5fb40a |
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/compression/CompressionFactory.java Wed Jul 30 12:09:51 2014 -0700 +++ b/src/ch/ethz/ssh2/compression/CompressionFactory.java Wed Jul 30 14:16:58 2014 -0700 @@ -19,7 +19,7 @@ } private static final List<CompressorEntry> compressors - = new ArrayList<CompressorEntry>(); + = new ArrayList<CompressorEntry>(); static { // Higher priority first @@ -28,15 +28,17 @@ public static String[] getDefaultCompressorList() { String list[] = new String[compressors.size()]; - for(int i = 0; i < compressors.size(); i++) { + + for (int i = 0; i < compressors.size(); i++) { CompressorEntry ce = compressors.get(i); list[i] = ce.type; } + return list; } public static void checkCompressorList(String[] list) { - for(final String candidate : list) { + for (final String candidate : list) { getEntry(candidate); } } @@ -44,23 +46,26 @@ public static Compressor createCompressor(String type) { try { CompressorEntry ce = getEntry(type); - if(null == ce.compressorClass) { + + if (null == ce.compressorClass) { return null; } + Class<?> cc = Class.forName(ce.compressorClass); return (Compressor) cc.newInstance(); } - catch(Exception e) { + catch (Exception e) { throw new IllegalArgumentException("Cannot instantiate " + type); } } private static CompressorEntry getEntry(String type) { - for(CompressorEntry ce : compressors) { - if(ce.type.equals(type)) { + for (CompressorEntry ce : compressors) { + if (ce.type.equals(type)) { return ce; } } + throw new IllegalArgumentException("Unknown algorithm " + type); } } \ No newline at end of file