Koloboke icon indicating copy to clipboard operation
Koloboke copied to clipboard

Redundant cast warning in code generated by KolobokeMap

Open huguesb opened this issue 6 years ago • 0 comments

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

huguesb avatar Nov 04 '17 03:11 huguesb