Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of deprecated method and use the one in CF #438

Merged
merged 7 commits into from
Mar 22, 2024

Conversation

Ao-senXiong
Copy link

@Ao-senXiong Ao-senXiong commented Feb 21, 2024

This PR will work on removing old API use and fixes deprecation warnings.

@Ao-senXiong Ao-senXiong changed the title Remove deprecated method and use the one in CF Remove use of deprecated method and use the one in CF Mar 1, 2024
@Ao-senXiong
Copy link
Author

@wmdietl Please take a look at this PR.

Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! Can you please update the javadoc for the method, as this PR is doing what that comment asks.

if (viewpointAdapter != null) {
viewpointAdapter.viewpointAdaptConstructor(constructorReturnType, constructorElem, constructorType);
}
AnnotatedDeclaredType constructorReturnType =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some comments, e.g. why are we computing and annotating constructorReturnType, even though it's not used later in the method.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this only necessary for the return type, not the parameter types? The old code also did something with the parameters.

Because other code is in the super call now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which leaves the question why the supermethod isn't doing that... but okay, let's just do it only here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I leave a todo there for future clean up.

@Ao-senXiong
Copy link
Author

Thanks for fixing this! Can you please update the javadoc for the method, as this PR is doing what that comment asks.

Sure, deleted the code javadoc

Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this up!

src/checkers/inference/InferenceAnnotatedTypeFactory.java Outdated Show resolved Hide resolved
@@ -374,47 +376,21 @@ public Boolean visitDeclared(AnnotatedDeclaredType type, Void p) {
}
};

/**
* TODO: Similar but not the same as AnnotatedTypeFactory.constructorFromUse with space set aside from
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comment about why this is overridden would still be good.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, updated!

@Ao-senXiong Ao-senXiong requested a review from wmdietl March 18, 2024 01:22
Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, just one small cleanup.

@@ -70,6 +70,8 @@
import com.sun.source.tree.MethodInvocationTree;
import com.sun.source.tree.NewClassTree;
import com.sun.source.tree.Tree;
import org.checkerframework.javacutil.TypesUtils;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two imports seem unused. Can they be removed?
If they are needed, can you add them to the org.checkerframework... section earlier in the file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, removed. Sometimes we should add spotless to prevent un used import automatically.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, once we're done with the updates, we should get back to #430.

if (viewpointAdapter != null) {
viewpointAdapter.viewpointAdaptConstructor(constructorReturnType, constructorElem, constructorType);
}
AnnotatedDeclaredType constructorReturnType =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which leaves the question why the supermethod isn't doing that... but okay, let's just do it only here.

@Ao-senXiong Ao-senXiong requested a review from wmdietl March 22, 2024 01:10
@wmdietl wmdietl merged commit 7b587d4 into opprop:master Mar 22, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants