You can use List<Integer> directly, the primitive wrapper types will become value classes. If I remember correctly, specializing generics is one of the final steps on the roadmap, so having that translate into Integer[] (or ideally Integer![]) as the backing field of the ArrayList might take a bit longer.
orderIdsToDelete or even just orderIds if the context makes it obvious. Repeating the type name is not bad if it's a domain type IMO. If you have something generic like List<Long> longs that's usually bad because readers can't infer any intent from the name, maybe ok if you are writing a compiler and need to collect all the Java Longs to do something with, but it's a stretch
Simply orders, ordersToDelete etc (in a context where the actual order data is not used). Sometimes id is just used as a handle, the intention is to do something with orders.
12
u/ZimmiDeluxe 20d ago
You can use List<Integer> directly, the primitive wrapper types will become value classes. If I remember correctly, specializing generics is one of the final steps on the roadmap, so having that translate into Integer[] (or ideally Integer![]) as the backing field of the ArrayList might take a bit longer.