cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Ellis (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-4697) incorrect debug message in LeveledManifest.java
Date Fri, 21 Sep 2012 15:16:07 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-4697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13460550#comment-13460550
] 

Jonathan Ellis commented on CASSANDRA-4697:
-------------------------------------------

Arrays.asList returns ArrayList extends AbstractList extends AbstractCollection, and AbstractCollection.toString
is

{code}
    public String toString() {
        Iterator<E> i = iterator();
	if (! i.hasNext())
	    return "[]";

	StringBuilder sb = new StringBuilder();
	sb.append('[');
	for (;;) {
	    E e = i.next();
	    sb.append(e == this ? "(this Collection)" : e);
	    if (! i.hasNext())
		return sb.append(']').toString();
	    sb.append(", ");
	}
    }
{code}

                
> incorrect debug message in LeveledManifest.java
> -----------------------------------------------
>
>                 Key: CASSANDRA-4697
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4697
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.0.11, 1.1.5
>            Reporter: Radim Kolar
>            Priority: Trivial
>
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
line 622.
> logger.debug("Estimating {} compactions to do for {}.{}",
> new Object[] {Arrays.asList(estimated), cfs.table.name, cfs.columnFamily});
> It does not print list as intended. Arrays.asList(estimated).toString() results in object
reference number, not list itself making debug message useless.
> list should be printed by code like this:
>    String delim = "";
>     for (Item i : list) {
>         sb.append(delim).append(i);
>         delim = ",";
>     }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message