Skip to content

Instantly share code, notes, and snippets.

View Jannyboy11's full-sized avatar

Jan Jannyboy11

View GitHub Profile
@Jannyboy11
Jannyboy11 / RecordTest.java
Last active April 27, 2020 14:53
Records implementation oversight
package com.example;
import java.util.Arrays;
/*
Hi all,
While experimenting with the new records, I found what I believe is an oversight in the implementation.
The generated equals method for records is based on equality of the components, but when the record component is an array, it still uses regular Object#equals(Object) method.
package com.example;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;