git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3446 separated out potential exceptions for simplified key mask operation
[jalview.git]
/
src
/
jalview
/
io
/
ModellerDescription.java
diff --git
a/src/jalview/io/ModellerDescription.java
b/src/jalview/io/ModellerDescription.java
index
7e05b15
..
48a6903
100755
(executable)
--- a/
src/jalview/io/ModellerDescription.java
+++ b/
src/jalview/io/ModellerDescription.java
@@
-22,9
+22,12
@@
package jalview.io;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
+import jalview.util.Platform;
import java.util.List;
import java.util.List;
+import com.stevesoft.pat.Regex;
+
public class ModellerDescription
{
/**
public class ModellerDescription
{
/**
@@
-88,17
+91,25
@@
public class ModellerDescription
resCode(int v)
{
resCode(int v)
{
- val = new Integer(v);
+ val = Integer.valueOf(v);
field = val.toString();
}
};
field = val.toString();
}
};
+ private static Regex VALIDATION_REGEX;
+
+ private static Regex getRegex()
+ {
+ return (VALIDATION_REGEX == null
+ ? VALIDATION_REGEX = Platform
+ .newRegex("\\s*((([-0-9]+).?)|FIRST|LAST|@)", null)
+ : VALIDATION_REGEX);
+ }
+
private resCode validResidueCode(String field)
{
Integer val = null;
private resCode validResidueCode(String field)
{
Integer val = null;
- com.stevesoft.pat.Regex r = new com.stevesoft.pat.Regex(
- "\\s*((([-0-9]+).?)|FIRST|LAST|@)");
-
+ Regex r = getRegex();
if (!r.search(field))
{
return null; // invalid
if (!r.search(field))
{
return null; // invalid