JAL-2782 remark about possible exception due to unsafe regex
authorJim Procter <jprocter@issues.jalview.org>
Wed, 18 Oct 2017 14:28:30 +0000 (15:28 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 18 Oct 2017 14:28:30 +0000 (15:28 +0100)
src/ext/edu/ucsf/rbvi/strucviz2/ChimeraResidue.java

index 0045e97..3abbe75 100644 (file)
@@ -383,6 +383,8 @@ public class ChimeraResidue implements ChimeraStructuralObject,
   public void splitInsertionCode(String residue)
   {
     // OK, split the index into number and insertion code
+    // JBPNote - m.matches() can be true even if there is no resnum - this can
+    // cause NumberFormatExceptions below
     Pattern p = Pattern.compile("(\\d*)([A-Z]?)");
     Matcher m = p.matcher(residue);
     if (m.matches())