-
Notifications
You must be signed in to change notification settings - Fork 397
Closed
Labels
bugBugs and bugfixesBugs and bugfixesquestionOpen discussions about the libraryOpen discussions about the library
Description
In SymmetryTools.divideStructures we create a new StructureImpl and immediately call getChain() on it. In 5.1.1 this causes an IndexOutOfBounds because no models have been created.
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657) ~[?:1.8.0_192]
at java.util.ArrayList.get(ArrayList.java:433) ~[?:1.8.0_192]
at org.biojava.nbio.structure.StructureImpl.getModel(StructureImpl.java:650) ~[classes/:?]
at org.biojava.nbio.structure.StructureImpl.getChains(StructureImpl.java:572) ~[classes/:?]
at org.biojava.nbio.structure.StructureImpl.getChain(StructureImpl.java:671) ~[classes/:?]
at org.biojava.nbio.structure.StructureTools.addGroupToStructure(StructureTools.java:536) ~[classes/:?]
at org.biojava.nbio.structure.symmetry.utils.SymmetryTools.divideStructure(SymmetryTools.java:537) ~[classes/:?]
at org.biojava.nbio.structure.symmetry.utils.SymmetryTools.toRepeatsAlignment(SymmetryTools.java:611) ~[classes/:?]
at org.biojava.nbio.structure.symmetry.utils.SymmetryTools.getQuaternarySymmetry(SymmetryTools.java:708) ~[classes/:?]
at org.biojava.nbio.structure.symmetry.gui.SymmetryDisplay.printSymmetryGroup(SymmetryDisplay.java:272) ~[classes/:?]
at org.biojava.nbio.structure.symmetry.gui.SymmetryDisplay.display(SymmetryDisplay.java:134) ~[classes/:?]
at workers.CeSymmWorker.run(CeSymmWorker.java:85) [classes/:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_192]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_192]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_192]
How do we want to handle this?
- The exception is expected. Users should use
s.addModel(new ArrayList<Chain>())when they create a new structure - All models are implicitly created for each structure. Modify
getModelso that it creates empty models when called for a model not on the current model list - Create model 0 automatically when the structure is instanciated
Metadata
Metadata
Assignees
Labels
bugBugs and bugfixesBugs and bugfixesquestionOpen discussions about the libraryOpen discussions about the library