diff --git a/src/checkers/inference/InferenceVisitor.java b/src/checkers/inference/InferenceVisitor.java index c79c7f32..f9496c6c 100644 --- a/src/checkers/inference/InferenceVisitor.java +++ b/src/checkers/inference/InferenceVisitor.java @@ -860,56 +860,56 @@ protected void checkConstructorResult( } } - @Override - public Void visitNewClass(NewClassTree tree, Void p) { - if (!infer) { - super.visitNewClass(tree, p); - } - if (checker.shouldSkipUses(TreeUtils.elementFromUse(tree))) { - return super.visitNewClass(tree, p); - } - - AnnotatedTypeFactory.ParameterizedExecutableType fromUse = atypeFactory.constructorFromUse(tree); - AnnotatedExecutableType constructorType = fromUse.executableType; - List typeargs = fromUse.typeArgs; - - List passedArguments = tree.getArguments(); - List params = - AnnotatedTypes.adaptParameters(atypeFactory, constructorType, passedArguments); - - ExecutableElement constructor = constructorType.getElement(); - CharSequence constructorName = ElementUtils.getSimpleNameOrDescription(constructor); - - checkArguments(params, passedArguments, constructorName, constructor.getParameters()); - checkVarargs(constructorType, tree); - - List paramBounds = - CollectionsPlume.mapList( - AnnotatedTypeVariable::getBounds, constructorType.getTypeVariables()); - - checkTypeArguments( - tree, - paramBounds, - typeargs, - tree.getTypeArguments(), - constructorName, - constructor.getTypeParameters()); - - boolean valid = validateTypeOf(tree); - - if (valid) { - AnnotatedDeclaredType dt = atypeFactory.getAnnotatedType(tree); - atypeFactory.getDependentTypesHelper().checkTypeForErrorExpressions(dt, tree); - checkConstructorInvocation(dt, constructorType, tree); - } - // Do not call super, as that would observe the arguments without - // a set assignment context. - scan(tree.getEnclosingExpression(), p); - scan(tree.getIdentifier(), p); - scan(tree.getClassBody(), p); - - return null; - } +// @Override +// public Void visitNewClass(NewClassTree tree, Void p) { +// if (!infer) { +// super.visitNewClass(tree, p); +// } +// if (checker.shouldSkipUses(TreeUtils.elementFromUse(tree))) { +// return super.visitNewClass(tree, p); +// } +// +// AnnotatedTypeFactory.ParameterizedExecutableType fromUse = atypeFactory.constructorFromUse(tree); +// AnnotatedExecutableType constructorType = fromUse.executableType; +// List typeargs = fromUse.typeArgs; +// +// List passedArguments = tree.getArguments(); +// List params = +// AnnotatedTypes.adaptParameters(atypeFactory, constructorType, passedArguments); +// +// ExecutableElement constructor = constructorType.getElement(); +// CharSequence constructorName = ElementUtils.getSimpleNameOrDescription(constructor); +// +// checkArguments(params, passedArguments, constructorName, constructor.getParameters()); +// checkVarargs(constructorType, tree); +// +// List paramBounds = +// CollectionsPlume.mapList( +// AnnotatedTypeVariable::getBounds, constructorType.getTypeVariables()); +// +// checkTypeArguments( +// tree, +// paramBounds, +// typeargs, +// tree.getTypeArguments(), +// constructorName, +// constructor.getTypeParameters()); +// +// boolean valid = validateTypeOf(tree); +// +// if (valid) { +// AnnotatedDeclaredType dt = atypeFactory.getAnnotatedType(tree); +// atypeFactory.getDependentTypesHelper().checkTypeForErrorExpressions(dt, tree); +// checkConstructorInvocation(dt, constructorType, tree); +// } +// // Do not call super, as that would observe the arguments without +// // a set assignment context. +// scan(tree.getEnclosingExpression(), p); +// scan(tree.getIdentifier(), p); +// scan(tree.getClassBody(), p); +// +// return null; +// } // @Override // public Void visitMethodInvocation(MethodInvocationTree node, Void p) {