Clean some deprecated classes/methods usages in htsjdk #707

Merged
merged 8 commits into from Nov 30, 2016

Conversation

Projects
None yet
3 participants
Contributor

magicDGS commented Sep 16, 2016 edited

Description

I explore some of the deprecated classes/methods when cleaning some of my own code, and I found that there are usages of some of this methods in other parts of htsjdk. This is a PR to clean the usages and to ask for removal of some deprecated classes/methods no longer used. This includes:

  • Fixes #330 Already fixed in other PR
  • Changed all Feature.getChr() to Feature.getContig() usages in htsjdk.
  • Remove SRAAccession.isSupported() usages in the tests and change for the recomended one.
  • Annotating some deprecated methods with @Deprecated and /** @deprecated */
  • Adding javadoc {@link } for pointing to new/correct usage.
  • Asking for removal of classes and methods for different packages, including gelitext support, VariantContextWriterFactory and others. Edited: open a PR for removal and discussion.

I divided the PR in several commits according to common changes, to make it easier to review. I think that this will help in the maintenance of the htsjdk library. If the removal of some classes is made effective, this will break compatibility with previous versions.

Checklist

  • Code compiles correctly
  • New tests covering changes and new functionality
  • All tests passing
  • Extended the README / documentation, if necessary
  • Is not backward compatible (breaks binary or source compatibility)

coveralls commented Sep 16, 2016 edited

Coverage Status

Coverage decreased (-0.01%) to 68.972% when pulling ce165b1 on magicDGS:dgs_clean_deprecation into 0e6edc7 on samtools:master.

Coverage Status

Coverage increased (+0.05%) to 69.05% when pulling 2abdf2f on magicDGS:dgs_clean_deprecation into fbba536 on samtools:master.

magicDGS changed the title from Clean some deprecated classes/methos usages in htsjdk to Clean some deprecated classes/methods usages in htsjdk Sep 21, 2016

Contributor

magicDGS commented Sep 21, 2016

Could you have a look, @lbergelson? I'm pinging you because you were working on deprecated classes/methods in #698 and #699.

Coverage Status

Coverage increased (+0.05%) to 69.095% when pulling b9ebe87 on magicDGS:dgs_clean_deprecation into 88b6719 on samtools:master.

lbergelson self-assigned this Oct 24, 2016

Contributor

magicDGS commented Nov 20, 2016

Friendly ping @lbergelson!

Coverage Status

Coverage decreased (-0.02%) to 69.919% when pulling 06d5033 on magicDGS:dgs_clean_deprecation into 398c0ee on samtools:master.

@lbergelson

@magicDGS Thanks for these. 👍 on the improved deprecation marking and switching to use non-deprecated methods.

I think deleting deprecated classes/methods should be separated into a separate pr since it's a bigger api change and I want to get some feedback from others about it. I'm in favor of removing the ancient codecs and long deprecated methods, but I'd like to get feedback from others about that. We've recently bitten ourselves by removing some ancient deprecated code that it turned out a bunch of GATK dependencies were still using...

@@ -322,11 +334,13 @@ public static void setMateInformationOnSupplementalAlignment( final SAMRecord su
/**
* This method will clear any mate cigar already present.
+ * @deprecated use {@link #setProperPairAndMateInfo(SAMRecord, SAMRecord, List)} instead
@lbergelson

lbergelson Nov 22, 2016

Contributor

You're recommending the version without a boolean but calling the one with it. Could you make it consistent?

@magicDGS

magicDGS Nov 24, 2016

Contributor

I changed the body.

+ /**
+ * @param rec1
+ * @param rec2
+ * @param exepectedOrientations
@lbergelson

lbergelson Nov 22, 2016

Contributor

type: exepectedOrientations -> expectedOrientations. No point in having these java doc lines without any doc though. Could you just remove the params that aren't given any description?

@magicDGS

magicDGS Nov 24, 2016

Contributor

This typo was there before this PR, I haven't realized. Changed!

@magicDGS

magicDGS Nov 24, 2016

Contributor

params without description removed.

@@ -36,6 +36,8 @@
* @deprecated use getContig() instead
*/
@Deprecated
- public String getChr();
+ default public String getChr() {
@lbergelson

lbergelson Nov 22, 2016

Contributor

👍

@@ -193,10 +193,13 @@ public static FeatureCodec getFeatureCodec(File featureFile) {
// return new VCFCodec();
if (featureFile.getName().endsWith(".bed") || featureFile.getName().endsWith(".BED") )
return new BEDCodec();
+ // TODO: can this commented lines be removed?
@lbergelson

lbergelson Nov 22, 2016

Contributor

👍 to removing the commented out code

@magicDGS

magicDGS Nov 24, 2016

Contributor

Done!

Coverage Status

Coverage increased (+0.05%) to 69.988% when pulling 87ca759 on magicDGS:dgs_clean_deprecation into 398c0ee on samtools:master.

Coverage Status

Coverage increased (+0.05%) to 69.988% when pulling 87ca759 on magicDGS:dgs_clean_deprecation into 398c0ee on samtools:master.

Contributor

magicDGS commented Nov 24, 2016

I agree with you @lbergelson, we should separate removal from this PR (I didn't remove anything here in my previous commits). I open several PRs for removing deprecated code, and I let here only deprecated javadoc/annotations, and removal of deprecated code inside HTSJDK (in addition to your 👍).

Back to you for more comments!

Coverage Status

Coverage decreased (-0.01%) to 69.994% when pulling 50b37c2 on magicDGS:dgs_clean_deprecation into de27f18 on samtools:master.

@lbergelson lbergelson merged commit 6469969 into samtools:master Nov 30, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.01%) to 69.994%
Details
Contributor

lbergelson commented Nov 30, 2016

@magicDGS 👍 Thanks for the cleanup.

magicDGS deleted the magicDGS:dgs_clean_deprecation branch Dec 1, 2016

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