JAL-3438 spotless for 2.11.2.0
[jalview.git] / src / jalview / io / JSONFile.java
index 022148a..2ee305f 100644 (file)
@@ -218,7 +218,7 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
           jsonAlignmentPojo.getSeqGroups().add(seqGrpPojo);
         }
       }
-      
+
       jsonOutput = JSONUtils.stringify(jsonAlignmentPojo);
       return jsonOutput.replaceAll("xstart", "xStart").replaceAll("xend",
               "xEnd");
@@ -291,16 +291,16 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
       /*
        * get all features currently visible (and any non-positional features)
        */
-      List<SequenceFeature> seqFeatures = seq.getFeatures().getAllFeatures(
-              visibleFeatureTypes);
+      List<SequenceFeature> seqFeatures = seq.getFeatures()
+              .getAllFeatures(visibleFeatureTypes);
       for (SequenceFeature sf : seqFeatures)
       {
         SequenceFeaturesPojo jsonFeature = new SequenceFeaturesPojo(
                 String.valueOf(seq.hashCode()));
 
-        String featureColour = (fr == null) ? null : Format
-                .getHexString(finder.findFeatureColour(Color.white, seq,
-                        seq.findIndex(sf.getBegin())));
+        String featureColour = (fr == null) ? null
+                : Format.getHexString(finder.findFeatureColour(Color.white,
+                        seq, seq.findIndex(sf.getBegin())));
         int xStart = sf.getBegin() == 0 ? 0
                 : seq.findIndex(sf.getBegin()) - 1;
         int xEnd = sf.getEnd() == 0 ? 0 : seq.findIndex(sf.getEnd());
@@ -395,8 +395,10 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
   {
     try
     {
-      Map<String, Object> alignmentJsonObj = (Map<String, Object>) JSONUtils.parse(jsonAlignmentString);
-      List<Object> seqJsonArray = (List<Object>) alignmentJsonObj.get("seqs");
+      Map<String, Object> alignmentJsonObj = (Map<String, Object>) JSONUtils
+              .parse(jsonAlignmentString);
+      List<Object> seqJsonArray = (List<Object>) alignmentJsonObj
+              .get("seqs");
       List<Object> alAnnotJsonArray = (List<Object>) alignmentJsonObj
               .get("alignAnnotation");
       List<Object> jsonSeqArray = (List<Object>) alignmentJsonObj
@@ -419,9 +421,11 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
 
       hiddenSequences = new ArrayList<>();
       seqMap = new Hashtable<>();
-      for (Iterator<Object> sequenceIter = seqJsonArray.iterator(); sequenceIter.hasNext();)
+      for (Iterator<Object> sequenceIter = seqJsonArray
+              .iterator(); sequenceIter.hasNext();)
       {
-        Map<String, Object> sequence = (Map<String, Object>) sequenceIter.next();
+        Map<String, Object> sequence = (Map<String, Object>) sequenceIter
+                .next();
         String sequcenceString = sequence.get("seq").toString();
         String sequenceName = sequence.get("name").toString();
         String seqUniqueId = sequence.get("id").toString();
@@ -439,9 +443,11 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
 
       parseFeatures(jsonSeqArray);
 
-      for (Iterator<Object> seqGrpIter = seqGrpJsonArray.iterator(); seqGrpIter.hasNext();)
+      for (Iterator<Object> seqGrpIter = seqGrpJsonArray
+              .iterator(); seqGrpIter.hasNext();)
       {
-        Map<String, Object> seqGrpObj = (Map<String, Object>)seqGrpIter.next();
+        Map<String, Object> seqGrpObj = (Map<String, Object>) seqGrpIter
+                .next();
         String grpName = seqGrpObj.get("groupName").toString();
         String colourScheme = seqGrpObj.get("colourScheme").toString();
         String description = (seqGrpObj.get("description") == null) ? null
@@ -457,7 +463,8 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
         int startRes = Integer
                 .valueOf(seqGrpObj.get("startRes").toString());
         int endRes = Integer.valueOf(seqGrpObj.get("endRes").toString());
-        List<Object> sequenceRefs = (List<Object>) seqGrpObj.get("sequenceRefs");
+        List<Object> sequenceRefs = (List<Object>) seqGrpObj
+                .get("sequenceRefs");
 
         ArrayList<SequenceI> grpSeqs = new ArrayList<>();
         if (sequenceRefs.size() > 0)
@@ -482,15 +489,20 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
 
       }
 
-      for (Iterator<Object> alAnnotIter = alAnnotJsonArray.iterator(); alAnnotIter.hasNext();)
+      for (Iterator<Object> alAnnotIter = alAnnotJsonArray
+              .iterator(); alAnnotIter.hasNext();)
       {
-        Map<String, Object> alAnnot = (Map<String, Object>) alAnnotIter.next();
-        List<Object> annotJsonArray = (List<Object>) alAnnot.get("annotations");
+        Map<String, Object> alAnnot = (Map<String, Object>) alAnnotIter
+                .next();
+        List<Object> annotJsonArray = (List<Object>) alAnnot
+                .get("annotations");
         Annotation[] annotations = new Annotation[annotJsonArray.size()];
         int count = 0;
-        for (Iterator<Object> annotIter = annotJsonArray.iterator(); annotIter.hasNext();)
+        for (Iterator<Object> annotIter = annotJsonArray
+                .iterator(); annotIter.hasNext();)
         {
-          Map<String, Object> annot = (Map<String, Object>) annotIter.next();
+          Map<String, Object> annot = (Map<String, Object>) annotIter
+                  .next();
           if (annot == null)
           {
             annotations[count] = null;
@@ -632,7 +644,7 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
       displayedFeatures = new FeaturesDisplayed();
       for (Object o : jsonSeqFeatures)
       {
-       Map<String, Object> jsonFeature = (Map<String, Object>) o;
+        Map<String, Object> jsonFeature = (Map<String, Object>) o;
         Long begin = (Long) jsonFeature.get("xStart");
         Long end = (Long) jsonFeature.get("xEnd");
         String type = (String) jsonFeature.get("type");
@@ -646,15 +658,16 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
         /*
          * begin/end of 0 is for a non-positional feature
          */
-        int featureBegin = begin.intValue() == 0 ? 0 : seq
-                .findPosition(begin.intValue());
-        int featureEnd = end.intValue() == 0 ? 0 : seq.findPosition(end
-                .intValue()) - 1;
+        int featureBegin = begin.intValue() == 0 ? 0
+                : seq.findPosition(begin.intValue());
+        int featureEnd = end.intValue() == 0 ? 0
+                : seq.findPosition(end.intValue()) - 1;
 
         SequenceFeature sequenceFeature = new SequenceFeature(type,
                 description, featureBegin, featureEnd, score, featureGrp);
 
-        List<Object> linksJsonArray = (List<Object>) jsonFeature.get("links");
+        List<Object> linksJsonArray = (List<Object>) jsonFeature
+                .get("links");
         if (linksJsonArray != null && linksJsonArray.size() > 0)
         {
           Iterator<Object> linkList = linksJsonArray.iterator();