title: Why does WELD throw an UnsupportedOperationException even though my interface comes with default method implementations?
body: <p>A few days weeks RedHat released <strong>JBoss EAP 7.1.0</strong> and so I've started to do some first tests with our application (EAR with Model (JPA), EJB (CDI) and Web). We've used EAP 7.0.7 recently – so the version gap is rather small.</p>
  
  <p>It took only a few seconds to run into the first major problem. WELD now throws an <code>org.jboss.weld.exceptions.UnsupportedOperationException</code> without any additional message whenever we try to call a <code>default</code> implementation provided by an interface. <strong>Why are default implementations from interfaces not supported?</strong></p>
  
  <p><strong>NOTE:</strong> The interface implements this method... it's not the empty method declaration!</p>
  
  <p><em>Here is an example for such an interface:</em></p>
  
  <pre><code>public interface Feature {
      default boolean desiresNewConversation() {
          return false;
      }
  }
  </code></pre>
  
  <p><em>A simple bean implementing that interface:</em></p>
  
  <pre><code>@Named
  public class MyFeature implements Feature, Serializable {
      public String getName() {
          return "Example";
      }
      // Class does NOT override the default method of the interface.
  }
  </code></pre>
  
  <p><em>A simple manager class for the UI:</em></p>
  
  <pre><code>@Named
  public class FeatureManager implements Serializable {
      public void start(Feature f) {
          // ...
      }
      public String propagation(Feature f) {
          return f.desiresNewConversation() ? "none" : "join";
      }
  }
  </code></pre>
  
  <p><em>And the xhtml referencing that method:</em></p>
  
  <pre><code>&lt;h:form&gt;
      &lt;h:commandButton value="#{myFeature.name}" action="#{featureManager.start(myFeature)}"&gt;
          &lt;f:param name="conversationPropagation" value="#{featureManager.propagation(myFeature)}" /&gt;
      &lt;/h:commandButton&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>This throws the following shortened stacktrace:</p>
  
  <pre><code>Caused by: org.jboss.weld.exceptions.UnsupportedOperationException: 
      at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:49)
      at my.package.MyFeature$Proxy$_$$_WeldSubclass.desiresNewConversation(Unknown Source)
      at my.package.FeatureManager.propagation(FeatureManage.java:67)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at javax.el.ELUtil.invokeMethod(ELUtil.java:311)
      ... 107 more
  </code></pre>
  
  <p>This is only a simple example. I'm having this effect on many other default methods provided by interfaces. The <code>WeldSubclass</code> won't handle those implementations anymore which made no problem with EAP 7.0.7 and earlier versions.</p>
  
  <p>As soon as I override that method in <code>MyFeature</code> those exceptions are gone.</p>
  
  <pre><code>@Named
  public class MyFeature implements Feature {
      public String getName() {
          return "Example";
      }
      @Override
      public boolean desiresNewConversation() {
          return Feature.super.desiresNewConversation();
      }
  }
  </code></pre>
  
  <p>Our application uses several of these default interface implementations and consists of many hundreds of classes implementing those interfaces. <strong>Is there any practical way to solve this other then avoiding default interface implementations at all?</strong></p>
  
  <p><strong>PS</strong>: Keep in mind that <code>WeldSubclass</code> is a proxy applied by WELD and not my own class. The exception is thrown by the newer WELD implementation of EAP 7.1.0 compared to EAP 7.0.7 where this was legit. And the exception is not even explained with any additional information that might give some reasons for that unexpected change.</p>