gridgain / gridgain-old

268 stars 85 forks source link

@Nullable on return of Grid.cache(String name) #3

Closed ghost closed 10 years ago

ghost commented 10 years ago

Can we remove the @Nullable annotation on the return value of Grid.cache(String name) in Grid.java?

    @Nullable public <K, V> GridCache<K, V> cache(@Nullable String name);

If a cache cannot be found by the given name an exception should be thrown. If this type of test is often needed then lets add a Grid.cacheExists(String name) call. Returning @Nullable generates warnings in IntelliJ that can only be satisfied by either disabling the inspection or asserting that the cache != null. Both are ugly.

nivanov commented 10 years ago

Agree w/Tim here.

sboikov commented 10 years ago

Removed @Nullable from Grid.cache(String name), Grid.streamer(String name) and some others methods, fix is commited into master.