tbel: refactoring
This commit is contained in:
parent
3d3ac28a7f
commit
baf68bbbfc
@ -391,7 +391,7 @@ public class TbUtils {
|
||||
parserConfig.addImport("createSetTb", new MethodStub(TbUtils.class.getMethod("createSetTb",
|
||||
ExecutionContext.class)));
|
||||
parserConfig.addImport("createSetTb", new MethodStub(TbUtils.class.getMethod("createSetTb",
|
||||
List.class, ExecutionContext.class)));
|
||||
ExecutionContext.class, List.class)));
|
||||
parserConfig.addImport("isSet", new MethodStub(TbUtils.class.getMethod("isSet",
|
||||
Object.class)));
|
||||
}
|
||||
@ -1493,7 +1493,7 @@ public class TbUtils {
|
||||
return new ExecutionLinkedHashSet<>(ctx);
|
||||
}
|
||||
|
||||
public static <E> Set<E> createSetTb(List<E> list, ExecutionContext ctx) {
|
||||
public static <E> Set<E> createSetTb(ExecutionContext ctx, List<E> list) {
|
||||
Set<E> newSet = new LinkedHashSet<>(list);
|
||||
return new ExecutionLinkedHashSet<>(newSet, ctx);
|
||||
}
|
||||
|
||||
@ -1223,7 +1223,7 @@ public class TbUtilsTest {
|
||||
actual.addAll(list);
|
||||
assertEquals(4, actual.size());
|
||||
assertTrue(actual.containsAll(expected));
|
||||
actual = TbUtils.createSetTb(list, ctx);
|
||||
actual = TbUtils.createSetTb(ctx, list);
|
||||
expected = toSet(new byte[]{(byte) 0xDD, (byte) 0xCC, (byte) 0xDA});
|
||||
actual.add((byte) 0xDA);
|
||||
actual.remove((byte) 0xBB);
|
||||
@ -1232,10 +1232,10 @@ public class TbUtilsTest {
|
||||
assertEquals(actual.size(), 3);
|
||||
actual.clear();
|
||||
assertTrue(actual.isEmpty());
|
||||
actual = TbUtils.createSetTb(list, ctx);
|
||||
Set actualClone = TbUtils.createSetTb(list, ctx);
|
||||
Set actualClone_asc = TbUtils.createSetTb(list, ctx);
|
||||
Set actualClone_desc = TbUtils.createSetTb(list, ctx);
|
||||
actual = TbUtils.createSetTb(ctx, list);
|
||||
Set actualClone = TbUtils.createSetTb(ctx, list);
|
||||
Set actualClone_asc = TbUtils.createSetTb(ctx, list);
|
||||
Set actualClone_desc = TbUtils.createSetTb(ctx, list);
|
||||
((ExecutionLinkedHashSet<?>)actualClone).sort();
|
||||
((ExecutionLinkedHashSet<?>)actualClone_asc).sort(true);
|
||||
((ExecutionLinkedHashSet<?>)actualClone_desc).sort(false);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user