Skip to content

Commit

Permalink
Revert this as it was not intended at all
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Mar 24, 2015
1 parent 060a5c6 commit a30042c
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 81 deletions.
10 changes: 1 addition & 9 deletions src/main/java/io/vertx/codegen/ClassModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -755,15 +755,7 @@ private List<ParamInfo> 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> 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);
Expand Down
31 changes: 0 additions & 31 deletions src/test/java/io/vertx/test/codegen/GeneratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit a30042c

Please sign in to comment.