From ab97ffb7a7984fb25ef17acc1fc81ec55cf4accd Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Tue, 16 May 2017 12:43:13 +0200 Subject: [PATCH] IG: added note to description --- .../ArraysAsListWithZeroOrOneArgument.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/ArraysAsListWithZeroOrOneArgument.html b/plugins/InspectionGadgets/src/inspectionDescriptions/ArraysAsListWithZeroOrOneArgument.html index 46258ebd43fb..b81dac17b0d3 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/ArraysAsListWithZeroOrOneArgument.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/ArraysAsListWithZeroOrOneArgument.html @@ -2,6 +2,8 @@ Reports any calls to Arrays.asList() with zero arguments or only one argument. Such calls could be replaced with either a call to Collections.singletonList() or Collections.emptyList() which will save some memory. +

Note: the list returned by Collections.singletonList() is immutable, while the list returned Arrays.asList() allows +calling the set() method. This may break the code in rare cases.