Status: New
Owner: ----

New issue 804 by [email protected]: Line number issue under java 8 and guice 4.0 beta 4
http://code.google.com/p/google-guice/issues/detail?id=804

Failure when trying to report injection errors when use of static methods on interface is present.

The failure comes from the line number stuff using ASM:

Exception in thread "main" com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException: INVOKESPECIAL/STATIC on interfaces require ASM 5 at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
       at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
       at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) at com.google.inject.internal.util.StackTraceElements.forMember(StackTraceElements.java:66)
       at com.google.inject.internal.Errors.formatSource(Errors.java:764)
       at com.google.inject.internal.Errors.formatSource(Errors.java:743)
at com.google.inject.internal.Errors.formatInjectionPoint(Errors.java:794)


Here is a standalone example to reproduce:

import com.google.inject.AbstractModule;
import com.google.inject.Guice;

public class Test
{
    public Test()
    {
        throw new RuntimeException("No chance");
    }

    void doStatic()
    {
        X.something();
    }

    interface X
    {
        static int something()
        {
            return 1;
        }
    }

    private static class TestModule extends AbstractModule
    {

        @Override
        protected void configure()
        {
            bind(Test.class).asEagerSingleton();
        }

    }

    public static void main(String[] args)
    {
        try
        {
            System.err.println("ABOUT TO GO");
            Guice.createInjector(new TestModule());
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to