ForestryMC / Binnie

Minecraft addons for the Forestry mod. Extra Bees, Extra Trees, Genetics, and more.
https://minecraft.curseforge.com/projects/binnies-mods
Other
69 stars 59 forks source link

Code bugs. #505

Closed RusTit closed 6 years ago

RusTit commented 6 years ago

At first i thought that something is broken, but after some tests I realized that everything work (flower image sizes). So calculation can be removed. Fuchsia has one section. https://github.com/ForestryMC/Binnie/blob/4946c9d31cc2c5e02eef2cd56f659ae89a402cc4/botany/src/main/java/binnie/botany/genetics/EnumFlowerType.java#L50 Foxglove - two. https://github.com/ForestryMC/Binnie/blob/4946c9d31cc2c5e02eef2cd56f659ae89a402cc4/botany/src/main/java/binnie/botany/genetics/EnumFlowerType.java#L37 2018-04-06_15 50 51 2018-04-06_15 50 52 2018-04-06_15 51 08 2018-04-06_15 51 10

RusTit commented 6 years ago

From Idea: Reports a null check followed by an instanceof check or a method call which will surely return false when null is passed (e.g. Class.isInstance). Since the instanceof operator always returns false for null, there is no need to have an additional null check. Here is an example of a violation: if (x != null && x instanceof String) { ... } The quickfix changes this code to: if (x instanceof String) { ... }

RusTit commented 6 years ago

@Nedelosk I will be grateful if you review this and #504 today