From 5dc55b7f700d5974cc9116dd0cd07e903a092d71 Mon Sep 17 00:00:00 2001 From: Aosen Xiong Date: Wed, 24 Apr 2024 13:30:45 -0400 Subject: [PATCH] Update with new CF API --- .../java/pico/inference/PICOInferenceAnnotatedTypeFactory.java | 2 +- src/main/java/pico/inference/PICOVariableAnnotator.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/pico/inference/PICOInferenceAnnotatedTypeFactory.java b/src/main/java/pico/inference/PICOInferenceAnnotatedTypeFactory.java index 835a6dc..032f75f 100644 --- a/src/main/java/pico/inference/PICOInferenceAnnotatedTypeFactory.java +++ b/src/main/java/pico/inference/PICOInferenceAnnotatedTypeFactory.java @@ -140,7 +140,7 @@ public AnnotatedDeclaredType getSelfType(Tree tree) { if (enclosingClass == null) { // I hope this only happens when tree is a fake tree that // we created, e.g. when desugaring enhanced-for-loops. - enclosingClass = getCurrentClassTree(tree); + enclosingClass = TreePathUtil.enclosingClass(getPath(tree)); } // "type" is right now VarAnnot inserted to the bound of "enclosingClass" AnnotatedDeclaredType type = getAnnotatedType(enclosingClass); diff --git a/src/main/java/pico/inference/PICOVariableAnnotator.java b/src/main/java/pico/inference/PICOVariableAnnotator.java index c8bdb0f..eb2da93 100644 --- a/src/main/java/pico/inference/PICOVariableAnnotator.java +++ b/src/main/java/pico/inference/PICOVariableAnnotator.java @@ -218,7 +218,7 @@ public void storeElementType(Element element, AnnotatedTypeMirror atm) { // Copied from super implementation @Override protected boolean handleWasRawDeclaredTypes(AnnotatedDeclaredType adt) { - if (adt.wasRaw() && adt.getTypeArguments().size() != 0) { + if (adt.isUnderlyingTypeRaw() && adt.getTypeArguments().size() != 0) { // the type arguments should be wildcards AND if I get the real type of "tree" // it corresponds to the declaration of adt.getUnderlyingType Element declarationEle = adt.getUnderlyingType().asElement();