diff --git a/CHANGELOG.md b/CHANGELOG.md
index 07be3a5172..aa0cc2b686 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,20 @@
BioJava Changelog
-----------------
-BioJava 7.2.3 - future release
+BioJava 7.2.5
+==============================
+### Fixed
+* Fix NPE in Structure.toMMCIF() for some PDB entries (e.g. 2G10)
+* Maven plugin duplication in main pom.xml
+* Fixes for SonarQube S1155
+* Some library upgrades
+
+BioJava 7.2.4
+==============================
+### Fixed
+* Edge case in quaternary symmetry calculation #1120
+
+BioJava 7.2.3
==============================
### Fixed
* Don't use label_seq_id in mmCIF output for non-polymers #1116
diff --git a/README.md b/README.md
index af128cd92c..5c4b8f6ed2 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# Welcome to

-[](https://github.com/biojava/biojava/releases/tag/biojava-7.2.2) [](https://github.com/biojava/biojava/blob/master/LICENSE) [](https://gitter.im/biojava/biojava?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[](https://github.com/biojava/biojava/releases/tag/biojava-7.2.5) [](https://github.com/biojava/biojava/blob/master/LICENSE) [](https://gitter.im/biojava/biojava?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
BioJava is an open-source project dedicated to providing a Java framework for **processing biological data**. It provides analytical and statistical routines, parsers for common file formats, reference implementations of popular algorithms, and allows the manipulation of sequences and 3D structures. The goal of the biojava project is to facilitate rapid application development for bioinformatics.
@@ -29,7 +29,7 @@ If you are using Maven you can add the BioJava repository by adding the followin
org.biojava
biojava-core
- 7.2.2
+ 7.2.5
diff --git a/biojava-aa-prop/pom.xml b/biojava-aa-prop/pom.xml
index 0c1016c3b6..1209448b5f 100644
--- a/biojava-aa-prop/pom.xml
+++ b/biojava-aa-prop/pom.xml
@@ -2,7 +2,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
4.0.0
biojava-aa-prop
@@ -70,12 +70,12 @@
org.biojava
biojava-core
- 7.2.3
+ 7.2.6-SNAPSHOT
org.biojava
biojava-structure
- 7.2.3
+ 7.2.6-SNAPSHOT
diff --git a/biojava-alignment/pom.xml b/biojava-alignment/pom.xml
index 7bb6e3b2ee..6f57e23426 100644
--- a/biojava-alignment/pom.xml
+++ b/biojava-alignment/pom.xml
@@ -4,7 +4,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava-alignment
biojava-alignment
@@ -47,7 +47,7 @@
org.biojava
biojava-core
- 7.2.3
+ 7.2.6-SNAPSHOT
compile
diff --git a/biojava-core/pom.xml b/biojava-core/pom.xml
index 890ce360bc..3ad7189c9e 100644
--- a/biojava-core/pom.xml
+++ b/biojava-core/pom.xml
@@ -3,7 +3,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
4.0.0
biojava-core
diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleAlignedSequence.java b/biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleAlignedSequence.java
index 331480bbef..99b70c036d 100644
--- a/biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleAlignedSequence.java
+++ b/biojava-core/src/main/java/org/biojava/nbio/core/alignment/SimpleAlignedSequence.java
@@ -411,7 +411,7 @@ private void setLocation(List steps) {
}
// combine sublocations into 1 Location
- if (sublocations.size() == 0) {
+ if (sublocations.isEmpty()) {
location = null;
} else if (sublocations.size() == 1) {
location = sublocations.get(0);
diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java
index f0f2662fea..638e4e68d9 100644
--- a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java
+++ b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/GeneSequence.java
@@ -119,7 +119,7 @@ public void addIntronsUsingExons() throws Exception {
if (intronAdded) { //going to assume introns are correct
return;
}
- if (exonSequenceList.size() == 0) {
+ if (exonSequenceList.isEmpty()) {
return;
}
ExonComparator exonComparator = new ExonComparator();
diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/InsdcParser.java b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/InsdcParser.java
index e49bd22216..2d43a481bf 100644
--- a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/InsdcParser.java
+++ b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/InsdcParser.java
@@ -260,7 +260,9 @@ private List parseLocationString(String string, int versus) {
l.setPartialOn3prime(true);
}
- if (!(accession == null || "".equals(accession))) l.setAccession(new AccessionID(accession));
+ if (accession != null && !"".equals(accession)) {
+ l.setAccession(new AccessionID(accession));
+ }
boundedLocationsCollection.add(l);
diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/SequenceAsStringHelper.java b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/SequenceAsStringHelper.java
index c2b02debee..4acd8969f1 100644
--- a/biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/SequenceAsStringHelper.java
+++ b/biojava-core/src/main/java/org/biojava/nbio/core/sequence/storage/SequenceAsStringHelper.java
@@ -44,7 +44,7 @@ public class SequenceAsStringHelper {
*/
public String getSequenceAsString(List parsedCompounds, CompoundSet compoundSet, Integer bioBegin, Integer bioEnd, Strand strand) {
// TODO Optimise/cache.
- if(parsedCompounds.size() == 0)
+ if(parsedCompounds.isEmpty())
return "";
StringBuilder builder = new StringBuilder();
if (strand.equals(Strand.NEGATIVE)) {
diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/util/Equals.java b/biojava-core/src/main/java/org/biojava/nbio/core/util/Equals.java
index e8f78243ed..7e2c7128c9 100644
--- a/biojava-core/src/main/java/org/biojava/nbio/core/util/Equals.java
+++ b/biojava-core/src/main/java/org/biojava/nbio/core/util/Equals.java
@@ -49,7 +49,13 @@ public static boolean equal(boolean one, boolean two) {
* @see #classEqual(Object, Object)
*/
public static boolean equal(Object one, Object two) {
- return one == null && two == null || !(one == null || two == null) && (one == two || one.equals(two));
+ if (one == two) {
+ return true;
+ }
+ if (one == null || two == null) {
+ return false;
+ }
+ return one.equals(two);
}
/**
@@ -84,6 +90,12 @@ public static boolean equal(Object one, Object two) {
* equal at the class level
*/
public static boolean classEqual(Object one, Object two) {
- return one == two || !(one == null || two == null) && one.getClass() == two.getClass();
+ if (one == two) {
+ return true;
+ }
+ if (one == null || two == null) {
+ return false;
+ }
+ return one.getClass() == two.getClass();
}
}
diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/util/PrettyXMLWriter.java b/biojava-core/src/main/java/org/biojava/nbio/core/util/PrettyXMLWriter.java
index 437085866f..6e4a7db77c 100644
--- a/biojava-core/src/main/java/org/biojava/nbio/core/util/PrettyXMLWriter.java
+++ b/biojava-core/src/main/java/org/biojava/nbio/core/util/PrettyXMLWriter.java
@@ -72,7 +72,7 @@ public void declareNamespace(String nsURI, String prefixHint)
private void handleDeclaredNamespaces()
throws IOException
{
- if (namespacesDeclared.size() == 0) {
+ if (namespacesDeclared.isEmpty()) {
for (Iterator nsi = namespacesDeclared.iterator(); nsi.hasNext(); ) {
String nsURI = nsi.next();
if (!namespacePrefixes.containsKey(nsURI)) {
diff --git a/biojava-core/src/test/java/org/biojava/nbio/core/sequence/loader/GenbankProxySequenceReaderTest.java b/biojava-core/src/test/java/org/biojava/nbio/core/sequence/loader/GenbankProxySequenceReaderTest.java
index 6883637a49..0e8f7f41f5 100644
--- a/biojava-core/src/test/java/org/biojava/nbio/core/sequence/loader/GenbankProxySequenceReaderTest.java
+++ b/biojava-core/src/test/java/org/biojava/nbio/core/sequence/loader/GenbankProxySequenceReaderTest.java
@@ -162,7 +162,7 @@ so it should be done here (manualy).
logger.info("taxonomy name '{}'", taxonName);
Assert.assertNotNull(taxonName);
- if (seq.getFeaturesByType("CDS").size() > 0) {
+ if (!seq.getFeaturesByType("CDS").isEmpty()) {
FeatureInterface, AminoAcidCompound> CDS = seq.getFeaturesByType("CDS").get(0);
logger.info("CDS: {}", CDS);
String codedBy = CDS.getQualifiers().get("coded_by").get(0).getValue();
diff --git a/biojava-genome/pom.xml b/biojava-genome/pom.xml
index 79608afaf4..698fa280c7 100644
--- a/biojava-genome/pom.xml
+++ b/biojava-genome/pom.xml
@@ -3,7 +3,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
4.0.0
biojava-genome
@@ -70,13 +70,13 @@
org.biojava
biojava-core
- 7.2.3
+ 7.2.6-SNAPSHOT
compile
org.biojava
biojava-alignment
- 7.2.3
+ 7.2.6-SNAPSHOT
compile
diff --git a/biojava-genome/src/main/java/org/biojava/nbio/genome/GeneFeatureHelper.java b/biojava-genome/src/main/java/org/biojava/nbio/genome/GeneFeatureHelper.java
index c9786b3ad0..b417c4608d 100644
--- a/biojava-genome/src/main/java/org/biojava/nbio/genome/GeneFeatureHelper.java
+++ b/biojava-genome/src/main/java/org/biojava/nbio/genome/GeneFeatureHelper.java
@@ -36,7 +36,7 @@
/**
*
- * @author Scooter Willis
+ * @author Scooter Willis
*/
public class GeneFeatureHelper {
@@ -418,7 +418,7 @@ static public void addGmodGFF3GeneFeatures(Map chrom
String startCodonName = "";
String stopCodonName = "";
FeatureList startCodonList = mRNAChildren.selectByType("five_prime_UTR");
- if (startCodonList != null && startCodonList.size() > 0) {
+ if (startCodonList != null && !startCodonList.isEmpty()) {
startCodon = startCodonList.get(0);
if (strand == Strand.NEGATIVE) {
startCodonBegin = startCodon.location().bioEnd();
@@ -430,7 +430,7 @@ static public void addGmodGFF3GeneFeatures(Map chrom
FeatureList stopCodonList = mRNAChildren.selectByType("three_prime_UTR");
- if (stopCodonList != null && stopCodonList.size() > 0) {
+ if (stopCodonList != null && !stopCodonList.isEmpty()) {
stopCodon = stopCodonList.get(0);
if (strand == Strand.NEGATIVE) {
stopCodonEnd = stopCodon.location().bioStart();
@@ -577,7 +577,7 @@ static public void addGlimmerGFF3GeneFeatures(Map ch
String startCodonName = "";
String stopCodonName = "";
FeatureList startCodonList = gene.selectByAttribute("Note", "initial-exon");
- if (startCodonList != null && startCodonList.size() > 0) {
+ if (startCodonList != null && !startCodonList.isEmpty()) {
startCodon = startCodonList.get(0);
if (strand == Strand.NEGATIVE) {
startCodonBegin = startCodon.location().bioEnd();
@@ -589,7 +589,7 @@ static public void addGlimmerGFF3GeneFeatures(Map ch
FeatureList stopCodonList = gene.selectByAttribute("Note", "final-exon");
- if (stopCodonList != null && stopCodonList.size() > 0) {
+ if (stopCodonList != null && !stopCodonList.isEmpty()) {
stopCodon = stopCodonList.get(0);
if (strand == Strand.NEGATIVE) {
stopCodonEnd = stopCodon.location().bioStart();
@@ -723,7 +723,7 @@ static public void addGeneMarkGTFGeneFeatures(Map ch
String startCodonName = "";
String stopCodonName = "";
FeatureList startCodonList = transcriptFeature.selectByType("start_codon");
- if (startCodonList != null && startCodonList.size() > 0) {
+ if (startCodonList != null && !startCodonList.isEmpty()) {
startCodon = startCodonList.get(0);
if (strand == Strand.POSITIVE) {
startCodonBegin = startCodon.location().bioStart();
@@ -735,7 +735,7 @@ static public void addGeneMarkGTFGeneFeatures(Map ch
FeatureList stopCodonList = transcriptFeature.selectByType("stop_codon");
- if (stopCodonList != null && stopCodonList.size() > 0) {
+ if (stopCodonList != null && !stopCodonList.isEmpty()) {
stopCodon = stopCodonList.get(0);
if (strand == Strand.POSITIVE) {
stopCodonEnd = stopCodon.location().bioEnd();
diff --git a/biojava-genome/src/main/java/org/biojava/nbio/genome/homology/GFF3FromUniprotBlastHits.java b/biojava-genome/src/main/java/org/biojava/nbio/genome/homology/GFF3FromUniprotBlastHits.java
index 67e22bd992..1547aba2d9 100644
--- a/biojava-genome/src/main/java/org/biojava/nbio/genome/homology/GFF3FromUniprotBlastHits.java
+++ b/biojava-genome/src/main/java/org/biojava/nbio/genome/homology/GFF3FromUniprotBlastHits.java
@@ -46,7 +46,7 @@
/**
*
- * @author Scooter Willis
+ * @author Scooter Willis
* @author Mark Chapman
*/
public class GFF3FromUniprotBlastHits {
@@ -163,7 +163,7 @@ PairwiseSequenceAlignerType.LOCAL, new SimpleGapPenalty(),
String notes = "";
if (featureKeyWords != null) {
List keyWords = featureKeyWords.getKeyWords();
- if (keyWords.size() > 0) {
+ if (!keyWords.isEmpty()) {
notes = ";Note=";
for (String note : keyWords) {
if ("Complete proteome".equals(note)) {
@@ -187,7 +187,7 @@ PairwiseSequenceAlignerType.LOCAL, new SimpleGapPenalty(),
List cazyList = databaseReferenceHashMap.get("CAZy");
List goList = databaseReferenceHashMap.get("GO");
List eccList = databaseReferenceHashMap.get("BRENDA");
- if (pfamList != null && pfamList.size() > 0) {
+ if (pfamList != null && !pfamList.isEmpty()) {
if (notes.length() == 0) {
notes = ";Note=";
}
@@ -197,7 +197,7 @@ PairwiseSequenceAlignerType.LOCAL, new SimpleGapPenalty(),
}
}
- if (cazyList != null && cazyList.size() > 0) {
+ if (cazyList != null && !cazyList.isEmpty()) {
if (notes.length() == 0) {
notes = ";Note=";
}
@@ -208,7 +208,7 @@ PairwiseSequenceAlignerType.LOCAL, new SimpleGapPenalty(),
}
}
- if (eccList != null && eccList.size() > 0) {
+ if (eccList != null && !eccList.isEmpty()) {
if (notes.length() == 0) {
notes = ";Note=";
}
@@ -221,8 +221,8 @@ PairwiseSequenceAlignerType.LOCAL, new SimpleGapPenalty(),
}
}
- if (goList != null && goList.size() > 0) {
- if (notes.length() == 0) {
+ if (goList != null && !goList.isEmpty()) {
+ if (notes.isEmpty()) {
notes = ";Note=";
}
for (DBReferenceInfo note : goList) {
diff --git a/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/GFF3Writer.java b/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/GFF3Writer.java
index 88af970928..0f8bd97884 100644
--- a/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/GFF3Writer.java
+++ b/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/GFF3Writer.java
@@ -31,7 +31,7 @@
/**
*
- * @author Scooter Willis
+ * @author Scooter Willis
*/
public class GFF3Writer {
@@ -122,7 +122,7 @@ public void write(OutputStream outputStream, Map chr
private String getGFF3Note(List notesList) {
String notes = "";
- if (notesList.size() > 0) {
+ if (!notesList.isEmpty()) {
notes = ";Note=";
int noteindex = 1;
for (String note : notesList) {
diff --git a/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java b/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java
index 4163be2b56..a28f1019fb 100644
--- a/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java
+++ b/biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/gff/Location.java
@@ -135,7 +135,7 @@ public static Location fromBio( int start, int end, char strand )
int s= start - 1;
int e= end;
- if( !( strand == '-' || strand == '+' || strand == '.' ))
+ if( strand != '-' && strand != '+' && strand != '.' )
{
throw new IllegalArgumentException( "Strand must be '+', '-', or '.'" );
}
@@ -166,7 +166,7 @@ public static Location fromBioExt( int start, int length, char strand, int total
int s= start;
int e= s + length;
- if( !( strand == '-' || strand == '+' || strand == '.' ))
+ if( strand != '-' && strand != '+' && strand != '.' )
{
throw new IllegalArgumentException( "Strand must be '+', '-', or '.'" );
}
diff --git a/biojava-integrationtest/pom.xml b/biojava-integrationtest/pom.xml
index 41d9be230c..349393cfa6 100644
--- a/biojava-integrationtest/pom.xml
+++ b/biojava-integrationtest/pom.xml
@@ -4,7 +4,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava-integrationtest
jar
@@ -40,7 +40,7 @@
org.biojava
biojava-structure
- 7.2.3
+ 7.2.6-SNAPSHOT
diff --git a/biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/TestSeqResParsing.java b/biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/TestSeqResParsing.java
index de6c072719..6ea23aef8a 100644
--- a/biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/TestSeqResParsing.java
+++ b/biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/TestSeqResParsing.java
@@ -53,7 +53,7 @@ public void test11GS() throws IOException, StructureException{
s = StructureIO.getStructure(pdbID);
assertNotNull(s);
- assertTrue(s.getChains().size() > 0);
+ assertFalse(s.getChains().isEmpty());
Chain c = s.getChainByIndex(0);
assertTrue(c.getSeqResGroups().size() > 2);
diff --git a/biojava-modfinder/pom.xml b/biojava-modfinder/pom.xml
index 876203f207..cec4445407 100644
--- a/biojava-modfinder/pom.xml
+++ b/biojava-modfinder/pom.xml
@@ -4,7 +4,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava-modfinder
biojava-modfinder
@@ -31,7 +31,7 @@
org.biojava
biojava-structure
- 7.2.3
+ 7.2.6-SNAPSHOT
jar
compile
diff --git a/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/io/ModifiedCompoundXMLConverter.java b/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/io/ModifiedCompoundXMLConverter.java
index 187e113924..e038f57cd3 100644
--- a/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/io/ModifiedCompoundXMLConverter.java
+++ b/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/io/ModifiedCompoundXMLConverter.java
@@ -69,7 +69,7 @@ public static String toXML(ModifiedCompound mc) throws IOException{
Set linkages = mc.getAtomLinkages();
- if ( linkages.size() > 0 ) {
+ if (!linkages.isEmpty()) {
int pos = -1;
for ( StructureAtomLinkage link: linkages){
pos ++;
diff --git a/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java b/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
index c9575a5444..0d94d36e6e 100644
--- a/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
+++ b/biojava-modfinder/src/main/java/org/biojava/nbio/protmod/structure/ProteinModificationIdentifier.java
@@ -285,7 +285,7 @@ public void identify(final List chains,
if (residues.isEmpty()) {
String pdbId = "?";
- if ( chains.size() > 0) {
+ if (!chains.isEmpty()) {
Structure struc = chains.get(0).getStructure();
if ( struc != null)
pdbId = struc.getPDBCode();
diff --git a/biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite/TestAcetylation.java b/biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite/TestAcetylation.java
index 34376307a0..ba8e6d2a3d 100644
--- a/biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite/TestAcetylation.java
+++ b/biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite/TestAcetylation.java
@@ -32,7 +32,8 @@
import java.net.URL;
import java.util.List;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
@@ -100,11 +101,11 @@ public void testAcetylation() throws IOException {
List sites = Site.parseSites(localFile);
- assertTrue(sites.size() > 0);
+ assertFalse(sites.isEmpty());
for (Site s : sites) {
- assertTrue(s.getResidue() != null);
+ assertNotNull(s.getResidue());
}
diff --git a/biojava-ontology/pom.xml b/biojava-ontology/pom.xml
index 02e4a894d2..dff3450bc9 100644
--- a/biojava-ontology/pom.xml
+++ b/biojava-ontology/pom.xml
@@ -4,7 +4,7 @@
org.biojava
biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava-ontology
diff --git a/biojava-ontology/src/main/java/org/biojava/nbio/ontology/utils/WeakValueHashMap.java b/biojava-ontology/src/main/java/org/biojava/nbio/ontology/utils/WeakValueHashMap.java
index 7762642c76..c508cdc206 100644
--- a/biojava-ontology/src/main/java/org/biojava/nbio/ontology/utils/WeakValueHashMap.java
+++ b/biojava-ontology/src/main/java/org/biojava/nbio/ontology/utils/WeakValueHashMap.java
@@ -58,12 +58,12 @@ public WeakValueHashMap() {
private void diddleReferenceQueue() {
// Avoid making behind-the-scenes modifications while iterators exist.
- if (iteratorRefs.size() > 0) {
+ if (!iteratorRefs.isEmpty()) {
Reference ref;
while ((ref = iteratorRefQueue.poll()) != null) {
iteratorRefs.remove(ref);
}
- if (iteratorRefs.size() > 0) {
+ if (!iteratorRefs.isEmpty()) {
return;
}
}
diff --git a/biojava-protein-comparison-tool/pom.xml b/biojava-protein-comparison-tool/pom.xml
index b4de1b1e8a..3b43bc492d 100644
--- a/biojava-protein-comparison-tool/pom.xml
+++ b/biojava-protein-comparison-tool/pom.xml
@@ -4,7 +4,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava-protein-comparison-tool
@@ -36,23 +36,23 @@
org.biojava
biojava-alignment
- 7.2.3
+ 7.2.6-SNAPSHOT
org.biojava
biojava-core
- 7.2.3
+ 7.2.6-SNAPSHOT
org.biojava
biojava-structure
- 7.2.3
+ 7.2.6-SNAPSHOT
org.biojava
biojava-structure-gui
- 7.2.3
+ 7.2.6-SNAPSHOT
net.sourceforge.jmol
diff --git a/biojava-protein-disorder/pom.xml b/biojava-protein-disorder/pom.xml
index d5e216b60d..d0267a7519 100644
--- a/biojava-protein-disorder/pom.xml
+++ b/biojava-protein-disorder/pom.xml
@@ -3,7 +3,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava-protein-disorder
jar
@@ -63,7 +63,7 @@
org.biojava
biojava-core
- 7.2.3
+ 7.2.6-SNAPSHOT
diff --git a/biojava-structure-gui/pom.xml b/biojava-structure-gui/pom.xml
index 62db686d60..314c32bf16 100644
--- a/biojava-structure-gui/pom.xml
+++ b/biojava-structure-gui/pom.xml
@@ -3,7 +3,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
4.0.0
biojava-structure-gui
@@ -27,13 +27,13 @@
org.biojava
biojava-structure
- 7.2.3
+ 7.2.6-SNAPSHOT
compile
org.biojava
biojava-core
- 7.2.3
+ 7.2.6-SNAPSHOT
compile
diff --git a/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/JAutoSuggest.java b/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/JAutoSuggest.java
index 9e3c825910..c5542b4edc 100644
--- a/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/JAutoSuggest.java
+++ b/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/JAutoSuggest.java
@@ -229,7 +229,7 @@ public void keyReleased(KeyEvent e) {
list.ensureIndexIsVisible(list.getSelectedIndex() - 1);
return;
} else if (e.getKeyCode() == KeyEvent.VK_ENTER
- && list.getSelectedIndex() != -1 && suggestions.size() > 0) {
+ && list.getSelectedIndex() != -1 && !suggestions.isEmpty()) {
setText((String) list.getSelectedValue());
@@ -365,7 +365,7 @@ public String doInBackground() {
setFont(regular);
- if (suggestions.size() > 0) {
+ if (!suggestions.isEmpty()) {
list.setListData(suggestions);
list.setSelectedIndex(0);
list.ensureIndexIsVisible(0);
diff --git a/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/SCOPAutoSuggestProvider.java b/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/SCOPAutoSuggestProvider.java
index 136f184584..8e1a975205 100644
--- a/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/SCOPAutoSuggestProvider.java
+++ b/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/autosuggest/SCOPAutoSuggestProvider.java
@@ -111,7 +111,7 @@ private List getPossibleScopDomains(String userInput) {
if ( stop.get())
return domains;
- if ( domains == null || domains.size() < 1){
+ if ( domains == null || domains.isEmpty()){
if ( userInput.length() > 5){
// e.g. d4hhba
@@ -127,11 +127,11 @@ private List getPossibleScopDomains(String userInput) {
if (DEBUG)
System.out.println("domains: " + domains);
- if ( domains == null || domains.size() < 1) {
+ if ( domains == null || domains.isEmpty()) {
if ( userInput.length() > 0 ){
List descs = scop.filterByClassificationId(userInput);
- if ( descs == null || descs.size() < 1){
+ if ( descs == null || descs.isEmpty()){
descs = scop.filterByDescription(userInput);
}
diff --git a/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/jmol/RasmolCommandListener.java b/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/jmol/RasmolCommandListener.java
index d1ce5c0e30..feec8b0366 100644
--- a/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/jmol/RasmolCommandListener.java
+++ b/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/jmol/RasmolCommandListener.java
@@ -74,7 +74,7 @@ public void actionPerformed(ActionEvent event) {
// check last command in history
// if equivalent, don't add,
// otherwise add
- if (history.size()>0){
+ if (!history.isEmpty()){
String txt=history.get(history.size()-1);
if (! txt.equals(cmd)) {
history.add(cmd);
diff --git a/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java b/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java
index 06542e5271..75da6c8e28 100644
--- a/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java
+++ b/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/gui/util/SequenceScalePanel.java
@@ -126,7 +126,7 @@ private void setPrefSize() {
public void setAligMap(List apos){
this.apos = apos;
- if ( apos.size() == 0)
+ if (apos.isEmpty())
return;
AlignedPosition last = apos.get(apos.size()-1);
diff --git a/biojava-structure/pom.xml b/biojava-structure/pom.xml
index aeff7465c0..c80a8490bd 100644
--- a/biojava-structure/pom.xml
+++ b/biojava-structure/pom.xml
@@ -4,7 +4,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava-structure
biojava-structure
@@ -51,13 +51,13 @@
org.biojava
biojava-alignment
- 7.2.3
+ 7.2.6-SNAPSHOT
compile
org.biojava
biojava-core
- 7.2.3
+ 7.2.6-SNAPSHOT
compile
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/Author.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/Author.java
index b0d7253507..bd5a01b885 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/Author.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/Author.java
@@ -62,7 +62,7 @@ public boolean equals(Object obj) {
if ((this.surname == null) ? (other.surname != null) : !this.surname.equals(other.surname)) {
return false;
}
- return !((this.initials == null) ? (other.initials != null) : !this.initials.equals(other.initials));
+ return (this.initials == null) ? other.initials == null : this.initials.equals(other.initials);
}
@Override
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/Element.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/Element.java
index 2f534b2828..4e2d3e340a 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/Element.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/Element.java
@@ -424,7 +424,7 @@ public boolean isHeavyAtom() {
* @return true if Element is not Hydrogen and not Carbon.
*/
public boolean isHeteroAtom() {
- return !(this == C || this == H);
+ return this != C && this != H;
}
/**
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/Site.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/Site.java
index 9158906d23..341483f31b 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/Site.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/Site.java
@@ -83,7 +83,7 @@ public String toPDB() {
@Override
public void toPDB(StringBuffer buf) {
- if (groups == null || groups.size() < 1) {
+ if (groups == null || groups.isEmpty()) {
return;
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ClusterAltAligs.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ClusterAltAligs.java
index 373bcf1611..0933198d7b 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ClusterAltAligs.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ClusterAltAligs.java
@@ -102,7 +102,7 @@ public static void cluster(AlternativeAlignment[] aligs, int cutoff){
}
clusters.add(currentCluster);
- if ( remainList.size() == 0) {
+ if ( remainList.isEmpty()) {
break;
}
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CECalculator.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CECalculator.java
index 6c045ba48e..83f16b7982 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CECalculator.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CECalculator.java
@@ -1450,7 +1450,7 @@ private int optimizeSuperposition(AFPChain afpChain, int nse1, int nse2, int str
//afpChain.setTotalRmsdOpt(rmsd);
//System.out.println("rmsd: " + rmsd);
- if(!(nAtom= strLen * 0.95 && !isRmsdLenAssigned) {
rmsdLen=rmsd;
isRmsdLenAssigned=true;
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCalculatorEnhanced.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCalculatorEnhanced.java
index 4f57161268..cab98b0113 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCalculatorEnhanced.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCalculatorEnhanced.java
@@ -1455,7 +1455,7 @@ private int optimizeSuperposition(AFPChain afpChain, int nse1, int nse2, int str
//afpChain.setTotalRmsdOpt(rmsd);
//System.out.println("rmsd: " + rmsd);
- if(!(nAtom= strLen * 0.95 && !isRmsdLenAssigned) {
rmsdLen=rmsd;
isRmsdLenAssigned=true;
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/BlockImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/BlockImpl.java
index e0423b6f8f..43da1d7c06 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/BlockImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/BlockImpl.java
@@ -127,7 +127,7 @@ public void setAlignRes(List> alignRes) {
public int length() {
if (alignRes == null)
return 0;
- if (alignRes.size() == 0)
+ if (alignRes.isEmpty())
return 0;
return alignRes.get(0).size();
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/BlockSetImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/BlockSetImpl.java
index cbbb3ae895..344ee3c239 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/BlockSetImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/BlockSetImpl.java
@@ -179,7 +179,7 @@ public int size() {
// Get the size from the variables that can contain the information
if (parent != null)
return parent.size();
- else if (getBlocks().size() == 0) {
+ else if (getBlocks().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty BlockSet: number of Blocks == 0.");
} else
@@ -194,7 +194,7 @@ public int getCoreLength() {
}
protected void updateLength() {
- if (getBlocks().size() == 0) {
+ if (getBlocks().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty BlockSet: number of Blocks == 0.");
}
@@ -207,7 +207,7 @@ protected void updateLength() {
}
protected void updateCoreLength() {
- if (getBlocks().size() == 0) {
+ if (getBlocks().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty BlockSet: number of Blocks == 0.");
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/MultipleAlignmentImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/MultipleAlignmentImpl.java
index 738eee30c5..06c93a4403 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/MultipleAlignmentImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/MultipleAlignmentImpl.java
@@ -207,7 +207,7 @@ public int getCoreLength() {
* lengths.
*/
protected void updateLength() {
- if (getBlockSets().size() == 0) {
+ if (getBlockSets().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty MultipleAlignment: blockSets size == 0.");
} // Otherwise try to calculate it from the BlockSet information
@@ -223,7 +223,7 @@ protected void updateLength() {
* BlockSet core lengths.
*/
protected void updateCoreLength() {
- if (getBlockSets().size() == 0) {
+ if (getBlockSets().isEmpty()) {
throw new IndexOutOfBoundsException(
"Empty MultipleAlignment: blockSets size == 0.");
} // Otherwise try to calculate it from the BlockSet information
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/mc/MultipleMcOptimizer.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/mc/MultipleMcOptimizer.java
index 052f147fc6..29c7012801 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/mc/MultipleMcOptimizer.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/mc/MultipleMcOptimizer.java
@@ -153,7 +153,7 @@ public MultipleMcOptimizer(MultipleAlignment seedAln,
for (Block b : toDelete) {
for (BlockSet bs : msa.getBlockSets()) {
bs.getBlocks().remove(b);
- if (bs.getBlocks().size() == 0)
+ if (bs.getBlocks().isEmpty())
emptyBs.add(bs);
}
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java
index 771b8b5f68..5033576df0 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java
@@ -205,7 +205,7 @@ public static String toTransformMatrices(MultipleAlignment alignment) {
List btransforms = alignment.getBlockSet(bs)
.getTransformations();
- if (btransforms == null || btransforms.size() < 1)
+ if (btransforms == null || btransforms.isEmpty())
continue;
if (alignment.getBlockSets().size() > 1) {
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java
index 7ac77a602e..fe1c9c411b 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/quaternary/QsAlignResult.java
@@ -117,7 +117,7 @@ public void setSubunitMap(Map subunitMap) {
"Subunit Map index higher than Subunit List size.");
// Update the relation enum
- if (subunitMap.size() == 0) {
+ if (subunitMap.isEmpty()) {
relation = QsRelation.DIFFERENT;
} else if (subunitMap.keySet().size() == subunits1.size()) {
if (subunitMap.values().size() == subunits2.size()) {
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
index c6791f4ed2..e535a87508 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AlignmentTools.java
@@ -1313,7 +1313,7 @@ public static Group[] prepareGroupsForDisplay(AFPChain afpChain, Atom[] ca1, Ato
if ( afpChain.getBlockNum() > 0){
// Superimpose ligands relative to the first block
- if( hetatms2.size() > 0 ) {
+ if(!hetatms2.isEmpty()) {
if ( afpChain.getBlockRotationMatrix().length > 0 ) {
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java
index 1435191c2c..71b8a3da22 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java
@@ -228,7 +228,7 @@ public Structure getBiologicalAssembly(String pdbId, int bioAssemblyId, boolean
throws StructureException, IOException {
return getBiologicalAssembly(new PdbId(pdbId), bioAssemblyId, multiModel);
}
-
+
/**
* Returns the biological assembly for a given PDB ID and bioAssemblyId, by building the
* assembly from the biounit annotations found in {@link Structure#getPDBHeader()}
@@ -284,7 +284,7 @@ public Structure getBiologicalAssembly(PdbId pdbId, int bioAssemblyId, boolean m
asymUnit.getPDBHeader().getBioAssemblies().get(bioAssemblyId).getTransforms();
- if (transformations == null || transformations.size() == 0) {
+ if (transformations == null || transformations.isEmpty()) {
throw new StructureException("Could not load transformations to recreate biological assembly id " + bioAssemblyId + " of " + pdbId);
}
@@ -339,7 +339,7 @@ public Structure getBiologicalAssembly(String pdbId, boolean multiModel) throws
asymUnit.getPDBHeader().getBioAssemblies().get(bioAssemblyId).getTransforms();
- if (transformations == null || transformations.size() == 0) {
+ if (transformations == null || transformations.isEmpty()) {
throw new StructureException("Could not load transformations to recreate biological assembly id " + bioAssemblyId + " of " + pdbId);
}
@@ -385,7 +385,7 @@ public List getBiologicalAssemblies(String pdbId, boolean multiModel)
List transformations =
asymUnit.getPDBHeader().getBioAssemblies().get(bioAssemblyId).getTransforms();
- if (transformations == null || transformations.size() == 0) {
+ if (transformations == null || transformations.isEmpty()) {
logger.info("Could not load transformations to recreate biological assembly id {} of {}. Assembly " +
"id will be missing in biological assemblies.", bioAssemblyId, pdbId);
continue;
@@ -807,7 +807,7 @@ public Structure getStructureForPdbId(String id) throws IOException, StructureEx
public Structure getStructureForPdbId(PdbId pdbId) throws IOException {
if (pdbId == null)
return null;
-
+
while (checkLoading(pdbId)) {
// waiting for loading to be finished...
try {
@@ -833,7 +833,7 @@ public Structure getStructureForPdbId(PdbId pdbId) throws IOException {
protected Structure loadStructureFromCifByPdbId(String pdbId) throws IOException {
return loadStructureFromCifByPdbId(new PdbId(pdbId));
}
-
+
protected Structure loadStructureFromCifByPdbId(PdbId pdbId) throws IOException {
logger.debug("Loading structure {} from mmCIF file {}.", pdbId, path);
Structure s;
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/MultipleAlignmentXMLParser.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/MultipleAlignmentXMLParser.java
index 759ee61931..e8d5434578 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/MultipleAlignmentXMLParser.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/xml/MultipleAlignmentXMLParser.java
@@ -169,7 +169,7 @@ else if ("ScoresCache".equals(child.getNodeName())){
}
}
//Because if it is 0 means that there were no transformations
- if (transforms.size() != 0){
+ if (!transforms.isEmpty()){
bs.setTransformations(transforms);
}
return bs;
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/chem/ZipChemCompProvider.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/chem/ZipChemCompProvider.java
index 4fe19aca58..a68019efb7 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/chem/ZipChemCompProvider.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/chem/ZipChemCompProvider.java
@@ -120,7 +120,7 @@ public ChemComp getChemComp(String recordName) {
}
// If a null record or an empty chemcomp, return a default ChemComp and blacklist.
- if (cc == null || (null == cc.getName() && cc.getAtoms().size() == 0)) {
+ if (cc == null || (null == cc.getName() && cc.getAtoms().isEmpty())) {
s_logger.info("Unable to find or download {} - excluding from future searches.", recordName);
unavailable.add(recordName);
return getEmptyChemComp(recordName);
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitCluster.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitCluster.java
index 9a87e92f88..87c3c06e3c 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitCluster.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitCluster.java
@@ -331,7 +331,7 @@ public boolean mergeIdenticalByEntityId(SubunitCluster other) {
}
}
- if (thisAligned.size() == 0 && otherAligned.size() == 0) {
+ if (thisAligned.isEmpty() && otherAligned.isEmpty()) {
logger.warn("No equivalent aligned atoms found between SubunitClusters {}-{} via entity SEQRES alignment. Is FileParsingParameters.setAlignSeqRes() set?", thisName, otherName);
}
@@ -507,27 +507,24 @@ public boolean mergeStructure(SubunitCluster other, SubunitClustererParameters p
}
}
- AFPChain afp = aligner.align(this.subunits.get(this.representative)
- .getRepresentativeAtoms(),
- other.subunits.get(other.representative)
- .getRepresentativeAtoms());
+ AFPChain afp = aligner.align(this.subunits.get(this.representative).getRepresentativeAtoms(),
+ other.subunits.get(other.representative).getRepresentativeAtoms());
+ String pairName = this.subunits.get(this.representative).getName() + "-" + other.subunits.get(other.representative).getName();
if (afp.getOptLength() < 1) {
// alignment failed (eg if chains were too short)
throw new StructureException(
- String.format("Subunits failed to align using %s", params.getSuperpositionAlgorithm()));
+ String.format("Subunits %s failed to align using %s", pairName, params.getSuperpositionAlgorithm()));
}
// Convert AFPChain to MultipleAlignment for convenience
MultipleAlignment msa = new MultipleAlignmentEnsembleImpl(
afp,
this.subunits.get(this.representative).getRepresentativeAtoms(),
- other.subunits.get(other.representative)
- .getRepresentativeAtoms(), false)
- .getMultipleAlignment(0);
+ other.subunits.get(other.representative).getRepresentativeAtoms(),
+ false).getMultipleAlignment(0);
- double structureCoverage = Math.min(msa.getCoverages().get(0), msa
- .getCoverages().get(1));
+ double structureCoverage = Math.min(msa.getCoverages().get(0), msa.getCoverages().get(1));
if(params.isUseStructureCoverage() && structureCoverage < params.getStructureCoverageThreshold()) {
return false;
@@ -543,8 +540,7 @@ public boolean mergeStructure(SubunitCluster other, SubunitClustererParameters p
return false;
}
- logger.info(String.format("SubunitClusters are structurally similar with "
- + "%.2f RMSD %.2f coverage", rmsd, structureCoverage));
+ logger.info("SubunitClusters {} are structurally similar with [ {} ] RMSD and [ {} ] coverage", pairName, String.format("%.2f", rmsd), String.format("%.2f", structureCoverage));
// Merge clusters
List> alignedRes = msa.getBlock(0).getAlignRes();
@@ -565,13 +561,18 @@ public boolean mergeStructure(SubunitCluster other, SubunitClustererParameters p
// Only consider residues that are part of the SubunitCluster
if (this.subunitEQR.get(this.representative).contains(thisIndex)
- && other.subunitEQR.get(other.representative).contains(
- otherIndex)) {
+ && other.subunitEQR.get(other.representative).contains(otherIndex)) {
thisAligned.add(thisIndex);
otherAligned.add(otherIndex);
}
}
+ // this can happen in very rare cases, e.g. 9y9z when merging E_1 into the cluster D_1, OM_1, Y_1
+ if (thisAligned.isEmpty() && otherAligned.isEmpty()) {
+ logger.warn("No equivalent aligned atoms found between SubunitClusters {} via structure alignment. Will not merge the second one into the first.", pairName);
+ return false;
+ }
+
updateEquivResidues(other, thisAligned, otherAligned);
this.method = SubunitClustererMethod.STRUCTURE;
@@ -602,18 +603,12 @@ private void updateEquivResidues(SubunitCluster other, List thisAligned
Collections.sort(otherRemove);
Collections.reverse(otherRemove);
- for (int t = 0; t < thisRemove.size(); t++) {
- for (List eqr : this.subunitEQR) {
- int column = thisRemove.get(t);
- eqr.remove(column);
- }
+ for (int column : thisRemove) {
+ this.subunitEQR.forEach(eqr -> eqr.remove(column));
}
- for (int t = 0; t < otherRemove.size(); t++) {
- for (List eqr : other.subunitEQR) {
- int column = otherRemove.get(t);
- eqr.remove(column);
- }
+ for (int column : otherRemove) {
+ other.subunitEQR.forEach(eqr -> eqr.remove(column));
}
// The representative is the longest sequence
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitClusterer.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitClusterer.java
index 6295f8fdf0..fa63b96d96 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitClusterer.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitClusterer.java
@@ -58,7 +58,7 @@ public static Stoichiometry cluster(Structure structure,
public static Stoichiometry cluster(List subunits, SubunitClustererParameters params) {
List clusters = new ArrayList<>();
- if (subunits.size() == 0)
+ if (subunits.isEmpty())
return new Stoichiometry(clusters);
// First generate a new cluster for each Subunit
@@ -83,8 +83,7 @@ public static Stoichiometry cluster(List subunits, SubunitClustererPara
}
} catch (CompoundNotFoundException e) {
- logger.warn("Could not merge by Sequence. {}",
- e.getMessage());
+ logger.info("Could not merge by Sequence. {}", e.getMessage());
}
}
}
@@ -100,7 +99,7 @@ public static Stoichiometry cluster(List subunits, SubunitClustererPara
clusters.remove(c2);
}
} catch (StructureException e) {
- logger.warn("Could not merge by Structure. {}", e.getMessage());
+ logger.info("Could not merge by Structure. {}", e.getMessage());
}
}
}
@@ -112,8 +111,7 @@ public static Stoichiometry cluster(List subunits, SubunitClustererPara
try {
clusters.get(c).divideInternally(params);
} catch (StructureException e) {
- logger.warn("Error analyzing internal symmetry. {}",
- e.getMessage());
+ logger.info("Error analyzing internal symmetry. {}", e.getMessage());
}
}
@@ -125,8 +123,7 @@ public static Stoichiometry cluster(List subunits, SubunitClustererPara
if (clusters.get(c1).mergeStructure(clusters.get(c2), params))
clusters.remove(c2);
} catch (StructureException e) {
- logger.warn("Could not merge by Structure. {}",
- e.getMessage());
+ logger.info("Could not merge by Structure. {}", e.getMessage());
}
}
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContact.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContact.java
index 07b163730d..245d4481f6 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContact.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/GroupContact.java
@@ -57,7 +57,7 @@ public void setPair(Pair pair) {
}
public double getMinDistance() {
- if (atomContacts.size()==0) return 0;
+ if (atomContacts.isEmpty()) return 0;
double minDistance = Double.MAX_VALUE;
for (AtomContact atomContact:atomContacts) {
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java
index 60f7c3a91b..00cf7ef65c 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java
@@ -380,7 +380,7 @@ public List getClusters(double contactOverlapScoreClu
clusters = new ArrayList<>();
// nothing to do if we have no interfaces
- if (list.size()==0) return clusters;
+ if (list.isEmpty()) return clusters;
logger.debug("Calculating all-vs-all Jaccard scores for {} interfaces", list.size());
double[][] matrix = new double[list.size()][list.size()];
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/MomentsOfInertia.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/MomentsOfInertia.java
index 8cfd032daa..5a6e69c4cf 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/MomentsOfInertia.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/MomentsOfInertia.java
@@ -72,7 +72,7 @@ public void addPoint(Point3d point, double mass) {
public Point3d getCenterOfMass() {
- if (points.size() == 0) {
+ if (points.isEmpty()) {
throw new IllegalStateException(
"MomentsOfInertia: no points defined");
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/BondMaker.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/BondMaker.java
index e6b8548025..e81f7fb867 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/BondMaker.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/BondMaker.java
@@ -273,7 +273,7 @@ private void trimBondLists() {
for (Chain chain : structure.getChains(modelInd)) {
for (Group group : chain.getAtomGroups()) {
for (Atom atom : group.getAtoms()) {
- if (atom.getBonds()!=null && atom.getBonds().size() > 0) {
+ if (atom.getBonds()!=null && !atom.getBonds().isEmpty()) {
((ArrayList) atom.getBonds()).trimToSize();
}
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
index 176459bbf2..f5cc851fec 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java
@@ -1943,7 +1943,7 @@ private Group getCorrectAltLocGroup( Character altLoc,
// see if we know this altLoc already;
List atoms = currentGroup.getAtoms();
- if ( atoms.size() > 0) {
+ if (!atoms.isEmpty()) {
Atom a1 = atoms.get(0);
// we are just adding atoms to the current group
// probably there is a second group following later...
@@ -1956,7 +1956,7 @@ private Group getCorrectAltLocGroup( Character altLoc,
List altLocs = currentGroup.getAltLocs();
for ( Group altLocG : altLocs ){
atoms = altLocG.getAtoms();
- if ( atoms.size() > 0) {
+ if (!atoms.isEmpty()) {
for ( Atom a1 : atoms) {
if (a1.getAltLoc().equals( altLoc)) {
@@ -1970,7 +1970,7 @@ private Group getCorrectAltLocGroup( Character altLoc,
// build it up.
if ( groupCode3.equals(currentGroup.getPDBName())) {
- if ( currentGroup.getAtoms().size() == 0) {
+ if ( currentGroup.getAtoms().isEmpty()) {
//System.out.println("current group is empty " + current_group + " " + altLoc);
return currentGroup;
}
@@ -2762,7 +2762,7 @@ private void makeCompounds(List compoundList,
}
// System.out.println("[makeCompounds] adding sources to compounds from sourceLines");
// since we're starting again from the first compound, reset it here
- if ( entities.size() == 0){
+ if ( entities.isEmpty()){
current_compound = new EntityInfo();
} else {
current_compound = entities.get(0);
@@ -2921,7 +2921,7 @@ private void triggerEndFileChecks(){
pdbHeader.setBioAssemblies(bioAssemblyParser.getTransformationMap());
}
- if (ncsOperators !=null && ncsOperators.size()>0) {
+ if (ncsOperators !=null && !ncsOperators.isEmpty()) {
crystallographicInfo.setNcsOperators(
ncsOperators.toArray(new Matrix4d[ncsOperators.size()]));
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SeqRes2AtomAligner.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SeqRes2AtomAligner.java
index 7ee21de4b4..0652ad1809 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SeqRes2AtomAligner.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SeqRes2AtomAligner.java
@@ -198,7 +198,7 @@ public void mapSeqresRecords(Chain atomRes, Chain seqRes) {
}
}
- if ( atomRes.getAtomGroups(GroupType.AMINOACID).size() < 1) {
+ if (atomRes.getAtomGroups(GroupType.AMINOACID).isEmpty()) {
logger.debug("ATOM chain {} does not contain amino acids, ignoring...", atomRes.getId());
return;
}
@@ -215,7 +215,7 @@ public void mapSeqresRecords(Chain atomRes, Chain seqRes) {
private void alignNucleotideChains(Chain seqRes, Chain atomRes) {
- if ( atomRes.getAtomGroups(GroupType.NUCLEOTIDE).size() < 1) {
+ if (atomRes.getAtomGroups(GroupType.NUCLEOTIDE).isEmpty()) {
logger.debug("ATOM chain {} does not contain nucleotides, ignoring...", atomRes.getId());
return;
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/AbstractCifFileSupplier.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/AbstractCifFileSupplier.java
index 7e9d8ad7ac..6bf8af90ef 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/AbstractCifFileSupplier.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/AbstractCifFileSupplier.java
@@ -309,7 +309,8 @@ public void accept(WrappedAtom wrappedAtom) {
}
labelEntityId.add(entityId);
// see https://github.com/biojava/biojava/issues/1116
- if (chain.getEntityInfo().getType() == EntityType.POLYMER) {
+ // note the first condition is to safeguard and to have a default that writes labelSeqId if there's no knowledge about what's the entity type
+ if (chain.getEntityInfo()==null || chain.getEntityInfo().getType() == EntityType.POLYMER) {
labelSeqId.add(seqId);
} else {
labelSeqId.markNextNotPresent();
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifStructureConsumerImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifStructureConsumerImpl.java
index 67514edd84..03ebd027c6 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifStructureConsumerImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifStructureConsumerImpl.java
@@ -372,7 +372,7 @@ public void consumeAtomSite(AtomSite atomSite) {
private Group getAltLocGroup(String recordName, Character altLoc, Character oneLetterCode, String threeLetterCode,
long seqId) {
List atoms = currentGroup.getAtoms();
- if (atoms.size() > 0) {
+ if (!atoms.isEmpty()) {
if (atoms.get(0).getAltLoc().equals(altLoc)) {
return currentGroup;
}
@@ -381,7 +381,7 @@ private Group getAltLocGroup(String recordName, Character altLoc, Character oneL
List altLocs = currentGroup.getAltLocs();
for (Group altLocGroup : altLocs) {
atoms = altLocGroup.getAtoms();
- if (atoms.size() > 0) {
+ if (!atoms.isEmpty()) {
for (Atom a1 : atoms) {
if (a1.getAltLoc().equals(altLoc)) {
return altLocGroup;
@@ -1478,7 +1478,7 @@ private void setStructNcsOps() {
}
}
- if (ncsOperators.size() > 0) {
+ if (!ncsOperators.isEmpty()) {
structure.getCrystallographicInfo()
.setNcsOperators(ncsOperators.toArray(new Matrix4d[0]));
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java
index c2830c1685..865c9e0da4 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java
@@ -372,7 +372,7 @@ public void setInterGroupBond(int indOne, int indTwo, int bondOrder) {
private Group getCorrectAltLocGroup(Character altLoc) {
// see if we know this altLoc already;
List atoms = group.getAtoms();
- if (atoms.size() > 0) {
+ if (!atoms.isEmpty()) {
Atom a1 = atoms.get(0);
// we are just adding atoms to the current group
// probably there is a second group following later...
@@ -396,7 +396,7 @@ private Group getCorrectAltLocGroup(Character altLoc) {
}
// no matching altLoc group found.
// build it up.
- if (group.getAtoms().size() == 0) {
+ if (group.getAtoms().isEmpty()) {
return group;
}
Group altLocG = (Group) group.clone();
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java
index 7c359121de..8f76b2ae61 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BioAssemblyTools.java
@@ -55,7 +55,7 @@ public static boolean isUnaryExpression(String expression) {
if (first < 0 || last < 0) {
return true;
}
- return ! (first == 0 && last > first);
+ return first != 0 || last <= first;
}
public static List parseUnaryOperatorExpression(String operatorExpression) {
@@ -279,7 +279,7 @@ public static double[] getBiologicalMoleculeCentroid( final Structure asymUnit,
return centroid;
}
- if ( transformations.size() == 0) {
+ if ( transformations.isEmpty()) {
return Calc.getCentroid(atoms).getCoords();
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java
index c6ec6bc8ff..9edb8f404c 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyBuilder.java
@@ -205,7 +205,7 @@ private void addChainMultiModel(Structure s, Chain newChain, String transformId)
// multi-model bioassembly
- if ( modelIndex.size() == 0)
+ if (modelIndex.isEmpty())
modelIndex.add("PLACEHOLDER FOR ASYM UNIT");
int modelCount = modelIndex.indexOf(transformId);
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyTransformation.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyTransformation.java
index 36bccd7b39..ff1efd6e32 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyTransformation.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/quaternary/BiologicalAssemblyTransformation.java
@@ -226,7 +226,7 @@ public static BiologicalAssemblyTransformation fromXML(String xml)
List transformations = fromMultiXML(xml);
- if ( transformations.size() > 0)
+ if (!transformations.isEmpty())
return transformations.get(0);
else
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopInstallation.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopInstallation.java
index d092d5485e..4ac55cfa08 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopInstallation.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopInstallation.java
@@ -655,7 +655,7 @@ private List extractRanges(String range) {
}
protected void downloadClaFile() throws IOException{
- if(mirrors.size()<1) {
+ if(mirrors.isEmpty()) {
initScopURLs();
}
IOException exception = null;
@@ -676,7 +676,7 @@ protected void downloadClaFile() throws IOException{
}
protected void downloadDesFile() throws IOException{
- if(mirrors.size()<1) {
+ if(mirrors.isEmpty()) {
initScopURLs();
}
IOException exception = null;
@@ -697,7 +697,7 @@ protected void downloadDesFile() throws IOException{
}
protected void downloadHieFile() throws IOException{
- if(mirrors.size()<1) {
+ if(mirrors.isEmpty()) {
initScopURLs();
}
IOException exception = null;
@@ -719,7 +719,7 @@ protected void downloadHieFile() throws IOException{
}
protected void downloadComFile() throws IOException{
- if(mirrors.size()<1) {
+ if(mirrors.isEmpty()) {
initScopURLs();
}
IOException exception = null;
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucTools.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucTools.java
index 7732c04b80..42191d682d 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucTools.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucTools.java
@@ -57,7 +57,7 @@ public static List getSecStrucInfo(Structure s) {
Group g = iter.next();
if (g.hasAminoAtoms()) {
Object p = g.getProperty(Group.SEC_STRUC);
- if (!(p == null)) {
+ if (p != null) {
SecStrucInfo ss = (SecStrucInfo) p;
listSSI.add(ss);
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelicalRepeatUnit.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelicalRepeatUnit.java
index ff9c77cf13..cd16aa5f87 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelicalRepeatUnit.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelicalRepeatUnit.java
@@ -64,7 +64,7 @@ public Map getInteractingRepeatUnits() {
private void run() {
this.repeatUnitCenters = calcRepeatUnitCenters();
- if (this.repeatUnitCenters.size() == 0) {
+ if (this.repeatUnitCenters.isEmpty()) {
return;
}
this.repeatUnits = calcRepeatUnits();
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/PermutationGroup.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/PermutationGroup.java
index e1f4792410..b3ac53f385 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/PermutationGroup.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/PermutationGroup.java
@@ -65,7 +65,7 @@ public void completeGroup() {
Set> known = new HashSet<>(permutations);
//breadth-first search through the map of all members
List> currentLevel = new ArrayList<>(permutations);
- while( currentLevel.size() > 0) {
+ while(!currentLevel.isEmpty()) {
List> nextLevel = new ArrayList<>();
for( List p : currentLevel) {
for(List gen : gens) {
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetrySubunits.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetrySubunits.java
index b0bef7f1e6..7f434cabaf 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetrySubunits.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetrySubunits.java
@@ -211,7 +211,7 @@ public MomentsOfInertia getMomentsOfInertia() {
}
private void run() {
- if (centers.size() > 0) {
+ if (!centers.isEmpty()) {
return;
}
calcOriginalCenters();
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationGroup.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationGroup.java
index 70b69afe14..002d046e52 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationGroup.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationGroup.java
@@ -83,7 +83,7 @@ public void removeRotation(int index) {
public void complete() {
if (modified) {
- if (rotations.size() > 0) {
+ if (!rotations.isEmpty()) {
findHighestOrderAxis();
setEAxis();
calcAxesDirections();
@@ -98,7 +98,7 @@ public void complete() {
public String getPointGroup() {
if (modified) {
- if (rotations.size() == 0) {
+ if (rotations.isEmpty()) {
return "C1";
}
complete();
@@ -344,7 +344,7 @@ private void calcPointGroup() {
// when a structure is symmetric, some subunits are below the rmsd threshold,
// and some are just above the rmsd threshold
int n = 0;
- if (rotations.size() > 0) {
+ if (!rotations.isEmpty()) {
n = rotations.get(0).getPermutation().size();
rotations.clear();
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java
index 37a44be7ac..b1566a6d2f 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/RotationSolver.java
@@ -305,7 +305,7 @@ private boolean isSpherical() {
* @return null if invalid, or a rotation if valid
*/
private Rotation isValidPermutation(List permutation) {
- if (permutation.size() == 0) {
+ if (permutation.isEmpty()) {
return null;
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/SystematicSolver.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/SystematicSolver.java
index d13fa4db16..a449771b58 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/SystematicSolver.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/SystematicSolver.java
@@ -145,7 +145,7 @@ private void completeRotationGroup() {
}
private boolean isValidPermutation(List permutation) {
- if (permutation.size() == 0) {
+ if (permutation.isEmpty()) {
return false;
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/DistanceBox.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/DistanceBox.java
index 2d9b1d6dca..25d37693fb 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/DistanceBox.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/geometry/DistanceBox.java
@@ -166,7 +166,7 @@ private List getBoxTwo(long location) {
}
// ensure that boxTwo has no empty element by copying from tempBox of defined size
List boxTwo = null;
- if (tempBox.size() == 0) {
+ if (tempBox.isEmpty()) {
boxTwo = Collections.emptyList();
} else if (tempBox.size() == 1) {
boxTwo = Collections.singletonList(tempBox.get(0));
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java
index a6ad226698..0d52e92fef 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SequenceFunctionRefiner.java
@@ -79,7 +79,7 @@ public static AFPChain refineSymmetry(AFPChain afpChain, Atom[] ca1, Atom[] ca2,
// Refine the alignment Map
Map refined = refineSymmetry(alignment, k);
- if (refined.size() < 1)
+ if (refined.isEmpty())
throw new RefinerFailedException("Refiner returned empty alignment");
//Substitute and partition the alignment
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java
index d03e90080f..627908ac8b 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java
@@ -392,10 +392,7 @@ private boolean checkGaps() {
length--;
}
- if (shrinkColumns.size() != 0)
- return true;
- else
- return false;
+ return !shrinkColumns.isEmpty();
}
/**
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/BlastClustReader.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/BlastClustReader.java
index b2b3298157..5d1faa8754 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/BlastClustReader.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/utils/BlastClustReader.java
@@ -140,7 +140,7 @@ public List> getChainIdsInEntry(String pdbId) {
private void loadClusters(int sequenceIdentity) {
// load clusters only once
- if (clusters.size() > 0) {
+ if (!clusters.isEmpty()) {
return;
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java
index cff84c70f8..852d213bb9 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/SpaceGroup.java
@@ -645,10 +645,10 @@ public List getTransfAlgebraic() {
public void setTransfAlgebraic(List transfAlgebraic) {
//System.out.println("setting transfAlgebraic " + transfAlgebraic);
- if ( transformations == null || transformations.size() == 0)
+ if ( transformations == null || transformations.isEmpty())
transformations = new ArrayList(transfAlgebraic.size());
- if ( this.transfAlgebraic == null || this.transfAlgebraic.size() == 0)
+ if ( this.transfAlgebraic == null || this.transfAlgebraic.isEmpty())
this.transfAlgebraic = new ArrayList<>(transfAlgebraic.size());
for ( String transf : transfAlgebraic){
diff --git a/biojava-structure/src/test/java/org/biojava/nbio/structure/align/util/AtomCacheTest.java b/biojava-structure/src/test/java/org/biojava/nbio/structure/align/util/AtomCacheTest.java
index 073a679dbb..f2f06ed2f5 100644
--- a/biojava-structure/src/test/java/org/biojava/nbio/structure/align/util/AtomCacheTest.java
+++ b/biojava-structure/src/test/java/org/biojava/nbio/structure/align/util/AtomCacheTest.java
@@ -24,6 +24,7 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;
import java.io.File;
@@ -408,7 +409,7 @@ public void testEmptyChemComp() throws IOException, StructureException {
// should be unknown
ChemComp chem = g.getChemComp();
assertNotNull(chem);
- assertTrue(chem.getAtoms().size() > 0);
+ assertFalse(chem.getAtoms().isEmpty());
assertEquals("NON-POLYMER", chem.getType());
} finally {
FileDownloadUtils.deleteDirectory(tmpCache);
@@ -471,7 +472,7 @@ public void testEmptyGZChemComp() throws IOException, StructureException {
// should be unknown
ChemComp chem = g.getChemComp();
assertNotNull(chem);
- assertTrue(chem.getAtoms().size() > 0);
+ assertFalse(chem.getAtoms().isEmpty());
assertEquals("NON-POLYMER", chem.getType());
} finally {
FileDownloadUtils.deleteDirectory(tmpCache);
diff --git a/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestHeaderOnly.java b/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestHeaderOnly.java
index d3c9568240..f579752d4c 100644
--- a/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestHeaderOnly.java
+++ b/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestHeaderOnly.java
@@ -205,8 +205,7 @@ public boolean doSeqResHaveAtoms(Structure s) {
* @return true if has any Atom(s)
*/
public boolean hasAtoms(Group g) {
- if (g.getAtoms().size() > 0) return true;
- return false;
+ return !g.getAtoms().isEmpty();
}
/**
diff --git a/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestMMcifOrganismParsing.java b/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestMMcifOrganismParsing.java
index 8d018f6c0a..2cbdbca679 100644
--- a/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestMMcifOrganismParsing.java
+++ b/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestMMcifOrganismParsing.java
@@ -37,7 +37,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
public class TestMMcifOrganismParsing {
@@ -90,7 +90,7 @@ private void checkPDB(String pdbId, String organismTaxId) throws IOException, St
Structure s = StructureIO.getStructure(pdbId);
assertNotNull(s.getEntityInfos());
- assertTrue(s.getEntityInfos().size() > 0);
+ assertFalse(s.getEntityInfos().isEmpty());
for ( EntityInfo c : s.getEntityInfos()) {
if(EntityType.POLYMER.equals(c.getType())) {
diff --git a/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestSiftsParsing.java b/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestSiftsParsing.java
index 6a9f6ae93c..2b99d660d8 100644
--- a/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestSiftsParsing.java
+++ b/biojava-structure/src/test/java/org/biojava/nbio/structure/io/TestSiftsParsing.java
@@ -47,9 +47,9 @@ public void test4DIA() throws Exception {
for (SiftsEntity e : entities) {
//System.out.println(e.getEntityId() + " " +e.getType());
- Assert.assertTrue(e.getSegments().size() > 0);
+ Assert.assertFalse(e.getSegments().isEmpty());
for (SiftsSegment seg : e.getSegments()) {
- Assert.assertTrue(seg.getResidues().size() > 0);
+ Assert.assertFalse(seg.getResidues().isEmpty());
for (SiftsResidue res : seg.getResidues()) {
@@ -78,9 +78,9 @@ public void test4jn3() throws Exception {
for (SiftsEntity e : entities) {
//System.out.println(e.getEntityId() + " " +e.getType());
- Assert.assertTrue(e.getSegments().size() > 0);
+ Assert.assertFalse(e.getSegments().isEmpty());
for (SiftsSegment seg : e.getSegments()) {
- Assert.assertTrue(seg.getResidues().size() > 0);
+ Assert.assertFalse(seg.getResidues().isEmpty());
//System.out.println(seg.getResidues().size());
//System.out.println(" Segment: " + seg.getSegId() + " " + seg.getStart() + " " + seg.getEnd()) ;
@@ -125,7 +125,7 @@ public void test4DOU() throws Exception {
//assertTrue(seg1.getResidues().size() == 17);
for (SiftsSegment seg : e.getSegments()) {
- Assert.assertTrue(seg.getResidues().size() > 0);
+ Assert.assertFalse(seg.getResidues().isEmpty());
//System.out.println(" Segment: " + seg.getSegId() + " " + seg.getStart() + " " + seg.getEnd() + " res. size: " + seg.getResidues().size()) ;
@@ -175,7 +175,7 @@ public void test4O6W() throws Exception {
//System.out.println(" Segment: " + seg1.getSegId() + " " + seg1.getStart() + " " + seg1.getEnd() + " res. size: " + seg1.getResidues().size());
//assertTrue(seg1.getResidues().size() == 17);
- Assert.assertTrue(seg.getResidues().size() > 0);
+ Assert.assertFalse(seg.getResidues().isEmpty());
for (SiftsResidue res : seg.getResidues()) {
diff --git a/biojava-structure/src/test/java/org/biojava/nbio/structure/io/cif/CifFileConsumerImplTest.java b/biojava-structure/src/test/java/org/biojava/nbio/structure/io/cif/CifFileConsumerImplTest.java
index a8925afa88..8fbd1060b0 100644
--- a/biojava-structure/src/test/java/org/biojava/nbio/structure/io/cif/CifFileConsumerImplTest.java
+++ b/biojava-structure/src/test/java/org/biojava/nbio/structure/io/cif/CifFileConsumerImplTest.java
@@ -147,7 +147,7 @@ public void testWaterOnlyChainCif() throws IOException {
Chain c = s2.getWaterChainByPDB("F");
assertNotNull("Got null when looking for water-only chain with author id F", c);
- assertTrue(c.getAtomGroups().size() > 0);
+ assertFalse(c.getAtomGroups().isEmpty());
// checking that compounds are linked
assertNotNull(c.getEntityInfo());
@@ -157,7 +157,7 @@ public void testWaterOnlyChainCif() throws IOException {
Chain cAsymId = s2.getWaterChain("E");
assertNotNull("Got null when looking for water-only chain with asym id E", cAsymId);
- assertTrue(cAsymId.getAtomGroups().size() > 0);
+ assertFalse(cAsymId.getAtomGroups().isEmpty());
assertSame(c, cAsymId);
}
diff --git a/biojava-survival/pom.xml b/biojava-survival/pom.xml
index a1facab532..a8c8616fa1 100644
--- a/biojava-survival/pom.xml
+++ b/biojava-survival/pom.xml
@@ -4,7 +4,7 @@
org.biojava
biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava-survival
diff --git a/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/CoxInfo.java b/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/CoxInfo.java
index c9f4f18056..eebdaf86ba 100644
--- a/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/CoxInfo.java
+++ b/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/CoxInfo.java
@@ -32,7 +32,7 @@
/**
* Holds the results of a cox analysis where calling dump(), toString() will give an output similar to R
- * @author Scooter Willis
+ * @author Scooter Willis
*/
public class CoxInfo {
@@ -505,7 +505,7 @@ public String toString(String beginLine, String del, String endLine) {
o = o + beginLine + endLine;
- if (baselineSurvivorFunction.size() > 0) {
+ if (!baselineSurvivorFunction.isEmpty()) {
o = o + beginLine + "Baseline Survivor Function (at predictor means)" + endLine;
for (Double time : baselineSurvivorFunction.keySet()) {
Double mean = baselineSurvivorFunction.get(time);
diff --git a/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/ResidualsCoxph.java b/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/ResidualsCoxph.java
index 42b34905cc..955a7c1f6d 100644
--- a/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/ResidualsCoxph.java
+++ b/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/ResidualsCoxph.java
@@ -29,7 +29,7 @@
/**
*
- * @author Scooter Willis
+ * @author Scooter Willis
*/
public class ResidualsCoxph {
@@ -108,7 +108,7 @@ public static double[][] process(CoxInfo ci, Type type, boolean useWeighted, Arr
double[] weighted = ci.getWeighted();
rr = Matrix.scale(rr, weighted);
}
- if (cluster != null && cluster.size() > 0) {
+ if (cluster != null && !cluster.isEmpty()) {
rr = rowsum(rr, cluster);
}
diff --git a/biojava-survival/src/main/java/org/biojava/nbio/survival/data/WorkSheet.java b/biojava-survival/src/main/java/org/biojava/nbio/survival/data/WorkSheet.java
index 542085942e..17ed18419a 100644
--- a/biojava-survival/src/main/java/org/biojava/nbio/survival/data/WorkSheet.java
+++ b/biojava-survival/src/main/java/org/biojava/nbio/survival/data/WorkSheet.java
@@ -27,7 +27,7 @@
* Need to handle very large spreadsheets of expression data so keep memory
* footprint low
*
- * @author Scooter Willis
+ * @author Scooter Willis
*/
public class WorkSheet {
@@ -1391,7 +1391,7 @@ static public WorkSheet unionWorkSheetsRowJoin(WorkSheet w1, WorkSheet w2, boole
ArrayList joinedColumns = new ArrayList<>();
joinedColumns.addAll(w1DataColumns);
joinedColumns.addAll(w2DataColumns);
- if (!joinedColumns.contains("META_DATA") && (w1MetaDataColumns.size() > 0 || w2MetaDataColumns.size() > 0)) {
+ if (!joinedColumns.contains("META_DATA") && (!w1MetaDataColumns.isEmpty() || !w2MetaDataColumns.isEmpty())) {
joinedColumns.add("META_DATA");
}
for (String column : w1MetaDataColumns) {
diff --git a/biojava-survival/src/main/java/org/biojava/nbio/survival/kaplanmeier/figure/NumbersAtRiskPanel.java b/biojava-survival/src/main/java/org/biojava/nbio/survival/kaplanmeier/figure/NumbersAtRiskPanel.java
index c4578f1c8b..144942a809 100644
--- a/biojava-survival/src/main/java/org/biojava/nbio/survival/kaplanmeier/figure/NumbersAtRiskPanel.java
+++ b/biojava-survival/src/main/java/org/biojava/nbio/survival/kaplanmeier/figure/NumbersAtRiskPanel.java
@@ -76,7 +76,7 @@ private void paintTable(Graphics g) {
sfiHashMap = sfi.getStrataInfoHashMap();
}
- if(sfiHashMap.size() == 0)
+ if(sfiHashMap.isEmpty())
return;
//int height = this.getHeight();
diff --git a/biojava-ws/pom.xml b/biojava-ws/pom.xml
index 23866ccbb1..eafd87dff8 100644
--- a/biojava-ws/pom.xml
+++ b/biojava-ws/pom.xml
@@ -3,7 +3,7 @@
biojava
org.biojava
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava-ws
biojava-ws
@@ -19,7 +19,7 @@
org.biojava
biojava-core
- 7.2.3
+ 7.2.6-SNAPSHOT
compile
diff --git a/biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/HmmerResult.java b/biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/HmmerResult.java
index 3304e78d4f..373b78cd0a 100644
--- a/biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/HmmerResult.java
+++ b/biojava-ws/src/main/java/org/biojava/nbio/ws/hmmer/HmmerResult.java
@@ -140,7 +140,7 @@ public int compareTo(HmmerResult o) {
return(me.getSqFrom().compareTo(other.getSqFrom()));
}
private boolean emptyDomains(HmmerResult o) {
- if ( o.getDomains() == null || o.getDomains().size() == 0)
+ if ( o.getDomains() == null || o.getDomains().isEmpty())
return true;
return false;
}
diff --git a/pom.xml b/pom.xml
index c4dfdd3b74..9fae069ae0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
org.biojava
biojava
pom
- 7.2.3
+ 7.2.6-SNAPSHOT
biojava
BioJava is an open-source project dedicated to providing a Java framework for processing biological
data. It provides analytical and statistical routines, parsers for common file formats and allows the
@@ -41,7 +41,7 @@
512M
1.0.11
2.0.12
- 2.23.1
+ 2.25.4
5.10.1
ciftools-java
7.0.1
@@ -51,7 +51,7 @@
scm:git:git@github.com:biojava/biojava.git
https://github.com/biojava/biojava
- biojava-7.2.3
+ HEAD