Code cleanup -  Remove Redundant Cast(s)

This commit is contained in:
Arnaud Héritier 2013-06-11 22:28:48 +02:00
parent da48cfff83
commit 456268af61
9 changed files with 63 additions and 63 deletions

View File

@ -57,7 +57,7 @@ public void testRange()
VersionRange range = VersionRange.createFromVersionSpec( "(,1.0]" );
List<Restriction> restrictions = range.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
Restriction restriction = (Restriction) restrictions.get( 0 );
Restriction restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.0", restriction.getUpperBound().toString() );
@ -70,7 +70,7 @@ public void testRange()
assertEquals( CHECK_VERSION_RECOMMENDATION, "1.0", range.getRecommendedVersion().toString() );
restrictions = range.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -81,7 +81,7 @@ public void testRange()
range = VersionRange.createFromVersionSpec( "[1.0]" );
restrictions = range.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.0", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.0", restriction.getUpperBound().toString() );
@ -93,7 +93,7 @@ public void testRange()
range = VersionRange.createFromVersionSpec( "[1.2,1.3]" );
restrictions = range.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.2", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.3", restriction.getUpperBound().toString() );
@ -105,7 +105,7 @@ public void testRange()
range = VersionRange.createFromVersionSpec( "[1.0,2.0)" );
restrictions = range.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.0", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "2.0", restriction.getUpperBound().toString() );
@ -117,7 +117,7 @@ public void testRange()
range = VersionRange.createFromVersionSpec( "[1.5,)" );
restrictions = range.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.5", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -129,13 +129,13 @@ public void testRange()
range = VersionRange.createFromVersionSpec( "(,1.0],[1.2,)" );
restrictions = range.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 2, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.0", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
assertNull( CHECK_VERSION_RECOMMENDATION, range.getRecommendedVersion() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.2", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -183,7 +183,7 @@ public void testIntersections()
assertEquals( CHECK_VERSION_RECOMMENDATION, "1.0", mergedRange.getRecommendedVersion().toString() );
List<Restriction> restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
Restriction restriction = (Restriction) restrictions.get( 0 );
Restriction restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -193,7 +193,7 @@ public void testIntersections()
assertEquals( CHECK_VERSION_RECOMMENDATION, "1.1", mergedRange.getRecommendedVersion().toString() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -206,7 +206,7 @@ public void testIntersections()
assertEquals( CHECK_VERSION_RECOMMENDATION, "1.1", mergedRange.getRecommendedVersion().toString() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.0", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -218,7 +218,7 @@ public void testIntersections()
assertEquals( CHECK_VERSION_RECOMMENDATION, "1.1", mergedRange.getRecommendedVersion().toString() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -230,7 +230,7 @@ public void testIntersections()
assertEquals( CHECK_VERSION_RECOMMENDATION, "1.1", mergedRange.getRecommendedVersion().toString() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.1", restriction.getLowerBound().toString() );
@ -242,7 +242,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -254,7 +254,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.2", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -266,7 +266,7 @@ public void testIntersections()
assertEquals( CHECK_VERSION_RECOMMENDATION, "1.1", mergedRange.getRecommendedVersion().toString() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.2", restriction.getUpperBound().toString() );
@ -278,7 +278,7 @@ public void testIntersections()
assertEquals( CHECK_VERSION_RECOMMENDATION, "1.1", mergedRange.getRecommendedVersion().toString() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.1", restriction.getUpperBound().toString() );
@ -290,7 +290,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.1", restriction.getUpperBound().toString() );
@ -302,7 +302,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.0", restriction.getUpperBound().toString() );
@ -314,12 +314,12 @@ public void testIntersections()
assertEquals( CHECK_VERSION_RECOMMENDATION, "1.2", mergedRange.getRecommendedVersion().toString() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 2, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.0", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -331,12 +331,12 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 2, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.0", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -348,12 +348,12 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 2, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertNull( CHECK_LOWER_BOUND, restriction.getLowerBound() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.1", restriction.getUpperBound().toString() );
assertFalse( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertNull( CHECK_UPPER_BOUND, restriction.getUpperBound() );
@ -365,7 +365,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.3", restriction.getUpperBound().toString() );
@ -377,7 +377,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.2", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.3", restriction.getUpperBound().toString() );
@ -389,7 +389,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.2", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.3", restriction.getUpperBound().toString() );
@ -401,7 +401,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.2", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.3", restriction.getUpperBound().toString() );
@ -413,7 +413,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.2", restriction.getLowerBound().toString() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.3", restriction.getUpperBound().toString() );
@ -425,7 +425,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.2", restriction.getLowerBound().toString() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.3", restriction.getUpperBound().toString() );
@ -437,7 +437,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.2", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.3", restriction.getUpperBound().toString() );
@ -449,7 +449,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.1", restriction.getUpperBound().toString() );
@ -468,7 +468,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.1", restriction.getUpperBound().toString() );
@ -480,7 +480,7 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 1, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.4", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.4", restriction.getUpperBound().toString() );
@ -492,12 +492,12 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 2, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.2", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.3", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.4", restriction.getUpperBound().toString() );
@ -509,12 +509,12 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 2, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.2", restriction.getUpperBound().toString() );
assertFalse( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.3", restriction.getLowerBound().toString() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.4", restriction.getUpperBound().toString() );
@ -526,12 +526,12 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 2, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.2", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.3", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.4", restriction.getUpperBound().toString() );
@ -543,12 +543,12 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 2, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.2", restriction.getUpperBound().toString() );
assertFalse( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.3", restriction.getLowerBound().toString() );
assertFalse( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.4", restriction.getUpperBound().toString() );
@ -581,12 +581,12 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 2, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.2", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.3", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.4", restriction.getUpperBound().toString() );
@ -598,17 +598,17 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 3, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.2", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.3", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.4", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 2 );
restriction = restrictions.get( 2 );
assertEquals( CHECK_LOWER_BOUND, "1.5", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.5", restriction.getUpperBound().toString() );
@ -620,17 +620,17 @@ public void testIntersections()
assertNull( CHECK_VERSION_RECOMMENDATION, mergedRange.getRecommendedVersion() );
restrictions = mergedRange.getRestrictions();
assertEquals( CHECK_NUM_RESTRICTIONS, 3, restrictions.size() );
restriction = (Restriction) restrictions.get( 0 );
restriction = restrictions.get( 0 );
assertEquals( CHECK_LOWER_BOUND, "1.1", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.2", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 1 );
restriction = restrictions.get( 1 );
assertEquals( CHECK_LOWER_BOUND, "1.3", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.4", restriction.getUpperBound().toString() );
assertTrue( CHECK_UPPER_BOUND_INCLUSIVE, restriction.isUpperBoundInclusive() );
restriction = (Restriction) restrictions.get( 2 );
restriction = restrictions.get( 2 );
assertEquals( CHECK_LOWER_BOUND, "1.5", restriction.getLowerBound().toString() );
assertTrue( CHECK_LOWER_BOUND_INCLUSIVE, restriction.isLowerBoundInclusive() );
assertEquals( CHECK_UPPER_BOUND, "1.6", restriction.getUpperBound().toString() );

View File

@ -219,7 +219,7 @@ private ManagedVersionMap getManagedVersionsMap( Artifact originatingArtifact, M
}
/* remove the originating artifact if it is also in managed versions to avoid being modified during resolution */
Artifact managedOriginatingArtifact = (Artifact) versionMap.get( originatingArtifact.getDependencyConflictId() );
Artifact managedOriginatingArtifact = versionMap.get( originatingArtifact.getDependencyConflictId() );
if ( managedOriginatingArtifact != null )
{
@ -465,7 +465,7 @@ private void recurse( ArtifactResolutionResult result, ResolutionNode node,
// added to the artifact before we retrive the metadata
// for the artifact; otherwise we may end up with unwanted
// dependencies.
Artifact ma = (Artifact) managedVersions.get( childKey );
Artifact ma = managedVersions.get( childKey );
ArtifactFilter managedExclusionFilter = ma.getDependencyFilter();
if ( null != managedExclusionFilter )
{
@ -602,7 +602,7 @@ private void recurse( ArtifactResolutionResult result, ResolutionNode node,
private void manageArtifact( ResolutionNode node, ManagedVersionMap managedVersions,
List<ResolutionListener> listeners )
{
Artifact artifact = (Artifact) managedVersions.get( node.getKey() );
Artifact artifact = managedVersions.get( node.getKey() );
// Before we update the version of the artifact, we need to know
// whether we are working on a transitive dependency or not. This

View File

@ -63,8 +63,8 @@ public void setTree( MetadataTreeNode root )
public void initTreeProcessing( PlexusContainer plexus )
throws ComponentLookupException
{
classpathTransformation = (ClasspathTransformation) plexus.lookup( ClasspathTransformation.class );
conflictResolver = (GraphConflictResolver) plexus.lookup( GraphConflictResolver.class );
classpathTransformation = plexus.lookup( ClasspathTransformation.class );
conflictResolver = plexus.lookup( GraphConflictResolver.class );
}
//----------------------------------------------------------------------------
public MetadataGraph getGraph()

View File

@ -30,7 +30,7 @@ public class TransformationManagerTest
public void testTransformationManager()
throws Exception
{
ArtifactTransformationManager tm = (ArtifactTransformationManager) lookup( ArtifactTransformationManager.class );
ArtifactTransformationManager tm = lookup( ArtifactTransformationManager.class );
List tms = tm.getArtifactTransformations();

View File

@ -54,7 +54,7 @@ public void testShouldUseMainPluginDependencyVersionOverManagedDepVersion()
ModelUtils.mergePluginDefinitions( plugin, mgtPlugin, false );
assertEquals( dep.getVersion(), ((Dependency) plugin.getDependencies().get( 0 ) ).getVersion() );
assertEquals( dep.getVersion(), plugin.getDependencies().get( 0 ).getVersion() );
}
private Dependency createDependency( String gid,

View File

@ -68,7 +68,7 @@ public void testProjectInheritance()
// Value taken from p2
// ----------------------------------------------------------------------
assertEquals( "mailing-list", ( (MailingList) p4.getMailingLists().get( 0 ) ).getName() );
assertEquals( "mailing-list", p4.getMailingLists().get( 0 ).getName() );
// ----------------------------------------------------------------------
// Value taken from p1

View File

@ -95,7 +95,7 @@ public void testProjectInheritance()
// Value taken from p2
// ----------------------------------------------------------------------
assertEquals( "mailing-list", ( (MailingList) project4.getMailingLists().get( 0 ) ).getName() );
assertEquals( "mailing-list", project4.getMailingLists().get( 0 ).getName() );
// ----------------------------------------------------------------------
// Value taken from p1

View File

@ -76,7 +76,7 @@ protected void setUp()
source = new Source();
artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
artifactCollector = (LegacyArtifactCollector) lookup( LegacyArtifactCollector.class );
artifactCollector = lookup( LegacyArtifactCollector.class );
projectArtifact = createArtifactSpec( "project", "1.0", null );
}

View File

@ -86,9 +86,9 @@ public void testProjectBuilder()
List<PluginExecution> executions = plugin.getExecutions();
PluginExecution execution = (PluginExecution) executions.get( 0 );
PluginExecution execution = executions.get( 0 );
String g0 = (String) execution.getGoals().get( 0 );
String g0 = execution.getGoals().get( 0 );
assertEquals( "plexus:runtime", g0 );