File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed
main/java/ru/qatools/gridrouter/config
test/java/ru/qatools/gridrouter/config Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
package ru .qatools .gridrouter .config ;
2
2
3
+ import java .util .ArrayList ;
3
4
import java .util .List ;
4
5
5
6
/**
@@ -10,15 +11,15 @@ public interface WithCopy {
10
11
11
12
List <Host > getHosts ();
12
13
14
+ String getName ();
15
+
13
16
/**
14
17
* Creates a copy for the {@link Region} object, which is almost deep:
15
18
* the hosts itself are not copied although the list is new.
16
19
*
17
20
* @return a copy of the object
18
21
*/
19
22
default Region copy () {
20
- Region result = new Region ();
21
- result .getHosts ().addAll (getHosts ());
22
- return result ;
23
+ return new Region (new ArrayList <>(getHosts ()), getName ());
23
24
}
24
25
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public void testRandomness() {
27
27
int entriesCount = 5000000 ;
28
28
int keysCount = 10 ;
29
29
30
- Host host1 = newHost ("host_1" , keysCount - 1 );
30
+ Host host1 = new Host ("host_1" , 4444 , keysCount - 1 );
31
31
32
32
List <Host > hosts = new ArrayList <>(keysCount );
33
33
hosts .add (host1 );
@@ -54,14 +54,7 @@ public void testRandomness() {
54
54
}
55
55
56
56
private static Host newHost () {
57
- return newHost (UUID .randomUUID ().toString (), 1 );
58
- }
59
-
60
- private static Host newHost (String name , int count ) {
61
- Host host = new Host ();
62
- host .setName (name );
63
- host .setCount (count );
64
- return host ;
57
+ return new Host (UUID .randomUUID ().toString (), 4444 , 1 );
65
58
}
66
59
67
60
private static Matcher <Integer > isAround (int count ) {
Original file line number Diff line number Diff line change 112
112
<verbose >true</verbose >
113
113
<args >
114
114
<arg >-Xinheritance</arg >
115
+ <arg >-Xvalue-constructor</arg >
115
116
</args >
116
117
<plugins >
117
118
<plugin >
118
119
<groupId >org.jvnet.jaxb2_commons</groupId >
119
120
<artifactId >jaxb2-basics</artifactId >
120
121
<version >0.9.4</version >
121
122
</plugin >
123
+ <plugin >
124
+ <groupId >org.jvnet.jaxb2_commons</groupId >
125
+ <artifactId >jaxb2-value-constructor</artifactId >
126
+ <version >3.0</version >
127
+ </plugin >
122
128
</plugins >
123
129
</configuration >
124
130
</plugin >
You can’t perform that action at this time.
0 commit comments