Skip to content

Commit

Permalink
sprint-1 - Removed @nullable return annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitiry Setrakyan committed Feb 9, 2015
1 parent 33e3b38 commit 7c31c72
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 48 deletions.
Expand Up @@ -139,7 +139,7 @@ private static void delete(org.apache.ignite.IgniteFs fs, IgniteFsPath path) thr
* @param path Directory path.
* @throws IgniteException In case of error.
*/
private static void mkdirs(org.apache.ignite.IgniteFs fs, IgniteFsPath path) throws IgniteException {
private static void mkdirs(IgniteFs fs, IgniteFsPath path) throws IgniteException {
assert fs != null;
assert path != null;

Expand All @@ -166,7 +166,7 @@ private static void mkdirs(org.apache.ignite.IgniteFs fs, IgniteFsPath path) thr
* @throws IgniteException If file can't be created.
* @throws IOException If data can't be written.
*/
private static void create(org.apache.ignite.IgniteFs fs, IgniteFsPath path, @Nullable byte[] data)
private static void create(IgniteFs fs, IgniteFsPath path, @Nullable byte[] data)
throws IgniteException, IOException {
assert fs != null;
assert path != null;
Expand Down Expand Up @@ -195,7 +195,7 @@ private static void create(org.apache.ignite.IgniteFs fs, IgniteFsPath path, @Nu
* @throws IgniteException If file can't be created.
* @throws IOException If data can't be written.
*/
private static void append(org.apache.ignite.IgniteFs fs, IgniteFsPath path, byte[] data) throws IgniteException, IOException {
private static void append(IgniteFs fs, IgniteFsPath path, byte[] data) throws IgniteException, IOException {
assert fs != null;
assert path != null;
assert data != null;
Expand Down
11 changes: 6 additions & 5 deletions modules/core/src/main/java/org/apache/ignite/IgniteCache.java
Expand Up @@ -77,7 +77,7 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
*
* @return Random entry, or {@code null} if cache is empty.
*/
@Nullable public Entry<K, V> randomEntry();
public Entry<K, V> randomEntry();

public IgniteCache<K, V> withExpiryPolicy(ExpiryPolicy plc);

Expand Down Expand Up @@ -146,13 +146,14 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
*
* @param key Key to store in cache.
* @param val Value to be associated with the given key.
* @return Previously contained value regardless of whether put happened or not.
* @return Previously contained value regardless of whether put happened or not ({@code null} if there was no
* previous value).
* @throws NullPointerException If either key or value are {@code null}.
* @throws CacheException If put operation failed.
* @throws org.apache.ignite.internal.processors.cache.CacheFlagException If projection flags validation failed.
*/
@IgniteAsyncSupported
@Nullable public V getAndPutIfAbsent(K key, V val) throws CacheException;
public V getAndPutIfAbsent(K key, V val) throws CacheException;

/**
* Creates a {@link Lock} instance associated with passed key.
Expand Down Expand Up @@ -237,10 +238,10 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
* you can use {@link org.apache.ignite.cache.GridCache#peek(Object, Collection)} method.
*
* @param key Entry key.
* @return Peeked value.
* @return Peeked value, or {@code null} if not found.
* @throws NullPointerException If key is {@code null}.
*/
@Nullable public V localPeek(K key, CachePeekMode... peekModes);
public V localPeek(K key, CachePeekMode... peekModes);

/**
* This method unswaps cache entries by given keys, if any, from swap storage
Expand Down
17 changes: 5 additions & 12 deletions modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
Expand Up @@ -98,7 +98,7 @@ public interface IgniteCluster extends ClusterGroup, IgniteAsyncSupport {
* topology history. Currently only {@link org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi}
* supports topology history.
*/
@Nullable public Collection<ClusterNode> topology(long topVer) throws UnsupportedOperationException;
public Collection<ClusterNode> topology(long topVer) throws UnsupportedOperationException;

/**
* This method provides ability to detect which cache keys are mapped to which nodes
Expand Down Expand Up @@ -144,7 +144,7 @@ public <K> Map<ClusterNode, Collection<K>> mapKeysToNodes(@Nullable String cache
* is not present in the grid.
* @throws IgniteException If failed to map key.
*/
@Nullable public <K> ClusterNode mapKeyToNode(@Nullable String cacheName, K key) throws IgniteException;
public <K> ClusterNode mapKeyToNode(@Nullable String cacheName, K key) throws IgniteException;

/**
* Starts one or more nodes on remote host(s).
Expand Down Expand Up @@ -174,11 +174,8 @@ public <K> Map<ClusterNode, Collection<K>> mapKeysToNodes(@Nullable String cache
* @throws IgniteException In case of error.
*/
@IgniteAsyncSupported
public Collection<GridTuple3<String, Boolean, String>> startNodes(File file,
boolean restart,
int timeout,
int maxConn)
throws IgniteException;
public Collection<GridTuple3<String, Boolean, String>> startNodes(File file, boolean restart, int timeout,
int maxConn) throws IgniteException;

/**
* Starts one or more nodes on remote host(s).
Expand Down Expand Up @@ -280,11 +277,7 @@ public Collection<GridTuple3<String, Boolean, String>> startNodes(File file,
*/
@IgniteAsyncSupported
public Collection<GridTuple3<String, Boolean, String>> startNodes(Collection<Map<String, Object>> hosts,
@Nullable Map<String, Object> dflts,
boolean restart,
int timeout,
int maxConn)
throws IgniteException;
@Nullable Map<String, Object> dflts, boolean restart, int timeout, int maxConn) throws IgniteException;

/**
* Stops nodes satisfying optional set of predicates.
Expand Down
Expand Up @@ -99,7 +99,7 @@ public interface IgniteDataLoader<K, V> extends AutoCloseable {
*
* @return Cache name or {@code null} for default cache.
*/
@Nullable public String cacheName();
public String cacheName();

/**
* Gets flag value indicating that this data loader assumes that there are no other concurrent updates to the cache.
Expand Down
6 changes: 3 additions & 3 deletions modules/core/src/main/java/org/apache/ignite/IgniteFs.java
Expand Up @@ -64,11 +64,11 @@ public interface IgniteFs extends IgniteFsFileSystem, IgniteAsyncSupport {
public static final String PROP_PREFER_LOCAL_WRITES = "locWrite";

/**
* Gets GGFS name.
* Gets IgniteFS name.
*
* @return GGFS name.
* @return IgniteFS name, or {@code null} for default file system.
*/
@Nullable public String name();
public String name();

/**
* Gets GGFS configuration.
Expand Down
Expand Up @@ -157,5 +157,5 @@ public interface IgniteLogger {
*
* @return Name of the file being logged to if one is configured or {@code null} otherwise.
*/
@Nullable public String fileName();
public String fileName();
}
10 changes: 4 additions & 6 deletions modules/core/src/main/java/org/apache/ignite/IgniteQueue.java
Expand Up @@ -17,8 +17,6 @@

package org.apache.ignite;

import org.jetbrains.annotations.*;

import java.io.*;
import java.util.*;
import java.util.concurrent.*;
Expand Down Expand Up @@ -124,19 +122,19 @@ public interface IgniteQueue<T> extends BlockingQueue<T>, Closeable {
@Override public int size() throws IgniteException;

/** {@inheritDoc} */
@Override @Nullable public T poll() throws IgniteException;
@Override public T poll() throws IgniteException;

/** {@inheritDoc} */
@Override @Nullable public T peek() throws IgniteException;
@Override public T peek() throws IgniteException;

/** {@inheritDoc} */
@Override public void put(T item) throws IgniteException;

/** {@inheritDoc} */
@Override @Nullable public T take() throws IgniteException;
@Override public T take() throws IgniteException;

/** {@inheritDoc} */
@Override @Nullable public T poll(long timeout, TimeUnit unit) throws IgniteException;
@Override public T poll(long timeout, TimeUnit unit) throws IgniteException;

/**
* Removes all of the elements from this queue. Method is used in massive queues with huge numbers of elements.
Expand Down
13 changes: 3 additions & 10 deletions modules/core/src/main/java/org/apache/ignite/IgniteServices.java
Expand Up @@ -20,8 +20,8 @@
import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.services.*;
import org.apache.ignite.resources.*;
import org.apache.ignite.services.*;
import org.jetbrains.annotations.*;

import java.util.*;
Expand Down Expand Up @@ -202,10 +202,7 @@ public interface IgniteServices extends IgniteAsyncSupport {
* @throws IgniteException If failed to deploy service.
*/
@IgniteAsyncSupported
public void deployKeyAffinitySingleton(String name,
Service svc,
@Nullable String cacheName,
Object affKey)
public void deployKeyAffinitySingleton(String name, Service svc, @Nullable String cacheName, Object affKey)
throws IgniteException;

/**
Expand Down Expand Up @@ -241,11 +238,7 @@ public void deployKeyAffinitySingleton(String name,
* @throws IgniteException If failed to deploy service.
*/
@IgniteAsyncSupported
public void deployMultiple(String name,
Service svc,
int totalCnt,
int maxPerNodeCnt)
throws IgniteException;
public void deployMultiple(String name, Service svc, int totalCnt, int maxPerNodeCnt) throws IgniteException;

/**
* Deploys multiple instances of the service on the grid according to provided
Expand Down
Expand Up @@ -18,7 +18,6 @@
package org.apache.ignite;

import org.apache.ignite.streamer.*;
import org.jetbrains.annotations.*;

import java.util.*;

Expand Down Expand Up @@ -57,9 +56,9 @@ public interface IgniteStreamer {
/**
* Gets streamer name.
*
* @return Streamer name.
* @return Streamer name, or {@code null} for default no-name streamer.
*/
@Nullable public String name();
public String name();

/**
* Submits group of events for processing. This group of events will be processed on default stage,
Expand Down
Expand Up @@ -19,7 +19,6 @@

import org.apache.ignite.configuration.*;
import org.apache.ignite.transactions.*;
import org.jetbrains.annotations.*;

/**
* Transactions facade.
Expand Down Expand Up @@ -140,7 +139,7 @@ public IgniteTx txStartPartition(String cacheName, int partId, IgniteTxConcurren
* @return Transaction started by this thread or {@code null} if this thread
* does not have a transaction.
*/
@Nullable public IgniteTx tx();
public IgniteTx tx();

/**
* @return Transaction metrics.
Expand Down
Expand Up @@ -70,7 +70,7 @@ public interface IgniteFsFileSystem {
* @return File information for specified path or {@code null} if such path does not exist.
* @throws IgniteException In case of error.
*/
@Nullable public IgniteFsFile update(IgniteFsPath path, Map<String, String> props) throws IgniteException;
public IgniteFsFile update(IgniteFsPath path, Map<String, String> props) throws IgniteException;

/**
* Renames/moves a file.
Expand Down Expand Up @@ -197,7 +197,7 @@ public OutputStream append(IgniteFsPath path, int bufSize, boolean create, @Null
* @return File information for specified path or {@code null} if such path does not exist.
* @throws IgniteException In case of error.
*/
@Nullable public IgniteFsFile info(IgniteFsPath path) throws IgniteException;
public IgniteFsFile info(IgniteFsPath path) throws IgniteException;

/**
* Gets used space in bytes.
Expand Down

0 comments on commit 7c31c72

Please sign in to comment.