for (final Method method : type.getDeclaredMethods()) { final JavaReflectionMethod metaMethod = new JavaReflectionMethod(this, method); final String readableMethodDecl = GenUtil.getMethodString(metaMethod); if (!metaMethod.isPrivate() && !method.isBridge() && !processedMethods.contains(readableMethodDecl)) { meths.add(metaMethod); final String readableMethodDecl = GenUtil.getMethodString(ifaceMethod); if (!processedMethods.contains(readableMethodDecl)) { meths.add(ifaceMethod);
for (final Method method : type.getDeclaredMethods()) { final JavaReflectionMethod metaMethod = new JavaReflectionMethod(this, method); final String readableMethodDecl = GenUtil.getMethodString(metaMethod); if (!metaMethod.isPrivate() && !method.isBridge() && !processedMethods.contains(readableMethodDecl)) { meths.add(metaMethod); final String readableMethodDecl = GenUtil.getMethodString(ifaceMethod); if (!processedMethods.contains(readableMethodDecl)) { meths.add(ifaceMethod);
private MetaMethod validateExceptionHandlingMethod(final Decorable decorable) { // Ensure that method has exactly one parameter of type Throwable final MetaMethod method = decorable.getAsMethod(); final MetaParameter[] parms = method.getParameters(); if (!(parms.length == 1 && parms[0].getType().equals(MetaClassFactory.get(Throwable.class)))) { throw new GenerationException("Methods annotated with " + UncaughtExceptionHandler.class.getName() + " must have exactly one parameter of type " + Throwable.class.getName() + ". Invalid parameters in method: " + GenUtil.getMethodString(method) + " of type " + method.getDeclaringClass() + "."); } return method; }
for (final JMethod jMethod : type.getMethods()) { final GWTMethod gwtMethod = new GWTMethod(oracle, jMethod); final String readableMethodDecl = GenUtil.getMethodString(gwtMethod); if (!jMethod.isPrivate() && !processedMethods.contains(readableMethodDecl)) { meths.add(gwtMethod); final String readableMethodDecl = GenUtil.getMethodString(ifaceMethod); if (!processedMethods.contains(readableMethodDecl)) { meths.add(ifaceMethod);
for (final JMethod jMethod : type.getMethods()) { final GWTMethod gwtMethod = new GWTMethod(oracle, jMethod); final String readableMethodDecl = GenUtil.getMethodString(gwtMethod); if (!jMethod.isPrivate() && !processedMethods.contains(readableMethodDecl)) { meths.add(gwtMethod); final String readableMethodDecl = GenUtil.getMethodString(ifaceMethod); if (!processedMethods.contains(readableMethodDecl)) { meths.add(ifaceMethod);
@Test public void testGetMethods() { final MetaClass c = getMetaClass(Child.class); final MetaMethod[] methods = c.getMethods(); assertNotNull(methods); final List<String> methodSignatures = new ArrayList<>(); for(final MetaMethod m : methods) { methodSignatures.add(GenUtil.getMethodString(m)); } final List<String> expectedMethods = new ArrayList<>(); expectedMethods.add("protectedMethod([])"); expectedMethods.add("interfaceMethodOverriddenMultipleTimes([])"); expectedMethods.add("packagePrivateMethod([])"); expectedMethods.add("finalize([])"); expectedMethods.add("equals([java.lang.Object])"); expectedMethods.add("toString([])"); expectedMethods.add("notify([])"); expectedMethods.add("wait([])"); expectedMethods.add("clone([])"); expectedMethods.add("notifyAll([])"); expectedMethods.add("getClass([])"); expectedMethods.add("wait([long])"); expectedMethods.add("hashCode([])"); expectedMethods.add("wait([long, int])"); Collections.sort(expectedMethods); Collections.sort(methodSignatures); assertEquals(expectedMethods.toString(), methodSignatures.toString()); }
@Override public void generateDecorator(final Decorable decorable, final FactoryController controller) { MetaMethod method = decorable.getAsMethod(); MetaParameter[] params = method.getParameters(); if (params.length != 1 || !params[0].getType().getErased().equals(MetaClassFactory.get(SyncResponses.class))) { throw new GenerationException("Methods annotated with @" + Sync.class.getName() + " need to have exactly one parameter of type: " + SyncResponses.class.getName() + ". Check method: " + GenUtil.getMethodString(method) + " in class " + method.getDeclaringClass().getFullyQualifiedName()); } Sync syncAnnotation = (Sync) decorable.getAnnotation(); controller.addInitializationStatements(createInitStatements(decorable.getDecorableDeclaringType(), "obj", syncAnnotation, decorable, controller)); final Statement syncWorker = controller.getReferenceStmt("syncWorker", ClientSyncWorker.class); final Statement destruction = Stmt.nestedCall(syncWorker).invoke("stop"); controller.addDestructionStatements(Collections.singletonList(destruction)); }
final String methodString = GenUtil.getMethodString(method); if (renderedMethods.contains(methodString) || method.getName().equals("hashCode") || method.getName().equals("clone") || method.getName().equals("finalize")
final String methodString = GenUtil.getMethodString(method); if (renderedMethods.contains(methodString) || method.getName().equals("hashCode") || method.getName().equals("clone") || method.getName().equals("finalize")