JAL-3454 tidy comments
[jalview.git] / src / mc_view / PDBfile.java
index 0435def..d3e14c7 100755 (executable)
@@ -36,7 +36,7 @@ import java.util.Vector;
 
 public class PDBfile extends StructureFile
 {
-  private static String CALC_ID_PREFIX = "JalviewPDB";
+  private final static String CALC_ID_PREFIX = "JalviewPDB";
 
   public PDBfile(boolean addAlignmentAnnotations,
           boolean predictSecondaryStructure, boolean externalSecStr)
@@ -77,15 +77,15 @@ public class PDBfile extends StructureFile
     setId(safeName(getDataName()));
 
     setChains(new Vector<PDBChain>());
-    List<SequenceI> rna = new ArrayList<SequenceI>();
-    List<SequenceI> prot = new ArrayList<SequenceI>();
+    List<SequenceI> rna = new ArrayList<>();
+    List<SequenceI> prot = new ArrayList<>();
     PDBChain tmpchain;
     String line = null;
     boolean modelFlag = false;
     boolean terFlag = false;
     String lastID = "";
 
-    int indexx = 0;
+    // int indexx = 0;
     String atomnam = null;
     try
     {
@@ -143,16 +143,16 @@ public class PDBfile extends StructureFile
           }
 
           Atom tmpatom = new Atom(line);
-          try
+          if (tmpatom.resNumIns.trim().equals(lastID))
+          {
+            // phosphorylated protein - seen both CA and P..
+            continue;
+          }
+          tmpchain = findChain(tmpatom.chain);
+          if (tmpchain != null)
           {
-            tmpchain = findChain(tmpatom.chain);
-            if (tmpatom.resNumIns.trim().equals(lastID))
-            {
-              // phosphorylated protein - seen both CA and P..
-              continue;
-            }
             tmpchain.atoms.addElement(tmpatom);
-          } catch (Exception e)
+          } else
           {
             tmpchain = new PDBChain(getId(), tmpatom.chain);
             getChains().add(tmpchain);