Pull Request №762 RosettaCommons/rosetta/main ← lyskov-ai/rosetta/fix/duplicated-copy-paste-conditions
Merge: 0c38201cdcd83a9217d947a1604b4317f71c6831←0fbeb47e0091638e54288b68e9ee0de2c22c7224
Fix copy/paste bugs in duplicated conditions
----------------
Merge commit message:
Fix copy/paste bugs in duplicated conditions
Each of these tests the same operand twice in one condition or if/else
chain, so a sibling operand is never tested and part of the check is dead.
Behaviour fixes:
* CartesianBondedEnergy: the torsion ring-atom test checked atids[2]
twice and never atids[4], so 4-atom ring torsions were not always
handed off to cart_bonded_ring.
* chemical/rna/util: in the SUGAR/SUGAR CIS base-pair table the guanine
row was labelled `aa1 == na_rad`, which the adenine row above already
matches. All four guanine branches were unreachable. They push " H22",
an atom only RGU has (RAD has " H2 "), and na_rgu was the one row
missing from the otherwise complete 4x4 table.
* DisulfideOptimizationMover: the "both residues are disulfide bonded"
check tested cys_pos[1] twice, so cys_pos[2] was never validated.
* DofUnlock: the environment-id half of the passport check compared
pass_out to itself instead of to pass_, so a mismatched environment id
was never caught.
* RotamerRecovery: runtime_assert compared pose_rots.size() to itself
instead of to nat_rots.size().
* FloppyTailMover: flexible_chain appeared twice in the list of options
that conflict with an explicit movemap, so flexible_start_resnum was
never rejected. The error message had the same duplication.
Behaviour-preserving removals of dead duplicate conditions:
* cryst/wallpaper: "C211" listed twice among the tetragonal groups.
* CDRSeqDesignOptions: "DISALLOWED" listed twice.
* SecretionPredictionFilter, SecretionOptimizationMover: the dG_ins
threshold comparison repeated in the same && chain.
Found with a new redundant-expression / branch-clone analysis pass over
utility/, basic/, core/, protocols/ and numeric/; utility/, basic/ and
numeric/ had no true positives.