@Override public void visitClassExpression(final ClassExpression expression) { super.visitClassExpression(expression); ClassNode cn = (ClassNode) expression.getNodeMetaData(StaticTypesMarker.INFERRED_TYPE); if (cn == null) { storeType(expression, getType(expression)); } }
private void handleClassNode(final ClassNode classNode) { final List<AnnotationNode> annotationNodes = AnnotationUtils.hasMetaAnnotations(classNode, ContractElement.class.getName()); for (AnnotationNode annotationNode : annotationNodes) { final AnnotationProcessor annotationProcessor = createAnnotationProcessor(annotationNode); if (annotationProcessor != null && annotationNode.getMember(CLOSURE_ATTRIBUTE_NAME) instanceof ClassExpression) { final ClassExpression closureClassExpression = (ClassExpression) annotationNode.getMember(CLOSURE_ATTRIBUTE_NAME); MethodCallExpression doCall = new MethodCallExpression( new ConstructorCallExpression(closureClassExpression.getType(), new ArgumentListExpression(VariableExpression.THIS_EXPRESSION, VariableExpression.THIS_EXPRESSION)), "doCall", ArgumentListExpression.EMPTY_ARGUMENTS ); doCall.setMethodTarget(closureClassExpression.getType().getMethods("doCall").get(0)); final BooleanExpression booleanExpression = new BooleanExpression(doCall); booleanExpression.setSourcePosition(annotationNode); annotationProcessor.process(pci, pci.contract(), classNode, (BlockStatement) closureClassExpression.getNodeMetaData(AnnotationClosureVisitor.META_DATA_ORIGINAL_TRY_CATCH_BLOCK), booleanExpression); } } }
booleanExpression.setSourcePosition(annotationNode); annotationProcessor.process(pci, pci.contract(), methodNode.getDeclaringClass(), methodNode, (BlockStatement) closureClassExpression.getNodeMetaData(AnnotationClosureVisitor.META_DATA_ORIGINAL_TRY_CATCH_BLOCK), booleanExpression);