Skip to content

Commit

Permalink
tools: Remove usages of apache.commons.collections v3 #TASK-2094
Browse files Browse the repository at this point in the history
  • Loading branch information
j-coll committed Sep 26, 2022
1 parent f4f1d49 commit 4bde5db
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import htsjdk.samtools.util.BlockCompressedFilePointerUtil;
import htsjdk.samtools.util.BlockCompressedInputStream;
import htsjdk.samtools.util.Log;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.ga4gh.models.ReadAlignment;
import org.opencb.biodata.models.alignment.RegionCoverage;
import org.opencb.biodata.models.core.Region;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

package org.opencb.biodata.tools.clinical;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.opencb.biodata.models.clinical.ClinicalDiscussion;
import org.opencb.biodata.models.clinical.ClinicalProperty;
import org.opencb.biodata.models.clinical.ClinicalProperty.ModeOfInheritance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

package org.opencb.biodata.tools.clinical;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.opencb.biodata.models.clinical.ClinicalDiscussion;
import org.opencb.biodata.models.clinical.ClinicalProperty.ModeOfInheritance;
import org.opencb.biodata.models.clinical.ClinicalProperty.Penetrance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.opencb.biodata.tools.pedigree;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.opencb.biodata.models.clinical.ClinicalProperty.Penetrance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.opencb.biodata.tools.variant;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.mortbay.util.ajax.JSON;
import org.opencb.biodata.formats.variant.io.VariantReader;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.biodata.models.variant.VariantBuilder;
Expand Down Expand Up @@ -109,7 +109,12 @@ public List<Variant> read(int batchSize) {
String line;
int i = 0;
while ((i < batchSize) && (line = readLine()) != null) {
Variant variant = new Variant(jsonObjectMapper.convertValue(JSON.parse(line), VariantAvro.class));
Variant variant;
try {
variant = new Variant(jsonObjectMapper.readValue(line, VariantAvro.class));
} catch (JsonProcessingException e) {
throw new UncheckedIOException(e);
}

// Read variants may not have the variant type set and this might cause NPE
if (variant.getType() == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.opencb.biodata.tools.variant.metadata;

import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.collections4.map.HashedMap;
import org.junit.Before;
import org.junit.Test;
import org.opencb.biodata.models.metadata.Individual;
Expand Down

0 comments on commit 4bde5db

Please sign in to comment.