JorgeFerrer/liferay-portal — pull request #176 by yuhai (2013-05-31 10:13:40+00:00)
Title: LPS-35826  Can't install plugin form version 9 to 10: version 9 is newer than version 10

Hi Jorge,

The fix logic as the fllowings:

Firstly, we will split version information by "." to array, then we compare array element value to judge the result.

As for buildnumber are 9(6.1.20.9) and 10(6.1.20.10), if the two previousBuildNumber and newBuildNumber are both digit, it will on the basis of int compare. The result is 10 > 9

As for the buildnumber is 9 and 9.1, it will be on the basis of array length compare. The result is 2[9,1] length > 1[9]

As for the buildnumber is 9 and 10+, we will extract Digits from the both of buildnumber to compare, 10 > 9, so the result is 10+ > 9

As for the buildnumber is 10a and 10+, we firstlt will extract Digits from the both of buildnumber to compare, when the extract Digits is equal(10=10), it will be based on the Unicode value of each character in the strings.

Please help check it.

Thanks,
Hai