Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E095E186CD for ; Thu, 28 May 2015 16:30:23 +0000 (UTC) Received: (qmail 91336 invoked by uid 500); 28 May 2015 16:30:23 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 91304 invoked by uid 500); 28 May 2015 16:30:23 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 91295 invoked by uid 99); 28 May 2015 16:30:23 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 16:30:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 61FED1A39A5 for ; Thu, 28 May 2015 16:30:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.791 X-Spam-Level: X-Spam-Status: No, score=0.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id MhmOqcID7jLn for ; Thu, 28 May 2015 16:30:08 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 5C4DC24C07 for ; Thu, 28 May 2015 16:30:08 +0000 (UTC) Received: (qmail 91169 invoked by uid 99); 28 May 2015 16:30:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 16:30:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E621EE10BE; Thu, 28 May 2015 16:30:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Thu, 28 May 2015 16:30:07 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/4] incubator-ignite git commit: # save. Repository: incubator-ignite Updated Branches: refs/heads/ignite-218-hdfs-only 2a472e161 -> 3fe658263 # save. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/73cb2bc0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/73cb2bc0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/73cb2bc0 Branch: refs/heads/ignite-218-hdfs-only Commit: 73cb2bc0b7b22a68a7136095b48b33d48053f2e3 Parents: 2a472e1 Author: iveselovskiy Authored: Thu May 28 18:37:03 2015 +0300 Committer: iveselovskiy Committed: Thu May 28 18:37:03 2015 +0300 ---------------------------------------------------------------------- .../org/apache/ignite/igfs/IgfsUserContext.java | 21 ++++++-------------- 1 file changed, 6 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73cb2bc0/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java index 1a91677..1242982 100644 --- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java +++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsUserContext.java @@ -17,10 +17,7 @@ package org.apache.ignite.igfs; -// TODO: Remove. -import org.apache.ignite.*; import org.apache.ignite.internal.util.typedef.*; -import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; @@ -41,14 +38,11 @@ public abstract class IgfsUserContext { * @param clo the closure to execute * @param The type of closure result. * @return the result of closure execution. - * @throws NullPointerException if user name is null or empty String or if the closure is null. + * @throws IllegalArgumentException if user name is null or empty String or if the closure is null. */ public static T doAs(String user, final IgniteOutClosure clo) { if (F.isEmpty(user)) - // use NPE to ensure that #doAs() caller will not treat this exception - // as the one thrown from the closure: - // TODO: use IllegalArgument or IgniteException - throw new NullPointerException("Failed to use null or empty user name."); + throw new IllegalArgumentException("Failed to use null or empty user name."); final String ctxUser = userStackThreadLocal.get(); @@ -74,7 +68,7 @@ public abstract class IgfsUserContext { * public Foo myOperation() throws MyCheckedException1, MyCheckedException2 { * try { * return IgfsUserContext.doAs(user, new Callable() { - * @Override public Foo call() throws MyCheckedException1, MyCheckedException2 { + * @Override public Foo call() throws MyCheckedException1, MyCheckedException2 { * return makeSomeFoo(); // do the job * } * }); @@ -91,14 +85,11 @@ public abstract class IgfsUserContext { * @param clbl the Callable to execute * @param The type of callable result. * @return the result of closure execution. - * @throws NullPointerException if user name is null or empty String or if the closure is null. + * @throws IllegalArgumentException if user name is null or empty String or if the closure is null. */ public static T doAs(String user, final Callable clbl) throws Exception { if (F.isEmpty(user)) - // use NPE to ensure that #doAs() caller will not treat this exception - // as the one thrown from the closure: - // TODO: use IllegalArgument or IgniteException - throw new NullPointerException("Failed to use null or empty user name."); + throw new IllegalArgumentException("Failed to use null or empty user name."); final String ctxUser = userStackThreadLocal.get(); @@ -120,7 +111,7 @@ public abstract class IgfsUserContext { * If this method is invoked outside of any {@link #doAs(String, IgniteOutClosure)} on the call stack, it will return null. * Otherwise it will return the user name set in the most lower {@link #doAs(String, IgniteOutClosure)} call * on the call stack. - * @return the current user, may be null. + * @return The current user, may be null. */ @Nullable public static String currentUser() { return userStackThreadLocal.get();