From e688ee229e55c38c215b6d8ae723c854d2d1f7fd Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Thu, 11 Jul 2024 10:50:23 -0700 Subject: [PATCH 01/10] Fix. --- .../typeinference8/InvocationTypeInference.java | 5 +++++ .../util/typeinference8/bound/BoundSet.java | 7 ++++++- .../constraint/ConstraintSet.java | 10 +++++++++- framework/tests/all-systems/Issue6652.java | 17 +++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 framework/tests/all-systems/Issue6652.java diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java index 8a933fd6c51..e3151aa4f5d 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java @@ -669,6 +669,11 @@ private BoundSet getB4(BoundSet b3, ConstraintSet c) { } c.remove(subset); BoundSet newBounds = subset.reduce(context); + if (newBounds.setFoundAA) { + c.addAll(subset); + newBounds.setFoundAA = false; + continue; + } b3.incorporateToFixedPoint(newBounds); } return b3; diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java index a07d0b71c55..b9912b5f279 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java @@ -43,6 +43,8 @@ public class BoundSet implements ReductionResult { /** The error message to report to users. */ public String errorMsg = ""; + public boolean setFoundAA = false; + /** Whether this bounds set contains the false bound. */ private boolean containsFalse; @@ -252,7 +254,10 @@ public Dependencies getDependencies() { * @return the dependencies between all variables in this bound set */ public Dependencies getDependencies(Collection additionalVars) { - variables.addAll(additionalVars); + for (Theta t : context.maps.values()) { + variables.addAll(t.values()); + } + // variables.addAll(additionalVars); Dependencies dependencies = new Dependencies(); for (CaptureBound capture : captures) { diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java index 2ef8416be3c..0755c0a3b38 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java @@ -286,7 +286,12 @@ public BoundSet reduce(Java8InferenceContext context) { if (this.list.size() > BoundSet.MAX_INCORPORATION_STEPS) { throw new BugInCF("TO MANY CONSTRAINTS: %s", context.pathToExpression.getLeaf()); } - boundSet.merge(reduceOneStep(context)); + BoundSet result = reduceOneStep(context); + boundSet.merge(result); + if (result.setFoundAA) { + boundSet.setFoundAA = true; + return boundSet; + } } return boundSet; @@ -332,6 +337,9 @@ public BoundSet reduceOneStep(Java8InferenceContext context) { boundSet.errorMsg = constraint.toString(); } } + if (constraint instanceof AdditionalArgument) { + boundSet.setFoundAA = true; + } return boundSet; } } diff --git a/framework/tests/all-systems/Issue6652.java b/framework/tests/all-systems/Issue6652.java new file mode 100644 index 00000000000..7b52c1f31ac --- /dev/null +++ b/framework/tests/all-systems/Issue6652.java @@ -0,0 +1,17 @@ +import java.util.function.Supplier; + +class Issue6652 { + interface Arbitrary {} + + Arbitrary> test() { + return lazyOf(() -> of(() -> "foo")); + } + + static Arbitrary of(T value) { + throw new UnsupportedOperationException("implementation omitted"); + } + + static Arbitrary lazyOf(Supplier> supplier) { + throw new UnsupportedOperationException("implementation omitted"); + } +} From 9b93bf5b63ba7c689a0ad1c7b19dc733b6dae513 Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Thu, 11 Jul 2024 11:32:24 -0700 Subject: [PATCH 02/10] Clean up. --- .../typeinference8/InvocationTypeInference.java | 7 ++++++- .../util/typeinference8/bound/BoundSet.java | 5 +---- .../typeinference8/constraint/ConstraintSet.java | 15 --------------- .../typeinference8/constraint/TypeConstraint.java | 10 ---------- 4 files changed, 7 insertions(+), 30 deletions(-) diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java index e3151aa4f5d..0fde3a396c3 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java @@ -10,6 +10,7 @@ import com.sun.source.util.TreePath; import java.util.ArrayList; import java.util.Collection; +import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import javax.lang.model.type.ExecutableType; @@ -646,7 +647,11 @@ private boolean notPertinentToApplicability( */ private BoundSet getB4(BoundSet b3, ConstraintSet c) { // C might contain new variables that have not yet been added to the b3 bound set. - Set newVariables = c.getAllInferenceVariables(); + Set newVariables = new LinkedHashSet<>(); + for (Theta t : context.maps.values()) { + newVariables.addAll(t.values()); + } + while (!c.isEmpty()) { ConstraintSet subset = c.getClosedSubset(b3.getDependencies(newVariables)); diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java index b9912b5f279..eca20798908 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java @@ -254,10 +254,7 @@ public Dependencies getDependencies() { * @return the dependencies between all variables in this bound set */ public Dependencies getDependencies(Collection additionalVars) { - for (Theta t : context.maps.values()) { - variables.addAll(t.values()); - } - // variables.addAll(additionalVars); + variables.addAll(additionalVars); Dependencies dependencies = new Dependencies(); for (CaptureBound capture : captures) { diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java index 0755c0a3b38..485ceafd0b3 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java @@ -230,21 +230,6 @@ public ConstraintSet getClosedSubset(Dependencies dependencies) { return new ConstraintSet(consideredConstraints.get(0)); } - /** - * Return all variables mentioned by any constraint in this set. - * - * @return all variables mentioned by any constraint in this set - */ - public Set getAllInferenceVariables() { - Set vars = new LinkedHashSet<>(); - for (Constraint c : list) { - if (c instanceof TypeConstraint) { - vars.addAll(((TypeConstraint) c).getInferenceVariables()); - } - } - return vars; - } - /** * Return all input variables for all constraints in this set. * diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/TypeConstraint.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/TypeConstraint.java index 6d6de5b7373..aa45b9ffa0f 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/TypeConstraint.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/TypeConstraint.java @@ -5,7 +5,6 @@ import com.sun.source.tree.LambdaExpressionTree; import com.sun.source.tree.MemberReferenceTree; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; import javax.lang.model.type.TypeKind; @@ -46,15 +45,6 @@ public AbstractType getT() { return T; } - /** - * Returns a collection of all inference variables mentioned by this constraint. - * - * @return a collection of all inference variables mentioned by this constraint - */ - public Collection getInferenceVariables() { - return T.getInferenceVariables(); - } - /** * For lambda and method references constraints, input variables are roughly the inference * variables mentioned by they function type's parameter types and return types. For conditional From dd47c887ee3128a2b627085cec1c965e5f4e13b1 Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Thu, 11 Jul 2024 11:48:14 -0700 Subject: [PATCH 03/10] Revert "Clean up." This reverts commit 9b93bf5b63ba7c689a0ad1c7b19dc733b6dae513. --- .../typeinference8/InvocationTypeInference.java | 7 +------ .../util/typeinference8/bound/BoundSet.java | 5 ++++- .../typeinference8/constraint/ConstraintSet.java | 15 +++++++++++++++ .../typeinference8/constraint/TypeConstraint.java | 10 ++++++++++ 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java index 0fde3a396c3..e3151aa4f5d 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java @@ -10,7 +10,6 @@ import com.sun.source.util.TreePath; import java.util.ArrayList; import java.util.Collection; -import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import javax.lang.model.type.ExecutableType; @@ -647,11 +646,7 @@ private boolean notPertinentToApplicability( */ private BoundSet getB4(BoundSet b3, ConstraintSet c) { // C might contain new variables that have not yet been added to the b3 bound set. - Set newVariables = new LinkedHashSet<>(); - for (Theta t : context.maps.values()) { - newVariables.addAll(t.values()); - } - + Set newVariables = c.getAllInferenceVariables(); while (!c.isEmpty()) { ConstraintSet subset = c.getClosedSubset(b3.getDependencies(newVariables)); diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java index eca20798908..b9912b5f279 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java @@ -254,7 +254,10 @@ public Dependencies getDependencies() { * @return the dependencies between all variables in this bound set */ public Dependencies getDependencies(Collection additionalVars) { - variables.addAll(additionalVars); + for (Theta t : context.maps.values()) { + variables.addAll(t.values()); + } + // variables.addAll(additionalVars); Dependencies dependencies = new Dependencies(); for (CaptureBound capture : captures) { diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java index 485ceafd0b3..0755c0a3b38 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java @@ -230,6 +230,21 @@ public ConstraintSet getClosedSubset(Dependencies dependencies) { return new ConstraintSet(consideredConstraints.get(0)); } + /** + * Return all variables mentioned by any constraint in this set. + * + * @return all variables mentioned by any constraint in this set + */ + public Set getAllInferenceVariables() { + Set vars = new LinkedHashSet<>(); + for (Constraint c : list) { + if (c instanceof TypeConstraint) { + vars.addAll(((TypeConstraint) c).getInferenceVariables()); + } + } + return vars; + } + /** * Return all input variables for all constraints in this set. * diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/TypeConstraint.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/TypeConstraint.java index aa45b9ffa0f..6d6de5b7373 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/TypeConstraint.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/TypeConstraint.java @@ -5,6 +5,7 @@ import com.sun.source.tree.LambdaExpressionTree; import com.sun.source.tree.MemberReferenceTree; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.List; import javax.lang.model.type.TypeKind; @@ -45,6 +46,15 @@ public AbstractType getT() { return T; } + /** + * Returns a collection of all inference variables mentioned by this constraint. + * + * @return a collection of all inference variables mentioned by this constraint + */ + public Collection getInferenceVariables() { + return T.getInferenceVariables(); + } + /** * For lambda and method references constraints, input variables are roughly the inference * variables mentioned by they function type's parameter types and return types. For conditional From e15e8bd9f0b5f057956fd5b151ec00c67f5e56e2 Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Fri, 12 Jul 2024 11:38:05 -0700 Subject: [PATCH 04/10] Change test case. --- framework/tests/all-systems/DiamondMethodRef.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/framework/tests/all-systems/DiamondMethodRef.java b/framework/tests/all-systems/DiamondMethodRef.java index ad5c74266cf..73cc13498c1 100644 --- a/framework/tests/all-systems/DiamondMethodRef.java +++ b/framework/tests/all-systems/DiamondMethodRef.java @@ -16,10 +16,17 @@ void method(CharacterDisplay display) { .boxed() .collect( Collectors.toMap( - Function.identity(), hitDie -> 1, Integer::sum, LinkedHashMap::new))) + Function.identity(), + hitDie -> 1, + DiamondMethodRef::sum, + LinkedHashMap::new))) .mapToInt(hdMap -> hdMap.entrySet().stream().mapToInt(Map.Entry::getValue).sum()); } + static Integer sum(Integer a, Integer b) { + return a + b; + } + public static class CharacterDisplay { public Set getClassSet() { throw new RuntimeException(); From 36c1a782020d4dac406fdbf75674f21b666049fe Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Fri, 12 Jul 2024 12:23:38 -0700 Subject: [PATCH 05/10] Clean up. --- .../InvocationTypeInference.java | 6 ++--- .../util/typeinference8/bound/BoundSet.java | 2 -- .../constraint/ConstraintSet.java | 26 ++++++++++++++----- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java index e3151aa4f5d..381de154fb2 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java @@ -668,11 +668,9 @@ private BoundSet getB4(BoundSet b3, ConstraintSet c) { c.applyInstantiations(); } c.remove(subset); - BoundSet newBounds = subset.reduce(context); - if (newBounds.setFoundAA) { + BoundSet newBounds = subset.reduceAA(context); + if (!subset.isEmpty()) { c.addAll(subset); - newBounds.setFoundAA = false; - continue; } b3.incorporateToFixedPoint(newBounds); } diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java index b9912b5f279..fe38d4571b4 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/bound/BoundSet.java @@ -43,8 +43,6 @@ public class BoundSet implements ReductionResult { /** The error message to report to users. */ public String errorMsg = ""; - public boolean setFoundAA = false; - /** Whether this bounds set contains the false bound. */ private boolean containsFalse; diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java index 0755c0a3b38..f853b48e3f8 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java @@ -288,12 +288,29 @@ public BoundSet reduce(Java8InferenceContext context) { } BoundSet result = reduceOneStep(context); boundSet.merge(result); - if (result.setFoundAA) { - boundSet.setFoundAA = true; + } + return boundSet; + } + + /** + * Reduces all the constraints in this set. (See JLS 18.2) + * + * @param context the context + * @return the bound set produced by reducing this constraint set + */ + public BoundSet reduceAA(Java8InferenceContext context) { + BoundSet boundSet = new BoundSet(context); + while (!this.isEmpty()) { + if (this.list.size() > BoundSet.MAX_INCORPORATION_STEPS) { + throw new BugInCF("TO MANY CONSTRAINTS: %s", context.pathToExpression.getLeaf()); + } + boolean foundAA = this.list.get(0).getKind() == Kind.ADDITIONAL_ARG; + BoundSet result = reduceOneStep(context); + if (foundAA) { return boundSet; } + boundSet.merge(result); } - return boundSet; } @@ -337,9 +354,6 @@ public BoundSet reduceOneStep(Java8InferenceContext context) { boundSet.errorMsg = constraint.toString(); } } - if (constraint instanceof AdditionalArgument) { - boundSet.setFoundAA = true; - } return boundSet; } } From e4fb5985b1b58b15fea92437039d125d59d9685a Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Mon, 15 Jul 2024 10:44:43 -0700 Subject: [PATCH 06/10] Tweak test case. --- framework/tests/all-systems/DiamondMethodRef.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/tests/all-systems/DiamondMethodRef.java b/framework/tests/all-systems/DiamondMethodRef.java index 73cc13498c1..2e3a55fa63d 100644 --- a/framework/tests/all-systems/DiamondMethodRef.java +++ b/framework/tests/all-systems/DiamondMethodRef.java @@ -24,7 +24,7 @@ void method(CharacterDisplay display) { } static Integer sum(Integer a, Integer b) { - return a + b; + throw new RuntimeException(); } public static class CharacterDisplay { @@ -33,7 +33,7 @@ public Set getClassSet() { } public final int getLevel(PCClass pcc) { - return 0; + throw new RuntimeException(); } public HitDie getLevelHitDie(PCClass pcClass, final int classLevel) { @@ -45,7 +45,7 @@ static class PCClass {} static class HitDie { int getDie() { - return 0; + throw new RuntimeException(); } } } From aa2b47dc482ed848bf78008c31df470ee7fc64d0 Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Mon, 15 Jul 2024 12:41:49 -0700 Subject: [PATCH 07/10] Improve javadoc. --- .../util/typeinference8/InvocationTypeInference.java | 2 +- .../util/typeinference8/constraint/ConstraintSet.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java index 381de154fb2..f023a5ec7de 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java @@ -668,7 +668,7 @@ private BoundSet getB4(BoundSet b3, ConstraintSet c) { c.applyInstantiations(); } c.remove(subset); - BoundSet newBounds = subset.reduceAA(context); + BoundSet newBounds = subset.reduceAdditionalArgOnce(context); if (!subset.isEmpty()) { c.addAll(subset); } diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java index f853b48e3f8..6bffb97a137 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java @@ -293,12 +293,13 @@ public BoundSet reduce(Java8InferenceContext context) { } /** - * Reduces all the constraints in this set. (See JLS 18.2) + * Reduces all the constraints in this set. (See JLS 18.2) If an {@link AdditionalArgument} is + * found it is reduced one step and then this method is returns. * * @param context the context * @return the bound set produced by reducing this constraint set */ - public BoundSet reduceAA(Java8InferenceContext context) { + public BoundSet reduceAdditionalArgOnce(Java8InferenceContext context) { BoundSet boundSet = new BoundSet(context); while (!this.isEmpty()) { if (this.list.size() > BoundSet.MAX_INCORPORATION_STEPS) { From 4f0940be31811fb3e29bf0d432797593f1c1b54c Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Mon, 15 Jul 2024 12:44:08 -0700 Subject: [PATCH 08/10] More documentation. --- .../framework/util/typeinference8/InvocationTypeInference.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java index f023a5ec7de..7afa40431f5 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/InvocationTypeInference.java @@ -670,6 +670,9 @@ private BoundSet getB4(BoundSet b3, ConstraintSet c) { c.remove(subset); BoundSet newBounds = subset.reduceAdditionalArgOnce(context); if (!subset.isEmpty()) { + // The subset is not empty at this point if an additional argument constraint was found. + // In this case, a new subset needs to be picked so that dependencies of the constraints + // from reducing the additional argument constraint can be taken into account. c.addAll(subset); } b3.incorporateToFixedPoint(newBounds); From ffba010ece276ff10f90f66ccc64a5d811dd51e7 Mon Sep 17 00:00:00 2001 From: Suzanne Millstein Date: Tue, 16 Jul 2024 10:49:05 -0700 Subject: [PATCH 09/10] Fix typo Co-authored-by: Manu Sridharan --- .../framework/util/typeinference8/constraint/ConstraintSet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java index 6bffb97a137..5135c03fea3 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java @@ -303,7 +303,7 @@ public BoundSet reduceAdditionalArgOnce(Java8InferenceContext context) { BoundSet boundSet = new BoundSet(context); while (!this.isEmpty()) { if (this.list.size() > BoundSet.MAX_INCORPORATION_STEPS) { - throw new BugInCF("TO MANY CONSTRAINTS: %s", context.pathToExpression.getLeaf()); + throw new BugInCF("TOO MANY CONSTRAINTS: %s", context.pathToExpression.getLeaf()); } boolean foundAA = this.list.get(0).getKind() == Kind.ADDITIONAL_ARG; BoundSet result = reduceOneStep(context); From 7dc1e9a2b2e75aca7f17c1ed7474efd9420180a1 Mon Sep 17 00:00:00 2001 From: Michael Ernst Date: Thu, 18 Jul 2024 10:11:08 -0700 Subject: [PATCH 10/10] Fix grammar --- .../framework/util/typeinference8/constraint/ConstraintSet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java index 5135c03fea3..452e8d75d1d 100644 --- a/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java +++ b/framework/src/main/java/org/checkerframework/framework/util/typeinference8/constraint/ConstraintSet.java @@ -294,7 +294,7 @@ public BoundSet reduce(Java8InferenceContext context) { /** * Reduces all the constraints in this set. (See JLS 18.2) If an {@link AdditionalArgument} is - * found it is reduced one step and then this method is returns. + * found it is reduced one step and then this method returns. * * @param context the context * @return the bound set produced by reducing this constraint set