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 post-merge unit test fixes, formatting
[jalview.git]
/
src
/
jalview
/
io
/
ModellerDescription.java
diff --git
a/src/jalview/io/ModellerDescription.java
b/src/jalview/io/ModellerDescription.java
index
c1849fc
..
48a6903
100755
(executable)
--- a/
src/jalview/io/ModellerDescription.java
+++ b/
src/jalview/io/ModellerDescription.java
@@
-20,7
+20,13
@@
*/
package jalview.io;
*/
package jalview.io;
+import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.SequenceI;
+import jalview.util.Platform;
+
+import java.util.List;
+
+import com.stevesoft.pat.Regex;
public class ModellerDescription
{
public class ModellerDescription
{
@@
-90,12
+96,20
@@
public class ModellerDescription
}
};
}
};
+ 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
@@
-271,21
+285,20
@@
public class ModellerDescription
if (seq.getDatasetSequence() != null
&& seq.getDatasetSequence().getDBRefs() != null)
{
if (seq.getDatasetSequence() != null
&& seq.getDatasetSequence().getDBRefs() != null)
{
- jalview.datamodel.DBRefEntry[] dbr = seq.getDatasetSequence()
- .getDBRefs();
- int i, j;
- for (i = 0, j = dbr.length; i < j; i++)
+ List<DBRefEntry> dbr = seq.getDatasetSequence().getDBRefs();
+ for (int i = 0, ni = dbr.size(); i < ni; i++)
{
{
- if (dbr[i] != null)
+ DBRefEntry dbri = dbr.get(i);
+ if (dbri != null)
{
// JBPNote PDB dbRefEntry needs properties to propagate onto
// ModellerField
// JBPNote Need to get info from the user about whether the sequence
// is the one being modelled, or if it is a template.
{
// JBPNote PDB dbRefEntry needs properties to propagate onto
// ModellerField
// JBPNote Need to get info from the user about whether the sequence
// is the one being modelled, or if it is a template.
- if (dbr[i].getSource()
+ if (dbri.getSource()
.equals(jalview.datamodel.DBRefSource.PDB))
{
.equals(jalview.datamodel.DBRefSource.PDB))
{
- fields.put(Fields[LOCALID], dbr[i].getAccessionId());
+ fields.put(Fields[LOCALID], dbri.getAccessionId());
t = 2;
break;
}
t = 2;
break;
}