[
https://issues.apache.org/jira/browse/CASSANDRA-3796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194586#comment-13194586
]
Sylvain Lebresne commented on CASSANDRA-3796:
---------------------------------------------
This is just a generics problem (for some reason Java 7 became more picky about
this, one could almost call it a bug but anyway) so I'd prefer not adding real
code to fix (though I don't think there was anything wrong with the patch per
se). Committed
http://git-wip-us.apache.org/repos/asf?p=cassandra.git;a=commit;h=00613729 that
adds enough generic info for the compiler to stop complaining. I'll let you
check this fixes it for you too.
As a side note, the generics missing info was for DecoratedKey. DK has been
generic for as long as I can remember but I don't really think this is of any
use in that case, so it could be worth removing the type parameter from DK
altogether, which would avoid adding a <?> every time. This would affect a high
number of lines though (all those where we have DK<?>) so I've sticked to just
adding the generic info for now.
> post-2392 trunk does not build with java 7
> ------------------------------------------
>
> Key: CASSANDRA-3796
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3796
> Project: Cassandra
> Issue Type: Bug
> Reporter: Peter Schuller
> Assignee: Peter Schuller
> Priority: Minor
> Attachments: CASSANDRA-3796-trunk-v1.txt
>
>
> See below, on a fresh clone. Builds w/ java 6.
> {code}
> [javac]
> /tmp/c2/cassandra/src/java/org/apache/cassandra/io/sstable/SSTableReader.java:419:
> error: no suitable method found for
> binarySearch(List<DecoratedKey>,RowPosition)
> [javac] int index =
> Collections.binarySearch(indexSummary.getKeys(), key);
> [javac] ^
> [javac] method Collections.<T#1>binarySearch(List<? extends
> T#1>,T#1,Comparator<? super T#1>) is not applicable
> [javac] (cannot instantiate from arguments because actual and
> formal argument lists differ in length)
> [javac] method Collections.<T#2>binarySearch(List<? extends
> Comparable<? super T#2>>,T#2) is not applicable
> [javac] (no instance(s) of type variable(s) T#2 exist so that
> argument type List<DecoratedKey> conforms to formal parameter type List<?
> extends Comparable<? super T#2>>)
> [javac] where T#1,T#2 are type-variables:
> [javac] T#1 extends Object declared in method
> <T#1>binarySearch(List<? extends T#1>,T#1,Comparator<? super T#1>)
> [javac] T#2 extends Object declared in method
> <T#2>binarySearch(List<? extends Comparable<? super T#2>>,T#2)
> [javac]
> /tmp/c2/cassandra/src/java/org/apache/cassandra/io/sstable/SSTableReader.java:509:
> error: no suitable method found for
> binarySearch(List<DecoratedKey>,RowPosition)
> [javac] int left = Collections.binarySearch(samples,
> leftPosition);
> [javac] ^
> [javac] method Collections.<T#1>binarySearch(List<? extends
> T#1>,T#1,Comparator<? super T#1>) is not applicable
> [javac] (cannot instantiate from arguments because actual and
> formal argument lists differ in length)
> [javac] method Collections.<T#2>binarySearch(List<? extends
> Comparable<? super T#2>>,T#2) is not applicable
> [javac] (no instance(s) of type variable(s) T#2 exist so that
> argument type List<DecoratedKey> conforms to formal parameter type List<?
> extends Comparable<? super T#2>>)
> [javac] where T#1,T#2 are type-variables:
> [javac] T#1 extends Object declared in method
> <T#1>binarySearch(List<? extends T#1>,T#1,Comparator<? super T#1>)
> [javac] T#2 extends Object declared in method
> <T#2>binarySearch(List<? extends Comparable<? super T#2>>,T#2)
> [javac]
> /tmp/c2/cassandra/src/java/org/apache/cassandra/io/sstable/SSTableReader.java:521:
> error: no suitable method found for
> binarySearch(List<DecoratedKey>,RowPosition)
> [javac] : Collections.binarySearch(samples,
> rightPosition);
> [javac] ^
> [javac] method Collections.<T#1>binarySearch(List<? extends
> T#1>,T#1,Comparator<? super T#1>) is not applicable
> [javac] (cannot instantiate from arguments because actual and
> formal argument lists differ in length)
> [javac] method Collections.<T#2>binarySearch(List<? extends
> Comparable<? super T#2>>,T#2) is not applicable
> [javac] (no instance(s) of type variable(s) T#2 exist so that
> argument type List<DecoratedKey> conforms to formal parameter type List<?
> extends Comparable<? super T#2>>)
> [javac] where T#1,T#2 are type-variables:
> [javac] T#1 extends Object declared in method
> <T#1>binarySearch(List<? extends T#1>,T#1,Comparator<? super T#1>)
> [javac] T#2 extends Object declared in method
> <T#2>binarySearch(List<? extends Comparable<? super T#2>>,T#2)
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira