Joeywp
05/04/2018, 7:22 PMShawn
05/04/2018, 7:25 PMJoeywp
05/04/2018, 7:26 PM<root>
<item name='org.bukkit.inventory.PlayerInventory org.bukkit.inventory.ItemStack getItemInMainHand()'>
<annotation name='org.jetbrains.annotations.Nullable'/>
<annotation name='java.lang.Deprecated'/>
</item>
</root>
Joeywp
05/04/2018, 7:27 PMhttps://i.gyazo.com/a4c7b37b69acc8b238ac1c3f420fbcc2.png▾
https://i.gyazo.com/393e04abc624a58ad6a0479d7b40d590.png▾
Shawn
05/04/2018, 7:31 PM.
directly on the result of itemInMainHand
might be accidentally casting the object from ItemStack!
to ItemStack
rather than ItemStack?
Shawn
05/04/2018, 7:32 PM.clone()
on a non-null, cloneable object should result in a non-null reference being returnedJoeywp
05/04/2018, 7:34 PM.clone()
methods, for example:
https://i.gyazo.com/fb8bc996f8c05da25b256ed210249ba6.png▾
.inventory
refers to an interface that only has methods, CTRL+Clicking the method confirms it refers to the externally annotated methodJoeywp
05/04/2018, 7:34 PM@Deprecated
also shouldn't work, right?Shawn
05/04/2018, 7:35 PMShawn
05/04/2018, 7:36 PM@Nullable
via external annotations overrides Kotlin’s concept of platform types hereShawn
05/04/2018, 7:36 PMJoeywp
05/04/2018, 7:37 PMShawn
05/04/2018, 7:40 PMShawn
05/04/2018, 7:40 PMJoeywp
05/04/2018, 7:40 PM@Deprecated
from the external annotations it dissapears againJoeywp
05/04/2018, 7:41 PM@Deprecated
to test if I configured it wrongly or if it did ignore my @Nullable
Shawn
05/04/2018, 7:42 PMJoeywp
05/04/2018, 7:54 PM