Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replacing the gradle java plugin with java-library
* updating vulnerable dependencies * replacing use of commons-lang Path with new barclay Path * reducing dependency scope where possible
- Loading branch information
1 parent
84256bd
commit 237b02f
Showing
11 changed files
with
126 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/org/broadinstitute/barclay/argparser/NamedArgumentDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/org/broadinstitute/barclay/argparser/TaggedArgumentParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
src/main/java/org/broadinstitute/barclay/help/DefaultDocWorkUnitHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/main/java/org/broadinstitute/barclay/help/WDLWorkUnitHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package org.broadinstitute.barclay.utils; | ||
|
||
import org.apache.commons.lang3.builder.CompareToBuilder; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import java.util.Map; | ||
|
||
/** | ||
* Simple Pair class | ||
* @param left left of pair | ||
* @param right right of pair | ||
* @param <L> type of left | ||
* @param <R> type of right | ||
*/ | ||
public record Pair<L,R>(L left, R right) implements Map.Entry<L,R>, Comparable<Pair<L,R>>, Serializable { | ||
|
||
@Serial | ||
private static final long serialVersionUID= 1; | ||
|
||
/** | ||
* @return left() | ||
*/ | ||
public L getLeft(){ | ||
return left; | ||
} | ||
|
||
/** | ||
* @return right() | ||
*/ | ||
public R getRight() { | ||
return right; | ||
|
||
} | ||
|
||
/** | ||
* @return left() | ||
*/ | ||
@Override | ||
public L getKey() { | ||
return left; | ||
} | ||
|
||
/** | ||
* @return right() | ||
*/ | ||
@Override | ||
public R getValue() { | ||
return right; | ||
} | ||
|
||
/** | ||
* This Pair is immutable so the value cannot be set. | ||
* | ||
* @param value is irrelevant since this is immutable | ||
* @return UnsupporedOperationException | ||
* @throws UnsupportedOperationException | ||
*/ | ||
@Override | ||
public R setValue(final R value) { | ||
throw new UnsupportedOperationException("Pair is an immutable record"); | ||
} | ||
|
||
|
||
/** | ||
* @return a new Pair of left and right | ||
*/ | ||
public static <L,R> Pair<L,R> of(L left, R right){ | ||
return new Pair<>(left, right); | ||
} | ||
|
||
|
||
/** | ||
* First compare left, then compare right | ||
* @param other the Pair to be compared. | ||
*/ | ||
@Override | ||
public int compareTo(final Pair<L,R> other) { | ||
//This implemntation is take out of the commons lang Pair for consistency reasons | ||
return new CompareToBuilder().append(getLeft(), other.left) | ||
.append(getRight(), other.right).toComparison(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/test/java/org/broadinstitute/barclay/argparser/CommandLineArgumentParserTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters