accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russ Weeks (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-3789) Code compiled against 1.6 lexicoders can't run in 1.7
Date Sun, 10 May 2015 01:57:59 GMT


Russ Weeks commented on ACCUMULO-3789:

I didn't realize it auto-assigned to you, Josh.  I'm happy to take it on if your plate is

I have a feeling that the problem occurred when the method {{public Long decode(byte[] data)}}
in {{LongLexicoder}} was effectively changed to {{public T decode(byte[] b)}} in {{AbstractEncoder}}.
The [JLS supports|] "moving a
method upward in the class hierarchy", but this isn't really moving a method. Because the
generic type info is removed at runtime, I figure that the new method works out to {{public
Object decode(byte[] b)}}, which isn't sufficient for the 1.6-compiled code to run against.

I'm thinking that the only solution is to provide concrete implementations in the *Lexicoders
that just delegate to their parents. So,
public Long decode(byte[] data) {
    return super.decode(data);
In the LongLexicoder, and corresponding methods in all the other lexicoders. With a comment
indicating that this code is meant to preserve backwards compatibility and doesn't need to
exist in any newly-defined lexicoders.

> Code compiled against 1.6 lexicoders can't run in 1.7
> -----------------------------------------------------
>                 Key: ACCUMULO-3789
>                 URL:
>             Project: Accumulo
>          Issue Type: Bug
>    Affects Versions: 1.7.0
>         Environment: Development environment
>            Reporter: Russ Weeks
>            Assignee: Josh Elser
>            Priority: Blocker
>             Fix For: 1.7.0
>         Attachments: TestLexicoderCompat.tar.gz
> Code which was built against the 1.6 Lexicoders will fail with a NoSuchMethod error when
run against the 1.7 jars.
> Test case is attached. Sorry it depends on Gradle, the build file is pretty trivial.
> h3. Steps to reproduce
> * Deploy accumulo 1.7.0-SNAPSHOT jars to local maven repository, I did {{mvn -DskipTests
-Dfindbugs.skip=true install}} on commit 31dd5ca
> * Untar attached file TestLexicoderCompat.tar.gz, run {{gradle clean test}}
> h3. Expected Result
> * All unit tests pass
> h3. Actual Result
> * The unit test "TestLexicoderCompatibility" fails with the error:
> {noformat}
> java.lang.NoSuchMethodError: org.apache.accumulo.core.client.lexicoder.LongLexicoder.decode([B)Ljava/lang/Long;
> 	at lexicoder.TestLexicoderCompatibility.testLexicoderBackwardsCompatibility(
> 	[snip]
> {noformat}
> * Switching the {{testRuntime}} dependency to 1.6.1 instead of 1.7.0-SNAPSHOT will cause
the test to pass.

This message was sent by Atlassian JIRA

View raw message