diff --git a/src/main/java/io/vertx/codegen/ClassModel.java b/src/main/java/io/vertx/codegen/ClassModel.java index fa8bce56c..4dd82a8a2 100644 --- a/src/main/java/io/vertx/codegen/ClassModel.java +++ b/src/main/java/io/vertx/codegen/ClassModel.java @@ -755,15 +755,7 @@ private List getParams(ExecutableElement execElem, ExecutableType exe } catch (Exception e) { throw new GenException(param, e.getMessage()); } - TypeElement handlerElt = elementUtils.getTypeElement(VERTX_HANDLER); - ExecutableElement handlerMeth = (ExecutableElement) handlerElt.getEnclosedElements().get(0); - if (handlerMeth.equals(execElem)) { - // Special case : create an Handler type - DeclaredType handlerType = typeUtils.getDeclaredType(handlerElt, type); - checkParamType(execElem, handlerType, typeFactory.create(handlerType), i, params.size()); - } else { - checkParamType(execElem, type, typeInfo, i, params.size()); - } + checkParamType(execElem, type, typeInfo, i, params.size()); String name = param.getSimpleName().toString(); ParamInfo mParam = new ParamInfo(name, descs.get(name), typeInfo); mParams.add(mParam); diff --git a/src/test/java/io/vertx/test/codegen/GeneratorTest.java b/src/test/java/io/vertx/test/codegen/GeneratorTest.java index 89daf74a7..7d7c64171 100644 --- a/src/test/java/io/vertx/test/codegen/GeneratorTest.java +++ b/src/test/java/io/vertx/test/codegen/GeneratorTest.java @@ -133,10 +133,8 @@ import io.vertx.test.codegen.testapi.fluent.FluentMethodWithVoidReturn; import io.vertx.test.codegen.testapi.fluent.InterfaceWithFluentMethodOverrideFromAbstract; import io.vertx.test.codegen.testapi.fluent.InterfaceWithFluentMethodOverrideFromConcrete; -import io.vertx.test.codegen.testapi.handler.InterfaceExtendingAsyncResultHandler; import io.vertx.test.codegen.testapi.handler.InterfaceExtendingHandlerStringSubtype; import io.vertx.test.codegen.testapi.handler.InterfaceExtendingHandlerVertxGenSubtype; -import io.vertx.test.codegen.testapi.handler.InterfaceExtendingInvalidAsyncResultHandler; import io.vertx.test.codegen.testapi.impl.InterfaceInImplPackage; import io.vertx.test.codegen.testapi.impl.sub.InterfaceInImplParentPackage; import io.vertx.test.codegen.testapi.simple.InterfaceInImplContainingPackage; @@ -1624,35 +1622,6 @@ public void testInterfaceExtendingHandlerVertxGenSubtype() throws Exception { checkMethod(model.getMethodMap().get("handle").get(0), "handle", null, MethodKind.OTHER, "void", false, false, false, 1); } - @Test - public void testInterfaceExtendingAsyncResultHandler() throws Exception { - for (Class clazz : Arrays.asList(InterfaceExtendingAsyncResultHandler.class, InterfaceExtendingAsyncResultHandler.class)) { - ClassModel model = new Generator().generateClass(clazz); - TypeInfo.Parameterized handlerSuperType = (TypeInfo.Parameterized) model.getHandlerSuperType(); - assertEquals(1, handlerSuperType.getArgs().size()); - TypeInfo.Class.Api apiType = (TypeInfo.Class.Api) model.getType(); - assertTrue(apiType.isHandler()); - TypeInfo handlerArg = apiType.getHandlerArg(); - assertEquals(TypeInfo.create(AsyncResult.class), handlerArg.getRaw()); - assertEquals(TypeInfo.create(String.class), ((TypeInfo.Parameterized) handlerArg).getArgs().get(0)); - assertFalse(apiType.isReadStream()); - assertFalse(apiType.isWriteStream()); - assertEquals(1, model.getMethodMap().size()); - assertEquals(1, model.getMethodMap().get("handle").size()); - checkMethod(model.getMethodMap().get("handle").get(0), "handle", null, MethodKind.OTHER, "void", false, false, false, 1); - } - } - - @Test - public void testInterfaceExtendingInvalidAsyncResultHandler() throws Exception { - try { - new Generator().generateClass(InterfaceExtendingInvalidAsyncResultHandler.class); - fail("Invalid async result handler extension should fail"); - } catch (GenException e) { - // pass - } - } - @Test public void testMethodInvalidListReturn2() throws Exception { try { diff --git a/src/test/java/io/vertx/test/codegen/testapi/handler/InterfaceExtendingAsyncResultHandler.java b/src/test/java/io/vertx/test/codegen/testapi/handler/InterfaceExtendingAsyncResultHandler.java deleted file mode 100644 index fcb537fd3..000000000 --- a/src/test/java/io/vertx/test/codegen/testapi/handler/InterfaceExtendingAsyncResultHandler.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.vertx.test.codegen.testapi.handler; - -import io.vertx.codegen.annotations.VertxGen; -import io.vertx.core.AsyncResult; -import io.vertx.core.Handler; - -/** - * @author Tim Fox - */ -@VertxGen -public interface InterfaceExtendingAsyncResultHandler extends Handler> { -} diff --git a/src/test/java/io/vertx/test/codegen/testapi/handler/InterfaceExtendingInvalidAsyncResultHandler.java b/src/test/java/io/vertx/test/codegen/testapi/handler/InterfaceExtendingInvalidAsyncResultHandler.java deleted file mode 100644 index a1196f279..000000000 --- a/src/test/java/io/vertx/test/codegen/testapi/handler/InterfaceExtendingInvalidAsyncResultHandler.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.vertx.test.codegen.testapi.handler; - -import io.vertx.codegen.annotations.VertxGen; -import io.vertx.core.AsyncResult; -import io.vertx.core.Handler; -import io.vertx.test.codegen.testapi.NonVertxGenInterface; - -/** - * @author Tim Fox - */ -@VertxGen -public interface InterfaceExtendingInvalidAsyncResultHandler extends Handler> { -} diff --git a/src/test/java/io/vertx/test/codegen/testapi/handler/InterfaceOverridingAsyncResultHandler.java b/src/test/java/io/vertx/test/codegen/testapi/handler/InterfaceOverridingAsyncResultHandler.java deleted file mode 100644 index d4e6fb01a..000000000 --- a/src/test/java/io/vertx/test/codegen/testapi/handler/InterfaceOverridingAsyncResultHandler.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.vertx.test.codegen.testapi.handler; - -import io.vertx.codegen.annotations.VertxGen; -import io.vertx.core.AsyncResult; -import io.vertx.core.Handler; - -/** - * @author Tim Fox - */ -@VertxGen -public interface InterfaceOverridingAsyncResultHandler extends Handler> { - - // Explicit override - @Override - void handle(AsyncResult stringAsyncResult); -}