diff --git a/biojava-aa-prop/src/test/java/org/biojava/nbio/aaproperties/xml/AminoAcidTest.java b/biojava-aa-prop/src/test/java/org/biojava/nbio/aaproperties/xml/AminoAcidTest.java
index 6bd84bae58..a1f5b35539 100644
--- a/biojava-aa-prop/src/test/java/org/biojava/nbio/aaproperties/xml/AminoAcidTest.java
+++ b/biojava-aa-prop/src/test/java/org/biojava/nbio/aaproperties/xml/AminoAcidTest.java
@@ -20,19 +20,24 @@
*/
package org.biojava.nbio.aaproperties.xml;
-import org.biojava.nbio.aaproperties.PeptideProperties;
-import org.biojava.nbio.aaproperties.xml.*;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-import static org.junit.Assert.assertEquals;
+import org.biojava.nbio.aaproperties.PeptideProperties;
+import org.junit.Test;
public class AminoAcidTest {
diff --git a/biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/GenbankCookbookTest.java b/biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/GenbankCookbookTest.java
index 3af19947dd..a9d5f337ac 100644
--- a/biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/GenbankCookbookTest.java
+++ b/biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/GenbankCookbookTest.java
@@ -24,6 +24,8 @@
*/
package org.biojava.nbio.core.sequence.io;
+import java.util.LinkedHashMap;
+
import org.biojava.nbio.core.sequence.DNASequence;
import org.biojava.nbio.core.sequence.ProteinSequence;
import org.biojava.nbio.core.sequence.compound.AminoAcidCompound;
@@ -32,14 +34,14 @@
import org.biojava.nbio.core.sequence.compound.NucleotideCompound;
import org.biojava.nbio.core.sequence.io.util.ClasspathResource;
import org.biojava.nbio.core.sequence.loader.GenbankProxySequenceReader;
-import org.junit.*;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.LinkedHashMap;
-
/**
*
* @author Scooter Willis
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/AminoAcidImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/AminoAcidImpl.java
index 32b7a2735e..42535ef5b8 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/AminoAcidImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/AminoAcidImpl.java
@@ -180,7 +180,7 @@ public void setPDBName(String s) {
* @return and identical copy of this Group object
*/
@Override
- public Object clone() {
+ public AminoAcidImpl clone() {
AminoAcidImpl n = new AminoAcidImpl();
n.setPDBFlag(has3D());
@@ -193,7 +193,7 @@ public Object clone() {
// copy the atoms
for (Atom atom1 : atoms) {
- Atom atom = (Atom) atom1.clone();
+ Atom atom = atom1.clone();
n.addAtom(atom);
atom.setGroup(n);
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/Atom.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/Atom.java
index 2716b2e1e0..8a2804080e 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/Atom.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/Atom.java
@@ -187,7 +187,7 @@ public interface Atom extends Cloneable, PDBRecord {
* Return an identical copy of this object .
* @return an identical copy of this object
*/
- public Object clone();
+ public Atom clone();
/**
* Set the back-reference to its parent Group.
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomImpl.java
index 1c72526d34..03799b131b 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomImpl.java
@@ -189,7 +189,7 @@ public String toString() {
* @return and identical copy of this object
*/
@Override
- public Object clone() {
+ public Atom clone() {
AtomImpl n = new AtomImpl();
n.setOccupancy(getOccupancy());
n.setTempFactor(getTempFactor());
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java
index caaedff525..9148e0702d 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/Calc.java
@@ -574,7 +574,7 @@ public static final void plus(Structure s, Matrix matrix){
} catch (Exception e){
logger.error("Exception: ", e);
}
- oldAtom = (Atom)atom.clone();
+ oldAtom = atom.clone();
double x = atom.getX();
double y = atom.getY() ;
@@ -596,7 +596,7 @@ public static final void plus(Structure s, Matrix matrix){
} catch (Exception e){
logger.error("Exception: ", e);
}
- rotOldAtom = (Atom) atom.clone();
+ rotOldAtom = atom.clone();
}
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/Chain.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/Chain.java
index 4d88e1c57b..95dce522f4 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/Chain.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/Chain.java
@@ -51,7 +51,7 @@ public interface Chain {
/** returns an identical copy of this Chain.
* @return an identical copy of this Chain
*/
- public Object clone();
+ public Chain clone();
/** add a group to the list of ATOM record group of this chain.
* To add SEQRES records a more complex alignment between ATOM and SEQRES residues
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java
index de13083b2c..8ac3b56256 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java
@@ -128,7 +128,7 @@ public Structure getParent() {
* @return an identical copy of this Chain
*/
@Override
- public Object clone() {
+ public ChainImpl clone() {
// go through all groups and add to new Chain.
ChainImpl n = new ChainImpl();
// copy chain data:
@@ -143,7 +143,7 @@ public Object clone() {
n.setInternalChainID(internalChainID);
for (Group group : groups) {
- Group g = (Group) group.clone();
+ Group g = group.clone();
n.addGroup(g);
g.setChain(n);
}
@@ -155,7 +155,7 @@ public Object clone() {
List tmpSeqRes = new ArrayList();
for (Group seqResGroup : seqResGroups) {
- Group g = (Group) seqResGroup.clone();
+ Group g = seqResGroup.clone();
g.setChain(n);
tmpSeqRes.add(g);
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/Group.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/Group.java
index 0b8d2d4425..51a03abb95 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/Group.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/Group.java
@@ -221,7 +221,7 @@ public interface Group {
/** returns and identical copy of this Group object .
* @return and identical copy of this Group object
*/
- public Object clone();
+ public Group clone();
/**
* Sets the back-reference to its parent Chain.
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java
index b072667bb9..faa566cac4 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java
@@ -329,7 +329,7 @@ public Iterator iterator() {
* @return and identical copy of this Group object
*/
@Override
- public Object clone() {
+ public HetatomImpl clone() {
HetatomImpl n = new HetatomImpl();
n.setPDBFlag(has3D());
@@ -339,7 +339,7 @@ public Object clone() {
// copy the atoms
for (Atom atom1 : atoms) {
- Atom atom = (Atom) atom1.clone();
+ Atom atom = atom1.clone();
n.addAtom(atom);
atom.setGroup(n);
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/NucleotideImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/NucleotideImpl.java
index 4d9f7022db..f77540663d 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/NucleotideImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/NucleotideImpl.java
@@ -95,7 +95,7 @@ public Atom getP() {
}
@Override
- public Object clone(){
+ public NucleotideImpl clone(){
NucleotideImpl n = new NucleotideImpl();
n.setPDBFlag(has3D());
@@ -105,7 +105,7 @@ public Object clone(){
// copy the atoms
for (Atom atom1 : atoms) {
- Atom atom = (Atom) atom1.clone();
+ Atom atom = atom1.clone();
n.addAtom(atom);
atom.setGroup(n);
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java
index c9581544a7..497dd0e692 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureImpl.java
@@ -152,7 +152,7 @@ public Structure clone() {
for (int j=0;j idxlist, int p2i, int p
ftmp.add(p2i,p2j,0,l2);
Atom[] a3 = new Atom[a2.length];
for (int i=0;i < a2.length;i++){
- a3[i] = (Atom)a2[i].clone();
+ a3[i] = a2[i].clone();
}
return getRMS(a1,a3,ftmp);
}
@@ -363,7 +363,7 @@ public JointFragments[] frag_pairwise_compat(FragmentPair[] fraglst, int angleDi
FragmentPair[] tmpfidx = new FragmentPair[fraglst.length];
for ( int i=0 ; i < fraglst.length; i++){
- tmpfidx[i] = (FragmentPair)fraglst[i].clone();
+ tmpfidx[i] = fraglst[i].clone();
}
int n = tmpfidx.length;
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentPair.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentPair.java
index d786bce863..b5237da289 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentPair.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentPair.java
@@ -83,14 +83,14 @@ public FragmentPair(int length, int p1, int p2) {
}
@Override
- public Object clone(){
+ public FragmentPair clone(){
FragmentPair n = new FragmentPair(length,pos1,pos2);
if ( center1 !=null)
- n.setCenter1((Atom)center1.clone());
+ n.setCenter1(center1.clone());
if ( center2 != null)
- n.setCenter2((Atom)center2.clone());
+ n.setCenter2(center2.clone());
n.setCluster(cluster);
n.setContacts(contacts);
@@ -98,7 +98,7 @@ public Object clone(){
n.setRms(rms);
n.setLength(length);
n.setRot((Matrix)rot.clone());
- n.setUnitv((Atom)unitv.clone());
+ n.setUnitv(unitv.clone());
return n;
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/Gotoh.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/Gotoh.java
index aec0a3d2fd..b85d9ff10d 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/Gotoh.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/Gotoh.java
@@ -269,7 +269,7 @@ private void setPath(){
// switch order
IndexPair[] newpath = new IndexPair[pathsize];
for (int i = 0 ; i < pathsize; i++){
- IndexPair o = (IndexPair)path.get(pathsize-1-i);
+ IndexPair o = path.get(pathsize-1-i);
IndexPair np = new IndexPair((short)(o.getRow()-1),(short)(o.getCol()-1));
newpath[i] = np;
}
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AFPChainScorer.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AFPChainScorer.java
index ff305f568d..3ea72e8dbc 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AFPChainScorer.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AFPChainScorer.java
@@ -63,7 +63,7 @@ public static double getTMScore(AFPChain align, Atom[] ca1, Atom[] ca2) throws
int pos1 = optAln[block][0][i];
int pos2 = optAln[block][1][i];
Atom a1 = ca1[pos1];
- Atom a2 = (Atom) ca2[pos2].clone();
+ Atom a2 = ca2[pos2].clone();
ca1aligned[pos] = a1;
ca2aligned[pos] = a2;
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 281bb646d7..66821a05eb 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
@@ -760,7 +760,7 @@ public static AFPChain replaceOptAln(AFPChain afpChain, Atom[] ca1, Atom[] ca2,
}
//set everything
- AFPChain refinedAFP = (AFPChain) afpChain.clone();
+ AFPChain refinedAFP = afpChain.clone();
refinedAFP.setOptLength(optLength);
refinedAFP.setBlockSize(optLens);
refinedAFP.setOptLen(optLens);
@@ -820,7 +820,7 @@ public static void updateSuperposition(AFPChain afpChain, Atom[] ca1, Atom[] ca2
int pos1 = optAln[block][0][i];
int pos2 = optAln[block][1][i];
Atom a1 = ca1[pos1];
- Atom a2 = (Atom) ca2[pos2].clone();
+ Atom a2 = ca2[pos2].clone();
ca1aligned[pos] = a1;
ca2aligned[pos] = a2;
pos++;
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java
index 6983738b05..447a644e46 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java
@@ -145,7 +145,7 @@ public RotationAxis(AFPChain afpChain) throws StructureException {
*/
public RotationAxis(Atom axis, Atom pos, double theta) {
this.rotationAxis = Calc.unitVector(axis);
- this.rotationPos = (Atom) pos.clone();
+ this.rotationPos = pos.clone();
this.theta = theta;
this.screwTranslation = new AtomImpl(); //zero
this.otherTranslation = null; //deprecated
@@ -408,9 +408,9 @@ public String getJmolScript(Atom[] atoms){
}
// Find end points of the rotation axis to display
- Atom axisMin = (Atom) axialPt.clone();
+ Atom axisMin = axialPt.clone();
Calc.scaleAdd(min, rotationAxis, axisMin);
- Atom axisMax = (Atom) axialPt.clone();
+ Atom axisMax = axialPt.clone();
Calc.scaleAdd(max, rotationAxis, axisMax);
StringWriter result = new StringWriter();
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 e894b18cb7..0c441242e4 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
@@ -2029,7 +2029,7 @@ private Group getCorrectAltLocGroup( Character altLoc,
return current_group;
}
//System.out.println("cloning current group " + current_group + " " + current_group.getAtoms().get(0).getAltLoc() + " altLoc " + altLoc);
- Group altLocG = (Group) current_group.clone();
+ Group altLocG = current_group.clone();
// drop atoms from cloned group...
// https://redmine.open-bio.org/issues/3307
altLocG.setAtoms(new ArrayList());
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java
index df9d0636df..da6e244387 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java
@@ -524,7 +524,7 @@ private Group getCorrectAltLocGroup( Character altLoc,
return current_group;
}
//System.out.println("cloning current group " + current_group + " " + current_group.getAtoms().get(0).getAltLoc() + " altLoc " + altLoc);
- Group altLocG = (Group) current_group.clone();
+ Group altLocG = current_group.clone();
// drop atoms from cloned group...
// https://redmine.open-bio.org/issues/3307
altLocG.setAtoms(new ArrayList());
@@ -602,7 +602,7 @@ public void documentEnd() {
asymId2entityId.put(asym.getId(), asym.getEntity_id());
Chain s = getEntityChain(asym.getEntity_id());
- Chain seqres = (Chain)s.clone();
+ Chain seqres = s.clone();
// to solve issue #160 (e.g. 3u7t)
seqres = removeSeqResHeterogeneity(seqres);
seqres.setChainID(asym.getId());
@@ -940,7 +940,7 @@ private void alignSeqRes() {
// we need to first clone the seqres so that they stay independent for different models
List seqResGroups = new ArrayList();
for (int i=0;i ((QuatSymmetryParameters) parameters).getLocalTimeLimit()) {
+ if (time > parameters.getLocalTimeLimit()) {
System.out.println("Warning: QuatSymmetryDetector: Exceeded time limit for local symmetry calculations: " + time +
" seconds. Results may be incomplete");
break;
diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java
index b6a059ecdb..d9b8f7e25f 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java
@@ -320,7 +320,7 @@ private void calcInterfacesCrystal(StructureInterfaceList set, double cutoff) {
if (n==0 && a==0 && b==0 && c==0) {
chainj = structure.getChain(j);
} else {
- chainj = (Chain)structure.getChain(j).clone();
+ chainj = structure.getChain(j).clone();
Matrix4d m = new Matrix4d(ops[n]);
translate(m, transOrth);
Calc.transform(chainj,m);
diff --git a/biojava-structure/src/test/java/org/biojava/nbio/structure/TestStructureCrossReferences.java b/biojava-structure/src/test/java/org/biojava/nbio/structure/TestStructureCrossReferences.java
index 2c0dc9e10c..737b2cb833 100644
--- a/biojava-structure/src/test/java/org/biojava/nbio/structure/TestStructureCrossReferences.java
+++ b/biojava-structure/src/test/java/org/biojava/nbio/structure/TestStructureCrossReferences.java
@@ -165,7 +165,7 @@ private void doFullTest(Structure structure) throws StructureException {
System.out.println("Testing references of chain clones");
for (Chain c:structure.getChains()) {
- Chain clonedChain = (Chain) c.clone();
+ Chain clonedChain = c.clone();
testChainRefs(clonedChain);
}