Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

MultipleAlignmentJmol modifies state, causing NullPointerException #817

Open

Description

@sbliven

I get a NullPointerException when running the following code:

String pdb = "4i4q";
Structure s = StructureTools.getStructure(pdb);
assertNotNull(s);

Atom[] atoms = StructureTools.getRepresentativeAtomArray(s);
assertNotNull(atoms);
assertEquals(146, atoms.length);

CeSymmResult result = CeSymm.analyze(atoms);

MultipleAlignment msa = result.getMultipleAlignment();
List<Atom[]> msaAtoms = msa.getAtomArrays();

// Commenting our this line fixes the error below
new MultipleAlignmentJmol(msa, msaAtoms);

// Throws NPE
SymmetryTools.divideStructure(result);

Stack trace:

Exception in thread "main" java.lang.NullPointerException
	at org.biojava.nbio.structure.StructureTools.addGroupToStructure(StructureTools.java:547)
	at org.biojava.nbio.structure.symmetry.utils.SymmetryTools.divideStructure(SymmetryTools.java:538)
	at main.TestSymmetryDisplay.main(TestSymmetryDisplay.java:53)

The weird thing is that the error goes away if I don't create the MultipleAlignmentJmol instance. We must be modifying the CESymmResult state in a way that breaks divideStructure.

Note that this blocks moving CE-Symm to BioJava 5

Activity

  1. josemduarte commented on Dec 31, 2018

    @josemduarte
    Contributor

    A bug in cloning perhaps?

  2. added a commit that references this issue on Jan 1, 2019
    686728d
  3. sbliven commented on Jan 1, 2019

    @sbliven
    MemberAuthor

    I've fixed the NPE, but I'm still a bit concerned about MultipleAlignmentJmol modifying stuff. I'm not sure if I have time to track this bug down though.

  4. sbliven commented on Jan 7, 2019

    @sbliven
    MemberAuthor

    Reopening for potential cloning bug

  5. reopened this on Jan 7, 2019
  6. added a commit that references this issue on Jan 7, 2019
  7. sbliven commented on Jan 7, 2019

    @sbliven
    MemberAuthor

    I have a test for this issue in my fix817 branch (83f2b38). Basically, creating MultipleAlignmentJmol results in all atoms having null EntityInfo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBugs and bugfixes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions