@@ -118,7 +118,7 @@ class VersionCollection {
118118 } else {
119119 // caveat 3 - if our currentVersion is a X.0.0, we need to check X-1 minors to see if they are released
120120 if (currentVersion. minor == 0 ) {
121- for (Version version : getMinorTips(currentVersion. major - 1 )) {
121+ for (Version version : getMinorTips(currentVersion. major - 1 )) {
122122 if (isReleased(version) == false ) {
123123 // caveat 1 - This should only ever contain 2 non released branches in flight. An example is 6.x is frozen,
124124 // and 6.2 is cut but not yet released there is some simple logic to make sure that in the case of more than 2,
@@ -138,13 +138,8 @@ class VersionCollection {
138138 break
139139 }
140140 }
141- // caveat 0 - now dip back 2 versions to get the last supported snapshot version of the line
142- Version highestMinor = getHighestPreviousMinor(currentVersion. major - 1 )
143- if (highestMinor == null ) {
144- maintenanceBugfixSnapshot = null
145- } else {
146- maintenanceBugfixSnapshot = replaceAsSnapshot(highestMinor)
147- }
141+ // caveat 0 - the last supported snapshot of the line is on a version that we don't support (N-2)
142+ maintenanceBugfixSnapshot = null
148143 } else {
149144 // caveat 3 did not apply. version is not a X.0.0, so we are somewhere on a X.Y line
150145 // only check till minor == 0 of the major
@@ -298,10 +293,7 @@ class VersionCollection {
298293 */
299294 private Version getHighestPreviousMinor (Integer nextMajorVersion ) {
300295 SortedSet<Version > result = versionSet. headSet(Version . fromString(" ${ nextMajorVersion} .0.0" ))
301- if (result. isEmpty()) {
302- return null
303- }
304- return result. last()
296+ return result. isEmpty() ? null : result. last()
305297 }
306298
307299 /**
0 commit comments