From: Jim Procter Date: Wed, 18 Oct 2017 14:28:30 +0000 (+0100) Subject: JAL-2782 remark about possible exception due to unsafe regex X-Git-Tag: Release_2_10_3b1~105 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a17b025b4563d1832e002632a08d9909837999c8;p=jalview.git JAL-2782 remark about possible exception due to unsafe regex --- diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraResidue.java b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraResidue.java index 0045e97..3abbe75 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraResidue.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraResidue.java @@ -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())