File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,34 @@ private class ListGenMethod extends GenMethod {
364
364
override string getCall ( string arg ) { result = "List.of(" + arg + ")" }
365
365
}
366
366
367
+ private class SetGenMethod extends GenMethod {
368
+ SetGenMethod ( ) { this = "SetGenMethod" }
369
+
370
+ override predicate appliesTo ( Type t , Content c ) {
371
+ exists ( GenericType set | set .hasQualifiedName ( "java.util" , "Set" ) |
372
+ t .getErasure ( ) = set .getErasure ( )
373
+ ) and
374
+ c instanceof CollectionContent
375
+ }
376
+
377
+ bindingset [ arg]
378
+ override string getCall ( string arg ) { result = "Set.of(" + arg + ")" }
379
+ }
380
+
381
+ private class IteratorGenMethod extends GenMethod {
382
+ IteratorGenMethod ( ) { this = "IteratorGenMethod" }
383
+
384
+ override predicate appliesTo ( Type t , Content c ) {
385
+ exists ( GenericType set | set .hasQualifiedName ( "java.util" , "Iterator" ) |
386
+ t .getErasure ( ) = set .getErasure ( )
387
+ ) and
388
+ c instanceof CollectionContent
389
+ }
390
+
391
+ bindingset [ arg]
392
+ override string getCall ( string arg ) { result = "List.of(" + arg + ").iterator()" }
393
+ }
394
+
367
395
private class OptionalGenMethod extends GenMethod {
368
396
OptionalGenMethod ( ) { this = "optionalgenmethod" }
369
397
You can’t perform that action at this time.
0 commit comments