Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.7.2
-
Fix Version/s: 2.8
-
Component/s: Maven Surefire Plugin
-
Labels:None
-
Complexity:Intermediate
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
This patch contains some improvements for the class Classpath:
- Only use a set for storing the elements.
- append(Classpath) has been changed to Classpath.join(Classpath, Classpath), because the classpath doesn't get appended. Instead a new one is created.
- Renamed setForkProperties to writeToForkProperties.
- Renamed setAsSystemProperty to writeToSystemProperty.
- Moved getClassPathAsString() into writeToSystemProperty and only call writeToSystemProperty from outside.
- Added readFromForkProperties in order to have serialization and deseralization being part of the same class.
From my point of view these changes improve the readability of the Surefire code and are another step on the way to clean code.
LinkedHashSet is a jdk1.4 class and the booter is actually (believe it or not!) a java 1.3 module.
I would also prefer using a private copy-constructor in the join method to retain immutability.
Personally I see no point in using an interator when the code also has to maintain a counter, at least not when you can't use a linkedhashset
The other changes are nice, would you mind updating the patch?