Repository: cassandra Updated Branches: refs/heads/trunk c770256a7 -> f47863e13
fix warnings for _ as identifier patch by Robert Stupp; reviewed by jbellis for CASSANDRA-7675 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f47863e1 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f47863e1 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f47863e1 Branch: refs/heads/trunk Commit: f47863e13c91566aca5f8a25cfa247b7ea27ec59 Parents: c770256 Author: Jonathan Ellis <jbel...@apache.org> Authored: Mon Aug 4 07:28:58 2014 -0500 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Mon Aug 4 07:28:58 2014 -0500 ---------------------------------------------------------------------- .../unit/org/apache/cassandra/io/util/DataOutputTest.java | 3 ++- .../cassandra/stress/settings/OptionDistribution.java | 10 +++++----- .../cassandra/stress/settings/OptionReplication.java | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f47863e1/test/unit/org/apache/cassandra/io/util/DataOutputTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/io/util/DataOutputTest.java b/test/unit/org/apache/cassandra/io/util/DataOutputTest.java index 76f3304..fcf7721 100644 --- a/test/unit/org/apache/cassandra/io/util/DataOutputTest.java +++ b/test/unit/org/apache/cassandra/io/util/DataOutputTest.java @@ -236,8 +236,9 @@ public class DataOutputTest test.readInt(); assert false; } - catch (EOFException _) + catch (EOFException ignore) { + // it worked } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/f47863e1/tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java ---------------------------------------------------------------------- diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java b/tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java index 70a85ae..b01e55a 100644 --- a/tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java +++ b/tools/stress/src/org/apache/cassandra/stress/settings/OptionDistribution.java @@ -189,7 +189,7 @@ public class OptionDistribution extends Option stdev = ((max - min) / 2d) / stdevsToEdge; } return new GaussianFactory(min, max, mean, stdev); - } catch (Exception _) + } catch (Exception e) { throw new IllegalArgumentException("Invalid parameter list for uniform distribution: " + params); } @@ -213,7 +213,7 @@ public class OptionDistribution extends Option // over entire range, but this results in overly skewed distribution, so take sqrt final double mean = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min))); return new ExpFactory(min, max, mean); - } catch (Exception _) + } catch (Exception e) { throw new IllegalArgumentException("Invalid parameter list for uniform distribution: " + params); } @@ -238,7 +238,7 @@ public class OptionDistribution extends Option // over entire range, but this results in overly skewed distribution, so take sqrt final double scale = (max - min) / findBounds.inverseCumulativeProbability(1d - Math.sqrt(1d/(max-min))); return new ExtremeFactory(min, max, shape, scale); - } catch (Exception _) + } catch (Exception e) { throw new IllegalArgumentException("Invalid parameter list for extreme (Weibull) distribution: " + params); } @@ -259,7 +259,7 @@ public class OptionDistribution extends Option final long min = parseLong(bounds[0]); final long max = parseLong(bounds[1]); return new UniformFactory(min, max); - } catch (Exception _) + } catch (Exception e) { throw new IllegalArgumentException("Invalid parameter list for uniform distribution: " + params); } @@ -278,7 +278,7 @@ public class OptionDistribution extends Option { final long key = parseLong(params.get(0)); return new FixedFactory(key); - } catch (Exception _) + } catch (Exception e) { throw new IllegalArgumentException("Invalid parameter list for uniform distribution: " + params); } http://git-wip-us.apache.org/repos/asf/cassandra/blob/f47863e1/tools/stress/src/org/apache/cassandra/stress/settings/OptionReplication.java ---------------------------------------------------------------------- diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/OptionReplication.java b/tools/stress/src/org/apache/cassandra/stress/settings/OptionReplication.java index 06ec9b8..291dd53 100644 --- a/tools/stress/src/org/apache/cassandra/stress/settings/OptionReplication.java +++ b/tools/stress/src/org/apache/cassandra/stress/settings/OptionReplication.java @@ -80,8 +80,9 @@ class OptionReplication extends OptionMulti throw new IllegalArgumentException(clazz + " is not a replication strategy"); strategy = fullname; break; - } catch (Exception _) + } catch (Exception ignore) { + // will throw below if strategy is still null } } if (strategy == null)