Skip to content

Commit

Permalink
Fix some of FindBugs findings.
Browse files Browse the repository at this point in the history
Change-Id: I2294160bd30729fff49c1645eff2764689e277bd
Reviewed-by: Benoit Sigoure <tsuna@stumbleupon.com>
Tested-by: Benoit Sigoure <tsuna@stumbleupon.com>
  • Loading branch information
bdd authored and tsuna committed Mar 16, 2011
1 parent ee6f07f commit 0cffb47
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/core/RowSeq.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ final class RowSeq implements DataPoints {
*/
void setRow(final ArrayList<KeyValue> row) {
final byte[] key = row.get(0).key();
final long base_time = Bytes.getUnsignedInt(key, tsdb.metrics.width());

if (this.key == null) {
this.key = key;
Expand Down
4 changes: 0 additions & 4 deletions src/core/TsdbQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,7 @@ private DataPoints[] groupByAndAggregate(final TreeMap<byte[], Span> spans) {
// - one for the LOL-OMG combination: [0, 0, 1, 0, 0, 4] and,
// - one for the LOL-WTF combination: [0, 0, 1, 0, 0, 3].
final ByteMap<SpanGroup> groups = new ByteMap<SpanGroup>();
final short metric_ts_bytes = (short) (tsdb.metrics.width()
+ Const.TIMESTAMP_BYTES);
final short name_width = tsdb.tag_names.width();
final short value_width = tsdb.tag_values.width();
final short tag_bytes = (short) (name_width + value_width);
final byte[] group = new byte[group_bys.size() * value_width];
for (final Map.Entry<byte[], Span> entry : spans.entrySet()) {
final byte[] row = entry.getKey();
Expand Down
10 changes: 5 additions & 5 deletions src/tsd/RpcHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public String toString() {
}

/** The "exit" command. */
private final class Exit implements TelnetRpc {
private static final class Exit implements TelnetRpc {
public Deferred<Object> execute(final TSDB tsdb, final Channel chan,
final String[] cmd) {
chan.disconnect();
Expand Down Expand Up @@ -483,10 +483,10 @@ private void logError(final HttpQuery query, final String msg) {
LOG.error(query.channel().toString() + ' ' + msg);
}

private static void logError(final HttpQuery query, final String msg,
final Exception e) {
LOG.error(query.channel().toString() + ' ' + msg, e);
}
//private static void logError(final HttpQuery query, final String msg,
// final Exception e) {
// LOG.error(query.channel().toString() + ' ' + msg, e);
//}

//private void logInfo(final Channel chan, final String msg) {
// LOG.info(chan.toString() + ' ' + msg);
Expand Down
2 changes: 1 addition & 1 deletion src/tsd/client/DateTimeBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public DateTimeBox() {
/**
* A {@link DatePicker} with a customized UI for time support.
*/
private final static class DateTimePicker extends DatePicker {
private static final class DateTimePicker extends DatePicker {

/** DateTimeBox this picker belongs to. */
private DateTimeBox box;
Expand Down
2 changes: 1 addition & 1 deletion src/uid/UniqueId.java
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public List<String> suggest(final String search) throws HBaseException {
final byte[] key = row.get(0).key();
final String name = fromBytes(key);
final byte[] id = row.get(0).value();
final String cached_name = idCache.get(id);
final String cached_name = idCache.get(new String(id));
if (cached_name == null) {
addIdToCache(name, id);
addNameToCache(id, name);
Expand Down

0 comments on commit 0cffb47

Please sign in to comment.