X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2Fpacked%2FParsePackedSet.java;h=3ce774e820ae1d5b7ca354a31d8de0f1b194756d;hb=b72ed01b68a8572022f912687db5be60b53c15cf;hp=138fef717606bb6e7af189c2390a9f5457212daf;hpb=4a5137b64f7ec23db2a09290bfcd392984a52150;p=jalview.git diff --git a/src/jalview/io/packed/ParsePackedSet.java b/src/jalview/io/packed/ParsePackedSet.java index 138fef7..3ce774e 100644 --- a/src/jalview/io/packed/ParsePackedSet.java +++ b/src/jalview/io/packed/ParsePackedSet.java @@ -20,6 +20,8 @@ */ package jalview.io.packed; +import java.util.Locale; + import jalview.api.FeatureColourI; import jalview.datamodel.AlignmentI; import jalview.io.AppletFormatAdapter; @@ -52,7 +54,7 @@ public class ParsePackedSet public Object[] getAlignment(JalviewDataset context, Iterable files) throws Exception { - List rslt = new ArrayList(); + List rslt = new ArrayList<>(); if (context == null) { context = new JalviewDataset(); @@ -151,13 +153,14 @@ public class ParsePackedSet // if not, create one. if (context.featureColours == null) { - context.featureColours = new HashMap(); + context.featureColours = new HashMap<>(); } try { jalview.io.FeaturesFile ff = new jalview.io.FeaturesFile(src); context.updateSetModified(ff.parse(context.getLastAlignment(), - context.featureColours, false, context.relaxedIdMatching)); + context.featureColours, false, + context.relaxedIdMatching)); } catch (Exception e) { errmsg = ("Failed to parse the Features file associated with the alignment."); @@ -222,18 +225,19 @@ public class ParsePackedSet * would be created. * * @param args + * @j2sIgnore */ public static void main(String args[]) { // make data providers from the set of keys/files int i = 0; - List dp = new ArrayList(); + List dp = new ArrayList<>(); while ((i + 1) < args.length) { String type = args[i++]; final String file = args[i++]; - final JvDataType jtype = DataProvider.JvDataType.valueOf(type - .toUpperCase()); + final JvDataType jtype = DataProvider.JvDataType + .valueOf(type.toUpperCase(Locale.ROOT)); if (jtype != null) { final FileParse fp; @@ -242,7 +246,7 @@ public class ParsePackedSet fp = new FileParse(file, AppletFormatAdapter.checkProtocol(file)); } catch (Exception e) { - System.err.println("Couldn't handle datasource of type " + jtype + jalview.bin.Console.errPrintln("Couldn't handle datasource of type " + jtype + " using URI " + file); e.printStackTrace(); return; @@ -251,8 +255,8 @@ public class ParsePackedSet } else { - System.out.println("Couldn't parse source type token '" - + type.toUpperCase() + "'"); + jalview.bin.Console.outPrintln("Couldn't parse source type token '" + + type.toUpperCase(Locale.ROOT) + "'"); } } if (i < args.length) @@ -265,17 +269,17 @@ public class ParsePackedSet System.out.print("\n"); } - System.out.println("Now trying to parse set:"); + jalview.bin.Console.outPrintln("Now trying to parse set:"); JalviewDataset context; Object[] newdm; ParsePackedSet pps; try { - newdm = (pps = new ParsePackedSet()).getAlignment( - context = new JalviewDataset(), dp); + newdm = (pps = new ParsePackedSet()) + .getAlignment(context = new JalviewDataset(), dp); } catch (Exception e) { - System.out.println("Test failed for these arguments.\n"); + jalview.bin.Console.outPrintln("Test failed for these arguments.\n"); e.printStackTrace(System.out); return; } @@ -283,7 +287,7 @@ public class ParsePackedSet { for (Object o : newdm) { - System.out.println("Will need to create an " + o.getClass()); + jalview.bin.Console.outPrintln("Will need to create an " + o.getClass()); } // now test uniquify/deuniquify stuff @@ -296,8 +300,8 @@ public class ParsePackedSet { if (context.getLastAlignmentSet().isModified()) { - System.err - .println("Initial alignment set was modified and any associated views should be updated."); + jalview.bin.Console.errPrintln( + "Initial alignment set was modified and any associated views should be updated."); } } }