leventov / Koloboke

Java Collections till the last breadcrumb of memory and performance
https://koloboke.com/
1.01k stars 139 forks source link

Redundant cast warning in code generated by KolobokeMap #61

Open huguesb opened 7 years ago

huguesb commented 7 years ago

The following code

import com.koloboke.compile.KolobokeMap;

@KolobokeMap
public abstract class IntMap<T> {
    public static <T> IntMap<T> withExpectedSize(int size) {
        return new KolobokeIntMap<T>(size);
    }

    public abstract T put(int k, T v);
    public abstract T get(int k);
    public abstract T remove(int k);
}

Compiled with gradle 2.12 / propdeps-plugin:0.0.9.RELEASE / koloboke-compile:0.5.1 / koloboke-impl-common-jdk8:1.0.0 generates the following warning (which breaks compilation in my project as -Werror is enabled):

KolobokeIntMap.java:131: warning: [cast] redundant cast to int
                newFree = ((int) (random.nextInt()));
                           ^
error: warnings found and -Werror specified
1 error
1 warning