GUACAMOLE-635: Heap pollution is not possible within SimpleDirectory(ObjectType... objects).
From https://docs.oracle.com/javase/tutorial/java/generics/nonReifiableVarargsType.html#vulnerabilities: "Heap pollution occurs when a variable of a parameterized type refers to an object that is not of that parameterized type." In this case, the parameterized type (ObjectType) and the array of that type within this constructor are always used as their formal types.
This commit is contained in:
1 parent
1fef6a05e1
commit
182f204c95
1 file changed
+1
@@ -85,6 +85,7 @@ public class SimpleDirectory<ObjectType extends Identifiable>
|
||||
* @param objects
|
||||
* The objects that should be present in this directory.
|
||||
*/
|
||||
@SafeVarargs
|
||||
public SimpleDirectory(ObjectType... objects) {
|
||||
this(Arrays.asList(objects));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user